fix:搜索为空时,传值错误修改
parent
a8b301625c
commit
0dd5fde92c
|
@ -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');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue