//上一页
async prePage() {
if (this.data.currentPage == 1) {
wx.showToast({
icon: "error",
title: '已经是第一页了'
})
return
}
let nextPage = --this.data.currentPage
let res = await GetTopicList(nextPage, this.data.pageSize)
this.setData({
TopicList: res.data,
pageSize: res.data.pageSize,
currentPage: res.data.currentPage,
totalPages: res.data.totalPages
})
},
//下一页
async nextPage() {
if (this.data.currentPage == this.data.totalPages) {
wx.showToast({
icon: "error",
title: '没有了'
})
return
}
let nextPage = ++this.data.currentPage
let res = await GetTopicList(nextPage, this.data.pageSize)
this.setData({
TopicList: res.data,
pageSize: res.data.pageSize,
currentPage: res.data.currentPage,
totalPages: res.data.totalPages
})
}
07-09
4162
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-06
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交