From e3898caa56109a29f94e4dabc7db421a5bd4b730 Mon Sep 17 00:00:00 2001
From: xuxy <1059738716@qq.com>
Date: 星期一, 15 七月 2024 00:14:27 +0800
Subject: [PATCH] update fix bug

---
 sub_pages/supplier/flower-manage/flower-manage.vue |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/sub_pages/supplier/flower-manage/flower-manage.vue b/sub_pages/supplier/flower-manage/flower-manage.vue
index e6f8311..2138502 100644
--- a/sub_pages/supplier/flower-manage/flower-manage.vue
+++ b/sub_pages/supplier/flower-manage/flower-manage.vue
@@ -61,10 +61,10 @@
 					<view class="buttons">
 						<view class="button" @click.stop="toDetail(item)">编辑</view>
 
-						<view class="button" @click.stop="buttonStatus(item,'OFF')"
-							v-if="item.status=='UP'">下架</view>
-						<view class="button" @click.stop="buttonStatus(item,'UP')"
-							v-if="item.status=='OFF'||item.status=='FORCE_OFF'">上架</view>
+						<view class="button" @click.stop="buttonStatus(item,'off')"
+							v-if="item.status=='UP'||item.status=='up'">下架</view>
+						<view class="button" @click.stop="buttonStatus(item,'up')"
+							v-if="item.status=='OFF'||item.status=='off'||item.status=='FORCE_OFF'">上架</view>
 						<view class="button" @click.stop="openValue(item,'price')">价格</view>
 						<view class="button" @click.stop="openValue(item,'stock')">库存</view>
 						<view class="button" @click.stop="toDetailAdd(item)">复制</view>
@@ -127,7 +127,13 @@
 				inputplaceholder: '',
 			}
 		},
-		onLoad(options) {
+		onShow(){
+			if (this.sign['flower']) {
+				this.$store.dispatch('sign_clear', 'flower');
+				this.refreshList()
+			}
+		},
+		async onLoad(options) {
 			this.type = options.type || 'all'
 			var title = ''
 			//todo 根据type切换查询条件
@@ -160,6 +166,7 @@
 					title: title
 				})
 			}
+			await this.$store.dispatch('sign_clear', 'flower');
 			this.getList()
 		},
 		onReachBottom() {
@@ -221,7 +228,7 @@
 				})
 			},
 			async buttonStatus(item, status) {
-				await this.$message.confirm(`确定${status==='OFF'?'下降':'上架'}此商品吗`)
+				await this.$message.confirm(`确定${status==='off'?'下降':'上架'}此商品吗`)
 				this.$message.showLoading()
 				this.$http.request('get', '/api/supplier/flower/list/' + status, {
 					params: {
@@ -231,7 +238,7 @@
 					if (res.code == 0) {
 						this.$message.showToast('操作成功')
 						item.status = status
-						item.statusStr = (status == 'OFF' ? '下架' : '上架')
+						item.statusStr = (status == 'off' ? '下架' : '上架')
 					}
 				}).finally(() => {
 					this.$message.hideLoading()

--
Gitblit v1.9.3