|
|
@ -288,6 +288,14 @@ |
|
|
|
this.cartList.valid = res.data.list; |
|
|
|
this.cartList.valid = res.data.list; |
|
|
|
|
|
|
|
|
|
|
|
this.cartList.invalid = res.data.fail |
|
|
|
this.cartList.invalid = res.data.fail |
|
|
|
|
|
|
|
if(res.data.list.length == 0 && res.data.list.length == 0){ |
|
|
|
|
|
|
|
this.recommend = true; |
|
|
|
|
|
|
|
if(!this.hostProduct.length){ |
|
|
|
|
|
|
|
this.getHostProduct(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.recommend = false |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getCartNum(); |
|
|
|
this.getCartNum(); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
@ -596,6 +604,7 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
ChangeAttr: function(res) { |
|
|
|
ChangeAttr: function(res) { |
|
|
|
|
|
|
|
|
|
|
|
let productSelect = this.productValue[res]; |
|
|
|
let productSelect = this.productValue[res]; |
|
|
|
this.currSku = res; |
|
|
|
this.currSku = res; |
|
|
|
this.newVal = this.productValue[res]; |
|
|
|
this.newVal = this.productValue[res]; |
|
|
@ -664,6 +673,7 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
goCat: function() { |
|
|
|
goCat: function() { |
|
|
|
|
|
|
|
console.log("yyyy") |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
changeCartNum(that.goods.cart_id, { |
|
|
|
changeCartNum(that.goods.cart_id, { |
|
|
|
cart_num: that.goods.cart_num, |
|
|
|
cart_num: that.goods.cart_num, |
|
|
@ -680,7 +690,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
that.onMyEvent(); |
|
|
|
that.onMyEvent(); |
|
|
|
that.getCartList(true); |
|
|
|
that.getCartList(true); |
|
|
|
that.isAllSelect = false |
|
|
|
that.isAllSelect = true |
|
|
|
|
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
}).catch(error => { |
|
|
|
that.$util.Tips({ |
|
|
|
that.$util.Tips({ |
|
|
@ -749,19 +759,19 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
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')) |
|
|
|
console.log(newArr,"报错") |
|
|
|
// console.log(newArr,"报错") |
|
|
|
this.cartList.valid.forEach(item=>{ |
|
|
|
// this.cartList.valid.forEach(item=>{ |
|
|
|
item.list.forEach(p=>{ |
|
|
|
// item.list.forEach(p=>{ |
|
|
|
newArr.forEach(i=>{ |
|
|
|
// newArr.forEach(i=>{ |
|
|
|
if(p.product_id==i){ |
|
|
|
// if(p.product_id==i){ |
|
|
|
|
|
|
|
|
|
|
|
this.$set(p,'check',true) |
|
|
|
// this.$set(p,'check',true) |
|
|
|
} |
|
|
|
// } |
|
|
|
}) |
|
|
|
// }) |
|
|
|
}) |
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
// }) |
|
|
|
this.cartList.invalid = res.data.fail |
|
|
|
this.cartList.invalid = res.data.fail |
|
|
|
if(res.data.list.length == 0 && res.data.list.length == 0){ |
|
|
|
if(res.data.list.length == 0 && res.data.list.length == 0){ |
|
|
|
this.recommend = true; |
|
|
|
this.recommend = true; |
|
|
@ -806,7 +816,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
uni.setStorageSync('cartSelectedGoods',JSON.stringify(selectedCart)) |
|
|
|
// uni.setStorageSync('cartSelectedGoods',JSON.stringify(selectedCart)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.cartAllCheck('goodsCheck') |
|
|
|
this.cartAllCheck('goodsCheck') |
|
|
|