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');
}
}
},