From af2a86dbbe05d74b00a6e7bdc426e26bb0453654 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期三, 31 七月 2024 11:35:34 +0800 Subject: [PATCH] fix bug --- sub_pages/customer/trade/list.vue | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sub_pages/customer/trade/list.vue b/sub_pages/customer/trade/list.vue index 9e4cc2d..125734f 100644 --- a/sub_pages/customer/trade/list.vue +++ b/sub_pages/customer/trade/list.vue @@ -237,6 +237,9 @@ this.page.current = 1 await this.getList('post') uni.stopPullDownRefresh() + }, + onShow(){ + this.refreshShopNum() }, methods: { async refreshShopNum() { @@ -338,8 +341,8 @@ if (!item.shopnum) { item.shopnum = 0 } - if (item.shopnum + addnum > item.stock) { - this.$message.showToast('库存不足,无法添加') + if (addnum > 0 & item.shopnum + addnum > item.stock) { + this.$message.showToast('库存不足,无法修改') return } @@ -351,7 +354,7 @@ this.$message.showLoading() const { code - } = await http.request('post', '/api/customer/flower/cart/change-num', { + } = await this.$http.request('post', '/api/customer/flower/cart/change-num', { data: { id: item.id, num: addnum -- Gitblit v1.9.3