Browse Source

feat(student): 学生端作业列表支持下拉刷新

- 添加 onPullDownRefresh 方法实现下拉刷新功能
- 优化 loadData 方法,重置分页数据和表格列表
- 修改 getList 方法,使用 concat 将新数据追加到表格列表中
master
liutong 1 year ago
parent
commit
9d062542b7
  1. 22
      pages/student/index/job_list.vue

22
pages/student/index/job_list.vue

@ -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++

Loading…
Cancel
Save