|
|
|
@ -319,7 +319,7 @@ |
|
|
|
|
this.getCartNum(); |
|
|
|
|
this.goodsHidden = true; |
|
|
|
|
this.footerswitch = true; |
|
|
|
|
this.isAllSelect = true; //全不选 |
|
|
|
|
// this.isAllSelect = true; //全不选 |
|
|
|
|
this.selectValue = []; //选中的数据 |
|
|
|
|
this.isShowAuth = false; |
|
|
|
|
uni.setStorage({ |
|
|
|
@ -690,7 +690,7 @@ |
|
|
|
|
} |
|
|
|
|
that.onMyEvent(); |
|
|
|
|
that.getCartList(true); |
|
|
|
|
that.isAllSelect = true |
|
|
|
|
// that.isAllSelect = true |
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
|
that.$util.Tips({ |
|
|
|
@ -740,12 +740,20 @@ |
|
|
|
|
// 购物车列表 |
|
|
|
|
getCartList: function(isChange) { |
|
|
|
|
let that = this; |
|
|
|
|
let resArr=[] |
|
|
|
|
this.cartList.valid.forEach(item=>{ |
|
|
|
|
item.list.forEach(i=>{ |
|
|
|
|
if(i.check){ |
|
|
|
|
resArr.push(i.product_id) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
getCartList().then(res => { |
|
|
|
|
res.data.list.forEach((item, index) => { |
|
|
|
|
// item.allCheck = true |
|
|
|
|
this.$set(item,'allCheck',true) |
|
|
|
|
// this.$set(item,'allCheck',true) |
|
|
|
|
item.list.forEach((goods, j) => { |
|
|
|
|
goods.check = true |
|
|
|
|
// goods.check = true |
|
|
|
|
if (goods.cart_num == 1) { |
|
|
|
|
goods.numSub = true; |
|
|
|
|
} else { |
|
|
|
@ -756,7 +764,15 @@ |
|
|
|
|
} else { |
|
|
|
|
goods.numAdd = false; |
|
|
|
|
} |
|
|
|
|
if(resArr.includes(goods.product_id)){ |
|
|
|
|
goods.check = true; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
let selectedArr = item.list.filter(y=>{return y.check}) |
|
|
|
|
|
|
|
|
|
if(selectedArr.length==item.list.length){ |
|
|
|
|
this.$set(item,'allCheck',true) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.cartList.valid = res.data.list; |
|
|
|
|
// let newArr=JSON.parse(uni.getStorageSync('cartSelectedGoods')) |
|
|
|
@ -782,7 +798,7 @@ |
|
|
|
|
this.recommend = false |
|
|
|
|
} |
|
|
|
|
const sku = {} |
|
|
|
|
this.checkboxAllChange(true) |
|
|
|
|
// this.checkboxAllChange(true) |
|
|
|
|
// |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|