Commit ef2eea35e4bfdeacab8da408af7e70b6f1680171
1 parent
91920da7
存储历史的
Showing
1 changed file
with
3 additions
and
1 deletions
pages/goods/search/search.js
| ... | ... | @@ -26,6 +26,7 @@ Page({ |
| 26 | 26 | |
| 27 | 27 | searchRecord: [], |
| 28 | 28 | keyword: '', |
| 29 | + is_his:0, | |
| 29 | 30 | }, |
| 30 | 31 | |
| 31 | 32 | onLoad: function(t) { |
| ... | ... | @@ -282,7 +283,8 @@ Page({ |
| 282 | 283 | historyRecord() { |
| 283 | 284 | let self = this; |
| 284 | 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 | 289 | if(keyword) { |
| 288 | 290 | if(searchRecord.indexOf(keyword) > -1) { | ... | ... |