From 15619b00ff5fe53e8f74534f7e8248117d266ad0 Mon Sep 17 00:00:00 2001 From: modendeveloper Date: Wed, 22 Jan 2025 01:55:12 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A2983=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E8=A2=AB=E4=B8=8B=E6=9E=B6?= =?UTF-8?q?=E7=9A=84=E5=95=86=E5=93=81=E5=9C=A8=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E4=B8=AD=E6=B6=88=E5=A4=B1=EF=BC=88=E6=94=B9=E4=B8=BA=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=95=B0=E6=8D=AE=E4=BF=9D=E7=95=99=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=97=B6=E6=8F=90=E9=86=92=E5=95=86=E5=93=81=E5=B7=B2?= =?UTF-8?q?=E4=B8=8B=E6=9E=B6=E6=88=96=E8=A2=AB=E5=88=A0=E9=99=A4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/cart.vue | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) 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 }