From 34b6e0548fb7f3d88842914db89d7cd603a5e531 Mon Sep 17 00:00:00 2001
From: xuxy <1059738716@qq.com>
Date: 星期四, 01 八月 2024 23:11:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/main'

---
 sub_pages/customer/trade/detail.vue |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/sub_pages/customer/trade/detail.vue b/sub_pages/customer/trade/detail.vue
index b645d37..5b10de5 100644
--- a/sub_pages/customer/trade/detail.vue
+++ b/sub_pages/customer/trade/detail.vue
@@ -148,7 +148,10 @@
 				shopnum: 0,
 			}
 		},
-		onShow() {
+		onShow() {
+			if (this.id) {
+				this.getDetail()
+			}
 			this.refreshShopNum()
 		},
 		onLoad(options) {
@@ -172,7 +175,7 @@
 
 					} else {
 						if (!item.stock || t > item.stock) {
-							this.$message.showToast('库存不足无法修改')
+							this.$message.showToast('库存不足无法修改')
 							return
 						}
 						this.addnum(item, (t - item.shopnum))
@@ -196,7 +199,7 @@
 				if (!item.stock) {
 					item.stock = 0
 				}
-				if (item.shopnum + addnum > item.stock) {
+				if (addnum > 0 & item.shopnum + addnum > item.stock) {
 					this.$message.showToast('库存不足,无法修改')
 					return
 				}
@@ -223,7 +226,9 @@
 			},
 
 			async refreshShopNum() {
-				this.shopnum = await this.$store.dispatch('countShopping');
+				this.shopnum = await this.$store.dispatch('countShopping');
+				this.$store.dispatch('sign_add','shopnum')
+				
 			},
 			async collectItem(dto) {
 				if (!this.currentInfo.id) {

--
Gitblit v1.9.3