Commit e864c8d3 by 萱草

update: bug修改

parent 20dd3d47
......@@ -112,10 +112,12 @@ export default {
giftSkuStrand: skuList[i].giftSkuStrand, // 礼品sku规格信息
giftId: skuList[i].giftId
});
for (let j = 0; j < JSON.parse(skuList[i].giftSkuStrand).length; j++) {
mapData[i].id.push(JSON.parse(skuList[i].giftSkuStrand)[j].specStandardValueId);
if(skuList[i].giftSkuStrand){
for (let j = 0; j < JSON.parse(skuList[i].giftSkuStrand).length; j++) {
mapData[i].id.push(JSON.parse(skuList[i].giftSkuStrand)[j].specStandardValueId);
}
mapData[i].mapId = mapData[i].id.join('_');
}
mapData[i].mapId = mapData[i].id.join('_');
}
for (let item of mapData) {
skuSellObj[item.mapId] = {
......@@ -133,8 +135,7 @@ export default {
this.skuSellObj = deepClone(skuSellObj);
console.log(this.skuSellObj);
}
this.goodsStandardInfo = JSON.parse(this.giftSpecInfo); // 礼品规格信息
console.log(this.goodsStandardInfo);
this.goodsStandardInfo = this.giftSpecInfo ? JSON.parse(this.giftSpecInfo) : []; // 礼品规格信息
if (this.goodsStandardInfo.length > 0) {
this.isStdImg = this.goodsStandardInfo[0].standardimg === 2 ? true : false;
} else {
......@@ -142,6 +143,8 @@ export default {
}
if (this.goodsStandardInfo.length > 0) {
this.getSkuList();
}else{
this.giftSkuId = skuList[0].giftSkuId;
}
}
});
......@@ -225,7 +228,7 @@ export default {
}
this.skuSellObj = deepClone(this.skuSellObj);
this.costPrice = this.skuSellObj[this.goodsSkuList[0].mapId].giftSkuCostPrice;
this.giftSkuId = this.skuSellObj[this.goodsSkuList[0].mapId].giftSkuId;
// this.giftSkuId = this.skuSellObj[this.goodsSkuList[0].mapId].giftSkuId;
this.refash = !this.refash;
},
combine(arr) {
......
......@@ -134,10 +134,12 @@ export default {
giftSkuStrand: skuList[i].giftSkuStrand, // 礼品sku规格信息
giftId: skuList[i].giftId
});
for (let j = 0; j < JSON.parse(skuList[i].giftSkuStrand).length; j++) {
mapData[i].id.push(JSON.parse(skuList[i].giftSkuStrand)[j].specStandardValueId);
if(skuList[i].giftSkuStrand){
for (let j = 0; j < JSON.parse(skuList[i].giftSkuStrand).length; j++) {
mapData[i].id.push(JSON.parse(skuList[i].giftSkuStrand)[j].specStandardValueId);
}
mapData[i].mapId = mapData[i].id.join('_');
}
mapData[i].mapId = mapData[i].id.join('_');
}
for (let item of mapData) {
skuSellObj[item.mapId] = {
......@@ -155,8 +157,7 @@ export default {
this.skuSellObj = deepClone(skuSellObj);
console.log(this.skuSellObj);
}
this.goodsStandardInfo = JSON.parse(this.giftSpecInfo); // 礼品规格信息
console.log(this.goodsStandardInfo);
this.goodsStandardInfo = this.giftSpecInfo ? JSON.parse(this.giftSpecInfo) : []; // 礼品规格信息
if (this.goodsStandardInfo.length > 0) {
this.isStdImg = this.goodsStandardInfo[0].standardimg === 2 ? true : false;
} else {
......@@ -164,6 +165,8 @@ export default {
}
if (this.goodsStandardInfo.length > 0) {
this.getSkuList();
}else{
this.giftSkuId = skuList[0].giftSkuId;
}
}
});
......@@ -290,7 +293,7 @@ export default {
}
}
this.skuSellObj = deepClone(this.skuSellObj);
this.giftSkuId = this.skuSellObj[this.goodsSkuList[0].mapId].giftSkuId;
// this.giftSkuId = this.skuSellObj[this.goodsSkuList[0].mapId].giftSkuId;
console.log(this.skuSellObj);
this.refash = !this.refash;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment