From dc296be8170dfe90f2d9c9454c062718a59307f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com>
Date: Fri, 27 Sep 2024 18:36:12 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=90=9C=E7=B4=A2=E7=9A=84?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/diy/search.vue | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/components/diy/search.vue b/components/diy/search.vue
index d8241d6a..d9b37d6e 100644
--- a/components/diy/search.vue
+++ b/components/diy/search.vue
@@ -18,7 +18,7 @@
{{ form.tips }}
-
+
{{ form.search_tips }}
@@ -143,16 +143,21 @@
},
search_tap() {
if (this.propIsPageSettings) {
+ this.setData({
+ search_content: '',
+ })
this.$emit('search_tap', true);
} else {
this.setData({
is_click: true,
+ search_content: '',
})
}
},
search_hot_close() {
this.setData({
- is_click: false
+ is_click: false,
+ search_content: '',
})
},
get_search_button() {
@@ -181,14 +186,22 @@
},
url_event() {
if (!isEmpty(this.search_content)) {
+ const content = this.search_content;
+
if (this.propIsPageSettings) {
+ this.setData({
+ search_content: '',
+ })
this.$emit('search_tap', false);
} else {
this.setData({
is_click: false,
+ search_content: '',
})
}
- app.globalData.url_open('/pages/goods-search/goods-search?keywords=' + this.search_content);
+ app.globalData.url_open('/pages/goods-search/goods-search?keywords=' + content);
+ } else {
+ app.globalData.showToast('请输入搜索关键字', 'error');
}
}
},