diff --git a/pages/cart.vue b/pages/cart.vue index cf0bb77..145703b 100644 --- a/pages/cart.vue +++ b/pages/cart.vue @@ -146,20 +146,20 @@ :src="good['productInfo']['attrInfo']['image']" class="good-cover flex-0 v12-radius-16" mode="scaleToFill" - @click="navToGood(good)" + @click="navToGood(good, item)" /> {{ good['productInfo']['storeName'] }} {{ good['truePrice'] }} @@ -500,7 +500,13 @@ export default { const res = await getCartGroup() if (res.success) { this.isLoad = true - this.list = res.data['valid'].concat(res.data['invalid']) + const invalid = res.data['invalid'].map(e => { + return { + ...e, + isInvalid: true + } + }) + this.list = res.data['valid'].concat(invalid) this.handleAll(false) const _res = await getUserLike() this.userLikeList = _res.data @@ -751,7 +757,15 @@ export default { this.currGood = {} this.showAttr = false }, - navToGood(good) { + navToGood(good, item) { + if(item.isInvalid) { + uni.showToast({ + title: '商品已下架', + icon: 'none', + duration: 3000 + }) + return + } const query = { id: good.productId }