请求数据
async getList() {
let data = {
"model": "1",
"pageSize": this.data.pageSize,
"pageNum": this.data.pageNum
}
let res = await subCertificate(data)
if (res.resultStates !== 0) {
return Dialog.alert({
title: '提示',
message: '暂无该车辆相关数据',
}).then(() => {});
}
let list = res.content.taskVoList
if (this.data.pageNum > 1) {
list = this.data.list.concat(res.content.taskVoList)
}
this.setData({
list: list,
total: res.content.total,
vin: res.content.vin
})
},
上拉加载数据
onReachBottom: function () {
let num = Math.ceil(this.data.total / 5)
var self = this;
if (this.data.pageNum >= num) {
Dialog.alert({
title: '提示',
message: '没有更多数据了',
}).then(() => {});
} else {
var pageNumber = self.data.pageNum + 1;
self.setData({
pageNum: pageNumber,
})
this.getList()
}
},
|