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