|
|
|
@ -1,4 +1,4 @@ |
|
|
|
<!--体测数据-详情--> |
|
|
|
<!--体测数据-列表详情--> |
|
|
|
<template> |
|
|
|
<view class="overall"> |
|
|
|
|
|
|
|
@ -46,95 +46,95 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import memberApi from '@/api/member.js'; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
loading:false,//加载状态 |
|
|
|
lowerThreshold: 100,//距离底部多远触发 |
|
|
|
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 |
|
|
|
|
|
|
|
//筛选条件 |
|
|
|
filteredData:{ |
|
|
|
page:1,//当前页码 |
|
|
|
limit:10,//每页返回数据条数 |
|
|
|
total:10,//数据总条数 |
|
|
|
students_id: '',//学员id |
|
|
|
}, |
|
|
|
|
|
|
|
tableList:[],//表格数据 |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
this.filteredData.students_id = options.students_id//学员id |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//初始化 |
|
|
|
async init(){ |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
|
|
|
|
//加载更多(下一页) |
|
|
|
loadMoreData() { |
|
|
|
//判断是否加载 |
|
|
|
if (!this.isReachedBottom) { |
|
|
|
this.isReachedBottom = true;//设置为不可请求状态 |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
import apiRoute from '@/api/apiRoute.js'; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
loading: false,//加载状态 |
|
|
|
lowerThreshold: 100,//距离底部多远触发 |
|
|
|
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 |
|
|
|
|
|
|
|
//筛选条件 |
|
|
|
filteredData: { |
|
|
|
page: 1,//当前页码 |
|
|
|
limit: 10,//每页返回数据条数 |
|
|
|
total: 10,//数据总条数 |
|
|
|
students_id: '',//学员id |
|
|
|
}, |
|
|
|
//重置为第一页 |
|
|
|
async resetFilteredData() { |
|
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
|
|
|
|
|
this.filteredData.page = 1//当前页码 |
|
|
|
this.filteredData.limit = 10//每页返回数据条数 |
|
|
|
this.filteredData.total = 10//数据总条数 |
|
|
|
}, |
|
|
|
tableList: [],//表格数据 |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
this.filteredData.students_id = options.students_id//学员id |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//初始化 |
|
|
|
async init() { |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
|
|
|
|
//获取-学员-体测列表 |
|
|
|
async getList(){ |
|
|
|
this.loading = true |
|
|
|
//加载更多(下一页) |
|
|
|
loadMoreData() { |
|
|
|
//判断是否加载 |
|
|
|
if (!this.isReachedBottom) { |
|
|
|
this.isReachedBottom = true;//设置为不可请求状态 |
|
|
|
this.getList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
//重置为第一页 |
|
|
|
async resetFilteredData() { |
|
|
|
this.isReachedBottom = false; // 重置状态,以便下次触发加载更多 |
|
|
|
|
|
|
|
let data = {...this.filteredData} |
|
|
|
this.filteredData.page = 1//当前页码 |
|
|
|
this.filteredData.limit = 10//每页返回数据条数 |
|
|
|
this.filteredData.total = 10//数据总条数 |
|
|
|
}, |
|
|
|
|
|
|
|
//判断是否还有数据 |
|
|
|
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) { |
|
|
|
this.loading = false |
|
|
|
uni.showToast({ |
|
|
|
title: '暂无更多', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
//获取-学员-体测列表 |
|
|
|
async getList() { |
|
|
|
this.loading = true |
|
|
|
|
|
|
|
if(data.page == 1){ |
|
|
|
this.tableList = [] |
|
|
|
} |
|
|
|
let data = {...this.filteredData} |
|
|
|
|
|
|
|
//学员-体测列表 |
|
|
|
let res = await memberApi.surveyList(data) |
|
|
|
//判断是否还有数据 |
|
|
|
if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) { |
|
|
|
this.loading = false |
|
|
|
this.isReachedBottom = false; |
|
|
|
if (res.code != 1){ |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.tableList = this.tableList.concat(res.data.list.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
|
|
|
|
|
// console.log('列表',this.tableList) |
|
|
|
this.filteredData.total = res.data.list.total |
|
|
|
this.filteredData.page++ |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
uni.showToast({ |
|
|
|
title: '暂无更多', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (data.page == 1) { |
|
|
|
this.tableList = [] |
|
|
|
} |
|
|
|
|
|
|
|
//学员-体测列表 |
|
|
|
let res = await apiRoute.surveyList(data) |
|
|
|
this.loading = false |
|
|
|
this.isReachedBottom = false; |
|
|
|
if (res.code != 1) { |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.tableList = this.tableList.concat(res.data.list.data); // 使用 concat 方法 将新数据追加到数组中 |
|
|
|
|
|
|
|
// console.log('列表',this.tableList) |
|
|
|
this.filteredData.total = res.data.list.total |
|
|
|
this.filteredData.page++ |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
|
|