Browse Source

feat(student): 学员体测列表功能

- 新增学员体测列表 API 接口
- 实现学员体测列表页面,包括数据加载和分页功能- 优化学员首页,添加体测列表跳转入口
master
liutong 12 months ago
parent
commit
8c605fb25b
  1. 8
      api/member.js
  2. 8
      pages/student/index/index.vue
  3. 111
      pages/student/index/physical_examination.vue

8
api/member.js

@ -93,6 +93,14 @@ export default {
})
},
//学员-体测列表
surveyList(data) {
let url = '/member/survey_list'
return http.get(url, data).then(res => {
return res;
})
},
//提交作业
assignmentsSubmit(data) {
let url = '/member/assignments_submit'

8
pages/student/index/index.vue

@ -46,7 +46,7 @@
</view>
</view>
</view>
<view class="more" @click="physical_examination">更多</view>
<view class="more" @click="physical_examination(memberIndexData)">更多</view>
</view>
<view class="upcomin-classes">
@ -246,9 +246,11 @@
url: '/pages/student/index/work_details'
})
},
physical_examination(){
//
physical_examination(e){
let students_id = e.students_id
uni.navigateTo({
url: '/pages/student/index/physical_examination'
url: `/pages/student/index/physical_examination?students_id=${students_id}`
})
},
//

111
pages/student/index/physical_examination.vue

@ -1,46 +1,138 @@
<!--体测数据-详情-->
<template>
<view class="overall">
<view class="date">2021年03月12日</view>
<scroll-view
class="table_list"
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
style="height: 100vh;"
>
<view class="item" v-for="(v,k) in tableList" :key="k">
<view class="date">{{$util.formatToDateTime(v.create_time, 'Y-m-d')}}</view>
<view class="content">
<view class="circle-container">
<view class="card-con-txt1-left">
<image src="@/static/images/index/score.png" class="overlay-image"></image>
</view>
<view class="card-con-txt1-left-txt">90</view>
<view class="card-con-txt1-left-txt">{{v.score}}</view>
<view class="card-con-txt1-left-txt top1">综合评分</view>
</view>
<view style="height: 170rpx;"></view>
<view style="display: flex;justify-content: space-around;">
<view style="text-align: center;">
<view style="color: #AAAAAA;font-size: 30rpx;padding: 15rpx 0;">身高 (CM)</view>
<view style="font-size: 55rpx;color: #29d3b4;">123</view>
<view style="font-size: 55rpx;color: #29d3b4;">{{(v.height * 100)}}</view>
</view>
<view style="text-align: center;">
<view style="color: #AAAAAA;font-size: 30rpx;padding: 15rpx 0;">体重 (KG)</view>
<view style="font-size: 55rpx;color: #29d3b4;">45</view>
<view style="font-size: 55rpx;color: #29d3b4;">{{v.weight}}</view>
</view>
</view>
<view class="coach-message">
<view>
<image src="@/static/images/index/lv.png" class="drop-image"></image>
</view>
<view style="padding: 15rpx 0 0 5rpx;line-height: 1.6;font-size: 30rpx;color: #7F7F7F;">教练寄语教练寄语教练寄语教练寄语教练寄语教练寄语教练寄教练寄语教练寄语教练寄语教练寄语教练寄语教练教练寄语教练寄语教练寄语教练寄语练教练语教练寄教练寄语教练寄语教练寄语教练寄语教练寄语教练</view>
<view style="padding: 15rpx 0 0 5rpx;line-height: 1.6;font-size: 30rpx;color: #7F7F7F;">{{v.content}}</view>
</view>
<view style="font-size: 45rpx;text-align: center;margin-top: 30%;">详细数据信息</view>
</view>
</view>
</scroll-view>
</view>
</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();
}
},
//
async resetFilteredData() {
this.isReachedBottom = false; // 便
this.filteredData.page = 1//
this.filteredData.limit = 10//
this.filteredData.total = 10//
},
//--
async getList(){
this.loading = true
let data = {...this.filteredData}
//
if(this.filteredData.page * this.filteredData.limit > this.filteredData.total){
this.loading = false
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
if(data.page == 1){
this.tableList = []
}
//-
let res = await memberApi.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>
@ -52,6 +144,15 @@
background-color: #29d3b4;
}
.table_list{
padding-bottom: 40rpx;
display: flex;
flex-direction: column;
.item{
margin-bottom: 40rpx;
}
}
.date {
color: #fff;
width: 92%;

Loading…
Cancel
Save