修复购物车全选显示不正确问题

master
paulGao 2021-12-28 19:50:06 +08:00
parent 2020f55826
commit 7fb96f1eac
1 changed files with 9 additions and 3 deletions

View File

@ -204,7 +204,7 @@ export default {
cartDetail: "", // cartDetail: "", //
goodsVal: "", // goodsVal: "", //
isEdit: false, // isEdit: false, //
checkout: true, // checkout: false, //
WEIXIN_num: "", // WEIXIN_num: "", //
}; };
}, },
@ -516,16 +516,20 @@ export default {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
if (result.data.success) { if (result.data.success) {
this.cartDetail = result.data.result; this.cartDetail = result.data.result;
this.checkout = true; let checkouted = true;
for (let i = 0; i < this.cartDetail.cartList.length; i++) { for (let i = 0; i < this.cartDetail.cartList.length; i++) {
let item = this.cartDetail.cartList[i]; let item = this.cartDetail.cartList[i];
console.log(item);
// //
if (item.checked == 0) { if (item.checked == 0) {
this.checkout = false; checkouted = false;
} }
// 便 // 便
item.skuList && item.skuList &&
item.skuList.forEach((sku) => { item.skuList.forEach((sku) => {
if (sku.checked == 0) {
checkouted = false;
}
if(Object.keys(sku.promotionMap).length != 0) if(Object.keys(sku.promotionMap).length != 0)
{ {
Object.keys(sku.promotionMap).forEach((pro, proIndex) => { Object.keys(sku.promotionMap).forEach((pro, proIndex) => {
@ -538,6 +542,7 @@ export default {
}); });
} }
this.checkout = checkouted;
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
}) })
@ -574,6 +579,7 @@ page {
box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05); box-shadow: 0 4rpx 12rpx 0 rgba(0, 0, 0, 0.05);
} }
.promotion-notice { .promotion-notice {
margin-top: 10px;
margin-left: 68rpx; margin-left: 68rpx;
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;