...
|
...
|
@@ -266,18 +266,14 @@ export default class SearchList extends Component { |
|
|
|
|
|
savaLateSearch(e) {
|
|
|
let latelySearch = Taro.getStorageSync('latelySearch');
|
|
|
console.log(latelySearch);
|
|
|
let { searchList, onSearchSaveType } = this.props;
|
|
|
if (latelySearch) {
|
|
|
searchList = latelySearch || []
|
|
|
}
|
|
|
latelySearch = latelySearch || []
|
|
|
if (e.detail.value === '') {
|
|
|
return;
|
|
|
}
|
|
|
if (searchList.length >= 10) {
|
|
|
searchList.pop();
|
|
|
if (latelySearch.length >= 10) {
|
|
|
latelySearch.pop();
|
|
|
}
|
|
|
let setList = this.removeSameSearch(searchList, e.detail.value);
|
|
|
let setList = this.removeSameSearch(latelySearch, e.detail.value);
|
|
|
setList.unshift({ search_word: e.detail.value });
|
|
|
try {
|
|
|
Taro.setStorageSync('latelySearch', setList);
|
...
|
...
|
|