|
@@ -150,15 +150,23 @@ const close = () => {
|
|
|
const onSelect = data => {
|
|
|
productSource.value = data
|
|
|
}
|
|
|
-
|
|
|
+const pageNum = ref(1)
|
|
|
const getData = common.debounce(
|
|
|
- (reset = false) => {
|
|
|
- store.dispatch('tag/getGoodsList', {
|
|
|
- keyword: searchKey.value,
|
|
|
- pageNum: reset ? 1 : Math.floor(list.value.length / 20) + 1,
|
|
|
- reset,
|
|
|
- productSourceId: productSource.value,
|
|
|
- })
|
|
|
+ (reset = false, page) => {
|
|
|
+ store
|
|
|
+ .dispatch('tag/getGoodsList', {
|
|
|
+ keyword: searchKey.value,
|
|
|
+ // pageNum: reset ? 1 : Math.floor(list.value.length / 20) + 1,
|
|
|
+ pageNum: page || pageNum.value,
|
|
|
+ reset,
|
|
|
+ productSourceId: productSource.value,
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ pageNum.value++
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
if (!showListPanel.value) {
|
|
|
showListPanel.value = true
|
|
|
}
|
|
@@ -200,7 +208,9 @@ watch(
|
|
|
watch(
|
|
|
() => searchKey.value,
|
|
|
(newval, old) => {
|
|
|
- getData(true)
|
|
|
+ pageNum.value = 1
|
|
|
+ let page = 1
|
|
|
+ getData(true, page)
|
|
|
}
|
|
|
)
|
|
|
|