From 56cfb89387f313eaa9e374a2640977aed7abc518 Mon Sep 17 00:00:00 2001
From: wangxiaowei <1121133807@qq.com>
Date: Wed, 18 Dec 2024 11:57:31 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/goods_search/goods_search.vue | 43 ++++++++++++++++++-----------
1 file changed, 27 insertions(+), 16 deletions(-)
diff --git a/pages/goods_search/goods_search.vue b/pages/goods_search/goods_search.vue
index 790bf22..ce4c483 100644
--- a/pages/goods_search/goods_search.vue
+++ b/pages/goods_search/goods_search.vue
@@ -7,7 +7,7 @@
-
+
@@ -29,8 +29,9 @@
+
-
@@ -41,16 +42,15 @@
-
-
-
-
-
-
- {{item.name}}
+
+
+
+
+ {{item.name}}
+
+ {{tip}}
- {{tip}}
@@ -100,7 +100,8 @@
price_type: 0,
showList: false,
list: [],
- tip: ''
+ tip: '',
+ isCate: false
};
},
@@ -222,10 +223,20 @@
}
},
onSearch() {
- this.showHistory = false
- this.showList = false
this.$nextTick(() => {
- this.onRefresh()
+ if (this.isCate) {
+ searchGoods({shop_name: this.keyword}).then((res) => {
+ if (res.code == 1) {
+ this.list = res.data
+ if (res.data == '') {
+ this.tip = '没有搜索到相关商品'
+ }
+ }
+ uni.hideLoading()
+ })
+ } else {
+ this.onRefresh()
+ }
})
},
onRefresh() {
@@ -245,13 +256,12 @@
getShop(e) {
// TODO 搜索展现出商品列表, 暂时隐藏 u-searh @change="getShop"
- this.showList = true
let shop_name = e
uni.showLoading({
title: '搜索中',
mask: true
})
-
+ this.isCate = true
setTimeout(() => {
searchGoods({shop_name}).then((res) => {
if (res.code == 1) {
@@ -262,6 +272,7 @@
}
uni.hideLoading()
})
+ uni.hideLoading()
}, 200)
},