Commit 6fb9a32e by 前端

Merge branch 'SAAS+V4.53.0-0528' into 'develop'

上线合并

See merge request !395
2 parents 893bbf9b d19f6831
...@@ -85,62 +85,62 @@ Component({ ...@@ -85,62 +85,62 @@ Component({
strTemp strTemp
} = this.data; } = this.data;
let result = goodsList[index].multipleSpecificationsGoods.specificationList.every(item => item.value) let result = goodsList[index].multipleSpecificationsGoods.specificationList.every(item => item.value)
console.log(result, goodsList[index],1) console.log(result, goodsList[index], 1)
if (result) { if (result) {
if (!cancel) { if (!cancel) {
let arr = [] let arr = []
goodsList[index].multipleSpecificationsGoods.specificationList.forEach(spec => { goodsList[index].multipleSpecificationsGoods.specificationList.forEach(spec => {
arr.push(spec.value) arr.push(spec.value)
}) })
let str = arr.join(';~;') let str = arr.join(';~;')
// strTemp用来存储上一次选中的值,判断规格是否重新选择 ,避免页面交互闪烁 // strTemp用来存储上一次选中的值,判断规格是否重新选择 ,避免页面交互闪烁
// if (type && str != strTemp) { // if (type && str != strTemp) {
//获取该规格的商品是否存在 //获取该规格的商品是否存在
console.log(str) console.log(str)
if( goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]){ if (goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]) {
goodsList[index].active = true goodsList[index].active = true
console.log(goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str],'str') console.log(goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str], 'str')
goodsList[index].multipleSpecificationsGoods.goods = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str] goodsList[index].multipleSpecificationsGoods.goods = goodsList[index].multipleSpecificationsGoods.specificationGoodsMap[str]
goodsList[index].multipleSpecificationsGoods.goods.goodsId = goodsList[index].multipleSpecificationsGoods.goods.merchantGoodsId goodsList[index].multipleSpecificationsGoods.goods.goodsId = goodsList[index].multipleSpecificationsGoods.goods.merchantGoodsId
goodsList[index].multipleSpecificationsGoods.goods.specificationStr = goodsList[index].multipleSpecificationsGoods.goods.specificationData.replace(/;~;/g, '/') goodsList[index].multipleSpecificationsGoods.goods.specificationStr = goodsList[index].multipleSpecificationsGoods.goods.specificationData.replace(/;~;/g, '/')
}else{ } else {
console.log(88888) console.log(88888)
wx.$util.showToast('暂无该规格商品') wx.$util.showToast('暂无该规格商品')
goodsList[index].active=false goodsList[index].active = false
goodsList[index].multipleSpecificationsGoods.goods = '' goodsList[index].multipleSpecificationsGoods.goods = ''
goodsList[index].multipleSpecificationsGoods.specificationList.forEach(item => { goodsList[index].multipleSpecificationsGoods.specificationList.forEach(item => {
item.value = '' item.value = ''
}) })
} }
this.setData({
goodsList,
strTemp: str
}, () => {
//同步更新
this.synchronousChange(goodsList[index])
})
} else {
if (goodsList[index].active) {
goodsList[index].active = false
goodsList[index].multipleSpecificationsGoods.goods = ''
goodsList[index].multipleSpecificationsGoods.specificationList.forEach(item => {
item.value = ''
})
console.log(33333, goodsList)
this.setData({ this.setData({
goodsList, goodsList
strTemp: str
}, () => { }, () => {
//同步更新
this.synchronousChange(goodsList[index]) this.synchronousChange(goodsList[index])
}) })
}else{
if(goodsList[index].active){
goodsList[index].active=false
goodsList[index].multipleSpecificationsGoods.goods = ''
goodsList[index].multipleSpecificationsGoods.specificationList.forEach(item => {
item.value = ''
})
console.log(33333, goodsList)
this.setData({
goodsList
},()=>{
this.synchronousChange(goodsList[index])
})
}
} }
} }
}
return result
return result
}, },
setGoodsActive(isFlag) { setGoodsActive(isFlag) {
if (this.data.show) { if (this.data.show) {
...@@ -150,7 +150,7 @@ Component({ ...@@ -150,7 +150,7 @@ Component({
goodsData goodsData
// recordList // recordList
} = this.data } = this.data
console.log(chooseGoodsList, goodsList,goodsData, 'goodsList') console.log(chooseGoodsList, goodsList, goodsData, 'goodsList')
let chooseList = []; let chooseList = [];
goodsData.map((e) => { goodsData.map((e) => {
if (e.active) { if (e.active) {
...@@ -359,7 +359,7 @@ Component({ ...@@ -359,7 +359,7 @@ Component({
} = this.data; } = this.data;
//单独处理多规格商品点击事件 //单独处理多规格商品点击事件
if (item.goodsFlag == 2) { if (item.goodsFlag == 2) {
if (!this.watchAllChose(ind,true)) { if (!this.watchAllChose(ind, true)) {
wx.$util.showToast('请先选择该商品规格') wx.$util.showToast('请先选择该商品规格')
return return
} }
...@@ -386,22 +386,22 @@ Component({ ...@@ -386,22 +386,22 @@ Component({
if (i.goodsFlag == 1 && item.goods) { if (i.goodsFlag == 1 && item.goods) {
if (i.goods.goodsId == item.goods.goodsId) { if (i.goods.goodsId == item.goods.goodsId) {
i.active = item.active i.active = item.active
i.count = item.count i.count = item.count || 1
i.goods.sellPrice = item.goods.sellPrice i.goods.sellPrice = item.goods.sellPrice
} }
} else if (i.goodsFlag == 2 &&item.goodsFlag==2) { } else if (i.goodsFlag == 2 && item.goodsFlag == 2) {
if(i.multipleSpecificationsGoods.id==item.multipleSpecificationsGoods.id){ if (i.multipleSpecificationsGoods.id == item.multipleSpecificationsGoods.id) {
i.active = item.active i.active = item.active
i.count = item.count i.count = item.count || 1
i.multipleSpecificationsGoods=item.multipleSpecificationsGoods i.multipleSpecificationsGoods = item.multipleSpecificationsGoods
if(!item.active){ if (!item.active) {
i.multipleSpecificationsGoods.goods='' i.multipleSpecificationsGoods.goods = ''
i.multipleSpecificationsGoods.specificationList.forEach(m=>{ i.multipleSpecificationsGoods.specificationList.forEach(m => {
m.value='' m.value = ''
}) })
} }
} }
} }
}) })
this.setData({ this.setData({
...@@ -423,10 +423,10 @@ Component({ ...@@ -423,10 +423,10 @@ Component({
console.log(target) console.log(target)
this.setData({ this.setData({
[target]: item.count, [target]: item.count,
},()=>{ }, () => {
this.synchronousChange(this.data.goodsList[ind]) this.synchronousChange(this.data.goodsList[ind])
}); });
}, },
input(e) { input(e) {
let { let {
...@@ -443,7 +443,7 @@ Component({ ...@@ -443,7 +443,7 @@ Component({
this.setData({ this.setData({
[target]: Number(value), [target]: Number(value),
}, },
()=>{ () => {
this.synchronousChange(this.data.goodsList[ind]) this.synchronousChange(this.data.goodsList[ind])
} }
); );
......
...@@ -1446,11 +1446,11 @@ Page({ ...@@ -1446,11 +1446,11 @@ Page({
packageGoodsList packageGoodsList
} = orderObj; } = orderObj;
let chooseList = []; let chooseList = [];
subOrderList = subOrderList.concat(packageGoodsList) subOrderList = subOrderList.concat(packageGoodsList)
if (subOrderList && subOrderList.length) { if (subOrderList && subOrderList.length) {
subOrderList.map((e) => { subOrderList.map((e) => {
// 是普通商品 // 是普通商品
if (e && !e.packageName) { if (e && !e.packageName) {
...@@ -1533,6 +1533,7 @@ Page({ ...@@ -1533,6 +1533,7 @@ Page({
this.setGoodsTotal(chooseList); this.setGoodsTotal(chooseList);
}, },
handleSpecificationsEcho(item) { handleSpecificationsEcho(item) {
console.log(item)
let { let {
otherProduct otherProduct
} = this.data, } = this.data,
...@@ -1556,6 +1557,7 @@ Page({ ...@@ -1556,6 +1557,7 @@ Page({
goods: { goods: {
...tempData, ...tempData,
price: item.price, price: item.price,
sellPrice: item.price,
goodsId: item.goodsId, goodsId: item.goodsId,
specificationStr: item.specificationData.replace(/;~;/g, '/') specificationStr: item.specificationData.replace(/;~;/g, '/')
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!