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. 159
      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) { assignmentsSubmit(data) {
let url = '/member/assignments_submit' let url = '/member/assignments_submit'

8
pages/student/index/index.vue

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

159
pages/student/index/physical_examination.vue

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

Loading…
Cancel
Save