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