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

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

@@ -12,8 +12,8 @@
:showChecked="showChecked"
:showDetail="pageData.showGoodsDetail"></my-category>
</view>
<view class="u-m-t-44">
<my-pagination :size="pageData.query.size" :totalElements="pageData.totalElements" @change="pageChange"></my-pagination>
<view class="u-m-t-44" v-if="pageData.list.length>0">
<my-pagination :page="pageData.query.page+1" :size="pageData.query.size" :totalElements="pageData.totalElements" @change="pageChange"></my-pagination>
<view style="height: 200rpx;"></view>
</view>
</view>
@@ -136,7 +136,7 @@
},
showGoodsDetail:false,
query:{
page: 1,
page: 0,
size:10
},
totalElements:0,
@@ -302,6 +302,9 @@
const islast=pageData.list.length===1
$productCategory.del([pageData.list[index].id]).then(res=>{
infoBox.showToast('删除成功')
if(islast&&pageData.query.page>=1){
pageData.query.page-=1
}
// if(islast&&pageData.query.page>=1){
// pageData.query.page--
// }