Commit ef2eea35e4bfdeacab8da408af7e70b6f1680171

Authored by yvan.ni
1 parent 91920da7

存储历史的

Showing 1 changed file with 3 additions and 1 deletions
pages/goods/search/search.js
@@ -26,6 +26,7 @@ Page({ @@ -26,6 +26,7 @@ Page({
26 26
27 searchRecord: [], 27 searchRecord: [],
28 keyword: '', 28 keyword: '',
  29 + is_his:0,
29 }, 30 },
30 31
31 onLoad: function(t) { 32 onLoad: function(t) {
@@ -282,7 +283,8 @@ Page({ @@ -282,7 +283,8 @@ Page({
282 historyRecord() { 283 historyRecord() {
283 let self = this; 284 let self = this;
284 let keyword = this.data.key_str; 285 let keyword = this.data.key_str;
285 - let searchRecord = this.data.searchRecord; 286 + let searchRecord = this.data.searchRecord;
  287 + if(!searchRecord || searchRecord.length==0) searchRecord=wx.getStorageSync('searchRecord') || [];
286 288
287 if(keyword) { 289 if(keyword) {
288 if(searchRecord.indexOf(keyword) > -1) { 290 if(searchRecord.indexOf(keyword) > -1) {