fix:搜索为空时,传值错误修改

pull/8/head
kele 2023-03-13 16:40:05 +08:00
parent a8b301625c
commit 0dd5fde92c
1 changed files with 7 additions and 3 deletions

View File

@ -18,7 +18,7 @@
<view class="ss-flex ss-col-center ss-row-left ss-flex-wrap"> <view class="ss-flex ss-col-center ss-row-left ss-flex-wrap">
<button <button
class="history-btn ss-reset-button" class="history-btn ss-reset-button"
@tap="onSearch(item)" @tap="onSearchList(item)"
v-for="(item, index) in state.historyTag" v-for="(item, index) in state.historyTag"
:key="index" :key="index"
> >
@ -47,10 +47,14 @@
sheep.$router.go('/pages/goods/list', { keyword: res.value }); sheep.$router.go('/pages/goods/list', { keyword: res.value });
} }
} else { } else {
sheep.$router.go('/pages/goods/list', { keyword: res }); sheep.$router.go('/pages/goods/list', { keyword: res.value });
} }
} }
function onSearchList(item) {
sheep.$router.go('/pages/goods/list', { keyword: item });
}
function getArr(list, item) { function getArr(list, item) {
let arr = list; let arr = list;
let length = 10; // let length = 10; //
@ -65,7 +69,7 @@
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
state.historyTag = []; state.historyTag = [];
uni.removeStorageSync('search'); uni.removeStorageSync('searchHistory');
} }
}, },
}); });