From 1fb44496929548b4f07b37796d506dedc494d44a Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 30 七月 2024 17:29:35 +0800
Subject: [PATCH] update 问题修复
---
sub_pages/customer/shop/shop.vue | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/sub_pages/customer/shop/shop.vue b/sub_pages/customer/shop/shop.vue
index 166571f..6cc13c3 100644
--- a/sub_pages/customer/shop/shop.vue
+++ b/sub_pages/customer/shop/shop.vue
@@ -249,7 +249,11 @@
},
//update 关注
- async updateGz(type) {
+ async updateGz(type) {
+ if(!this.currentInfo.id){
+ this.$message.showToast('请先登录')
+ return
+ }
this.$message.showLoading()
const {
code
@@ -315,6 +319,13 @@
}
if (!item.shopnum) {
item.shopnum = 0
+ }
+ if (!item.stock) {
+ item.stock = 0
+ }
+ if (item.shopnum + addnum > item.stock) {
+ this.$message.showToast('库存不足,无法添加')
+ return
}
if (item.shopnum + addnum >= 0) {
@@ -332,9 +343,9 @@
})
this.$message.hideLoading()
if (code === 0) {
- item.shopnum += addnum
+ item.shopnum += addnum
+ this.$forceUpdate()
}
- this.$forceUpdate()
},
}
--
Gitblit v1.9.3