|
|
|
@ -264,11 +264,12 @@ |
|
|
|
|
this.getNav(); |
|
|
|
|
// uni.showTabBar(); |
|
|
|
|
if (this.isLogin == true) { |
|
|
|
|
this.isAllSelect = true; //全不选 |
|
|
|
|
this.getCartList(); |
|
|
|
|
this.getCartNum(); |
|
|
|
|
this.goodsHidden = true; |
|
|
|
|
this.footerswitch = true; |
|
|
|
|
this.isAllSelect = false; //全选 |
|
|
|
|
|
|
|
|
|
this.selectValue = []; //选中的数据 |
|
|
|
|
this.isShowAuth = false; |
|
|
|
|
uni.setStorage({ |
|
|
|
@ -673,7 +674,20 @@ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.cartList.valid = res.data.list |
|
|
|
|
this.cartList.valid = res.data.list; |
|
|
|
|
let newArr=JSON.parse(uni.getStorageSync('cartSelectedGoods')) |
|
|
|
|
this.cartList.valid.forEach(item=>{ |
|
|
|
|
item.list.forEach(p=>{ |
|
|
|
|
newArr.forEach(i=>{ |
|
|
|
|
if(p.product_id==i){ |
|
|
|
|
console.log(i) |
|
|
|
|
p.check=true |
|
|
|
|
this.$set(p,'check',true) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
this.cartList.invalid = res.data.fail |
|
|
|
|
if(res.data.list.length == 0 && res.data.list.length == 0){ |
|
|
|
|
this.recommend = true; |
|
|
|
@ -685,6 +699,7 @@ |
|
|
|
|
} |
|
|
|
|
const sku = {} |
|
|
|
|
this.checkboxAllChange() |
|
|
|
|
// |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 商铺全选 |
|
|
|
@ -705,7 +720,21 @@ |
|
|
|
|
}, |
|
|
|
|
// 商品选中 |
|
|
|
|
goodsCheck(goods) { |
|
|
|
|
goods.check = !goods.check |
|
|
|
|
console.log(goods) |
|
|
|
|
goods.check = !goods.check; |
|
|
|
|
let selectedCart=[] |
|
|
|
|
if(goods.check){ |
|
|
|
|
this.cartList.valid.forEach(item=>{ |
|
|
|
|
item.list.forEach(i=>{ |
|
|
|
|
if(goods.product_id==i.product_id){ |
|
|
|
|
selectedCart.push(i.product_id) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
uni.setStorageSync('cartSelectedGoods',JSON.stringify(selectedCart)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.cartAllCheck('goodsCheck') |
|
|
|
|
}, |
|
|
|
|
// 全选判断 |
|
|
|
|