修复删除带来的列表页面数据为空未自动减少页码请求问题

This commit is contained in:
2024-10-15 16:07:28 +08:00
parent 15626e4d33
commit 982bc23d3f
12 changed files with 56 additions and 23 deletions

View File

@@ -52,7 +52,7 @@
<my-img-empty tips="未找到相关商品"></my-img-empty>
</template>
<template v-if="pageData.goodsList.length">
<my-pagination :totalElements="pageData.totalElements" :size="pageData.query.size"
<my-pagination :page="pageData.query.page+1" :totalElements="pageData.totalElements" :size="pageData.query.size"
@change="pageChange"></my-pagination>
</template>
@@ -401,9 +401,17 @@
function watchEmitInit() {
uni.$off('update:productIndex')
uni.$off('del:productIndex')
uni.$on('update:productIndex', (data) => {
getGoodsList()
})
uni.$on('del:productIndex', (productId) => {
if(pageData.goodsList.length<=1){
pageData.query.page-=1
}
getGoodsList()
})
}
onShow(() => {
// getGoodsList()