Merge branch 'feature/browser-0520-zz' into feature/task1.0.0

feature/task1.0.0
张征 3 years ago
commit 5cadaab959

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 51 KiB

@ -275,10 +275,8 @@ export default {
order: "", order: "",
}); });
vm.detailData = res1.result; vm.detailData = res1.result;
vm.skuData = res2.result.map(i => { vm.skuData = res2.result;
i.attributeSymbolList = i.attributeSymbolList.split(',')
return i;
});
vm.recommendedData = res3.result.records; vm.recommendedData = res3.result.records;
vm.pageLoading = false; vm.pageLoading = false;
if ( if (
@ -310,7 +308,7 @@ export default {
curSku() { curSku() {
return ( return (
this.skuData.find( this.skuData.find(
(i) => i.attributeSymbolList.join(',') === this.selectedSymbol.join(",") (i) => i.attributeSymbolList === this.selectedSymbol.join(",")
) || {} ) || {}
); );
}, },
@ -319,9 +317,9 @@ export default {
return this.detailData.attributeGroupList return this.detailData.attributeGroupList
.map((item) => { .map((item) => {
const activeAttr = item.attributes.find((i) => i.active); const activeAttr = item.attributes.find((i) => i.active);
return activeAttr?.symbol; return activeAttr ? activeAttr.symbol : ".";
}) })
.filter((i) => i).sort(); .filter((i) => i)//.sort();
}, },
/** /**
* 最大可购买数量 * 最大可购买数量
@ -461,43 +459,26 @@ export default {
setDisabledItem(item, groupIndex) { setDisabledItem(item, groupIndex) {
let vm = this; let vm = this;
vm.detailData.attributeGroupList.forEach((group, idx) => { vm.detailData.attributeGroupList.forEach((group, idx) => {
// if(groupIndex === idx) return false; //
// let symbolCache = Object.assign([], this.selectedSymbol);
group.attributes.forEach( item => { //
let symbolCache = Object.assign([],vm.selectedSymbol); if (groupIndex === idx) return false;
symbolCache.push(item.symbol); //
symbolCache.sort(); group.attributes.forEach((item) => {
const res = vm.skuData.filter(item => //
symbolCache.map(i => item.attributeSymbolList.includes(i.toString())).every(i => i) symbolCache[idx] = item.symbol;
).find(i => i.stock > 0); const reg = new RegExp(symbolCache.join(","));
if(res){ // SKU
item.disabled = false; const res = vm.skuData
}else{ .filter((i) => reg.test(i.attributeSymbolList))
item.disabled = true; .find((i) => i.stock > 0);
} if (res) {
}); item.disabled = false;
}) } else {
// vm.detailData.attributeGroupList.forEach((group, idx) => { item.disabled = true;
// // }
// let symbolCache = Object.assign([], this.selectedSymbol); });
// // });
// if (groupIndex === idx) return false;
// //
// group.attributes.forEach((item) => {
// //
// symbolCache[idx] = item.symbol;
// const reg = new RegExp(symbolCache.join(","));
// // SKU
// const res = vm.skuData
// .filter((i) => reg.test(i.attributeSymbolList))
// .find((i) => i.stock > 0);
// if (res) {
// item.disabled = false;
// } else {
// item.disabled = true;
// }
// });
// });
}, },
buyNow() { buyNow() {
if (!this.$isLoginValidate()) { if (!this.$isLoginValidate()) {

Loading…
Cancel
Save