Browse Source

fix[litemall-wx]: 如果关键字是空,则不查询后台类似关键字

Junling Bu 7 years ago
parent
commit
1e34cdf133
1 changed files with 4 additions and 2 deletions
  1. 4 2
      litemall-wx/pages/search/search.js

+ 4 - 2
litemall-wx/pages/search/search.js

@@ -49,12 +49,14 @@ Page({
   },
 
   inputChange: function (e) {
-
     this.setData({
       keyword: e.detail.value,
       searchStatus: false
     });
-    this.getHelpKeyword();
+
+    if (e.detail.value) {
+      this.getHelpKeyword();
+    }
   },
   getHelpKeyword: function () {
     let that = this;