|
|
|
@ -67,6 +67,12 @@ import memberApi from '@/api/member.js'; |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
this.init()//初始化 |
|
|
|
}, |
|
|
|
//下拉刷新 |
|
|
|
async onPullDownRefresh() { |
|
|
|
//重置为第一页 |
|
|
|
await this.loadData() |
|
|
|
await this.getList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//初始化 |
|
|
|
@ -83,11 +89,16 @@ import memberApi from '@/api/member.js'; |
|
|
|
} |
|
|
|
}, |
|
|
|
//重置为第一页 |
|
|
|
loadData() { |
|
|
|
setTimeout(() => { |
|
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
|
}, 1000); |
|
|
|
async loadData() { |
|
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
|
|
|
|
|
this.filteredData.page = 1//当前页码 |
|
|
|
this.filteredData.limit = 10//每页返回数据条数 |
|
|
|
this.filteredData.total = 10//数据总条数 |
|
|
|
|
|
|
|
this.tableList = [] |
|
|
|
}, |
|
|
|
|
|
|
|
//获取作业列表 |
|
|
|
async getList(){ |
|
|
|
this.loading = true |
|
|
|
@ -114,7 +125,8 @@ import memberApi from '@/api/member.js'; |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.tableList = res.data.data |
|
|
|
this.tableList = this.tableList.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
|
|
|
|
|
console.log('列表',this.tableList) |
|
|
|
this.filteredData.total = res.data.total |
|
|
|
this.filteredData.page++ |
|
|
|
|