From 4be139a93e3c93ba1f5fa381fb16c2f37e85065f Mon Sep 17 00:00:00 2001 From: kele <1184860403@qq.com> Date: Tue, 21 Mar 2023 19:06:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=8B=BC=E5=9B=A2=E8=AF=A6=E6=83=85bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E6=95=B0=E9=87=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/activity/groupon/detail.vue | 3 ++- pages/index/cart.vue | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/activity/groupon/detail.vue b/pages/activity/groupon/detail.vue index 4b82faf8..c04e8d92 100644 --- a/pages/activity/groupon/detail.vue +++ b/pages/activity/groupon/detail.vue @@ -294,7 +294,8 @@ const { error, data } = await sheep.$api.activity.grouponDetail(id); if (error === 0) { state.data = data; - state.number = Number(state.data.num - state.data.current_num); + let number = Number(state.data.num - state.data.current_num); + state.number = number > 0 ? number : 0; } else { state.data = null; } diff --git a/pages/index/cart.vue b/pages/index/cart.vue index a9cf3fc4..c67c8b6a 100644 --- a/pages/index/cart.vue +++ b/pages/index/cart.vue @@ -151,6 +151,7 @@ cart.delete(cartItem.id); return; } + cartItem.goods_num = e; cart.update({ goods_id: cartItem.goods_id, goods_num: e,