在data里面写写下这些属性
data: {
tableList: [],
// 传递给后端的参数
PayData: {
// 请求第几页
pageNumber: 1,
// 请求每页的数量
// pagSize: 5,
},
// 列表数据
tableList: [],
// 用于上拉刷新加载时合并的数据
newTableList: [],
// 总页数
total: 0,
// 加载状态
finished: false,
// 上拉加载
loading: false,
},
if (data.code = 1) {
console.log(data);
if (data.shoprecharge) {
data.shoprecharge.forEach(item => {
this.tableList.push(item);
});
if (data.shoprecharge.length < 10) {
this.finished = true;
}
} else {
this.finished = true;
this.loading = false;
}
} else {
this.finished = true;
}
在最后调用一次
// 上拉刷新
onLoad() {
// 加载时页码递增
this.PayData.pageNumber++
this.getInfo();
},