Browse Source

feat(student): 添加学生端体测报告功能

- 新增体测报告列表和详情接口
- 实现学生首页体测数据展示- 添加体测数据列表和详情页面
master
liutong 10 months ago
parent
commit
8f4f042da4
  1. 16
      api/apiRoute.js
  2. 2
      pages/coach/student/physical_examination.vue
  3. 40
      pages/student/index/index.vue
  4. 164
      pages/student/index/physical_examination.vue

16
api/apiRoute.js

@ -462,6 +462,22 @@ export default {
}) })
}, },
//学生端-体测报告-列表
xy_physicalTest(data = {}) {
let url = '/xy/physicalTest'
return http.get(url, data).then(res => {
return res;
})
},
//学生端-体测报告-详情
xy_physicalTestInfo(data = {}) {
let url = '/xy/physicalTest/info'
return http.get(url, data).then(res => {
return res;
})
},

2
pages/coach/student/physical_examination.vue

@ -1,4 +1,4 @@
<!--体测数据--> <!--体测数据-详情页-->
<template> <template>
<view class="overall"> <view class="overall">
<view class="date">{{$util.formatToDateTime(surveyInfo.create_time,'Y-m-d')}}</view> <view class="date">{{$util.formatToDateTime(surveyInfo.create_time,'Y-m-d')}}</view>

40
pages/student/index/index.vue

@ -29,18 +29,18 @@
<view class="card-con-txt1"> <view class="card-con-txt1">
<view class="card-con-txt1-left"> <view class="card-con-txt1-left">
<image :src="$util.img('/uniapp_src/static/images/index/score.png')" class="overlay-image"></image> <image :src="$util.img('/uniapp_src/static/images/index/score.png')" class="overlay-image"></image>
<view class="card-con-txt1-left-txt top">{{memberIndexData.tx.score}}</view> <view class="card-con-txt1-left-txt top">{{physicalTestInfo.calculateChildHealthScore}}</view>
<view class="card-con-txt1-left-txt top1">综合评分</view> <view class="card-con-txt1-left-txt top1">综合评分</view>
</view> </view>
<view class="card-con-txt1-right"> <view class="card-con-txt1-right">
<view style="color: #AAAAAA;padding: 5rpx;">数据测评时间{{$util.formatToDateTime(memberIndexData.tx.create_time,'Y-m-d')}}</view> <view style="color: #AAAAAA;padding: 5rpx;">数据测评时间{{$util.formatToDateTime(physicalTestInfo.created_at,'Y-m-d')}}</view>
<view style="display: flex;justify-content: space-around;margin-top: 20rpx;"> <view style="display: flex;justify-content: space-around;margin-top: 20rpx;">
<view> <view>
<view style="font-size: 48rpx;color: #29d3b4;">{{memberIndexData.tx.height * 100}}</view> <view style="font-size: 48rpx;color: #29d3b4;">{{physicalTestInfo.height}}</view>
<view style="color: #AAAAAA;font-size: 30rpx;">身高CM</view> <view style="color: #AAAAAA;font-size: 30rpx;">身高CM</view>
</view> </view>
<view> <view>
<view style="font-size: 48rpx;color: #29d3b4;">{{memberIndexData.tx.weight}}</view> <view style="font-size: 48rpx;color: #29d3b4;">{{physicalTestInfo.weight}}</view>
<view style="color: #AAAAAA;font-size: 30rpx;">体重KG</view> <view style="color: #AAAAAA;font-size: 30rpx;">体重KG</view>
</view> </view>
</view> </view>
@ -170,6 +170,13 @@
}, },
thisPath:'',//('') thisPath:'',//('')
openPath:'',//('') openPath:'',//('')
physicalTestInfo:{
created_at:'',//
calculateChildHealthScore:'0',//
height:'0',//
weight:'0',//
},//
} }
}, },
onLoad() { onLoad() {
@ -186,11 +193,36 @@
// //
async init(){ async init(){
await this.member_init() await this.member_init()
await this.getPhysicalTestList()
this.getMemberIndex() this.getMemberIndex()
this.getList() this.getList()
this.getJobAssignmentsInfo() this.getJobAssignmentsInfo()
}, },
//
async getPhysicalTestList(){
let params = {
page: 1,//
limit: 1,//
total: 1,//
resource_id:this.member_info.id,//id
}
let res = await apiRoute.xy_physicalTest(params)
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
}
console.log('tc',res.data)
let arr = res.data.data
if(arr.length){
this.physicalTestInfo = arr[0]
}
},
async openViewHome_COPY(){ async openViewHome_COPY(){

164
pages/student/index/physical_examination.vue

@ -1,4 +1,4 @@
<!--体测数据-详情--> <!--体测数据-列表详情-->
<template> <template>
<view class="overall"> <view class="overall">
@ -46,95 +46,95 @@
</template> </template>
<script> <script>
import memberApi from '@/api/member.js'; import apiRoute from '@/api/apiRoute.js';
export default { export default {
data() { data() {
return { return {
loading:false,// loading: false,//
lowerThreshold: 100,// lowerThreshold: 100,//
isReachedBottom: false,//|true=|false= isReachedBottom: false,//|true=|false=
// //
filteredData:{ filteredData: {
page:1,// page: 1,//
limit:10,// limit: 10,//
total:10,// total: 10,//
students_id: '',//id 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// tableList: [],//
this.filteredData.limit = 10// }
this.filteredData.total = 10// },
}, onLoad(options) {
this.filteredData.students_id = options.students_id//id
},
onShow() {
this.init()
},
methods: {
//
async init() {
this.getList()
},
//-- //()
async getList(){ loadMoreData() {
this.loading = true //
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) { async getList() {
this.loading = false this.loading = true
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
if(data.page == 1){ let data = {...this.filteredData}
this.tableList = []
}
//- //
let res = await memberApi.surveyList(data) if ((this.filteredData.page - 1) * this.filteredData.limit >= this.filteredData.total) {
this.loading = false this.loading = false
this.isReachedBottom = false; uni.showToast({
if (res.code != 1){ title: '暂无更多',
uni.showToast({ icon: 'none'
title: res.msg, })
icon: 'none' return
}) }
return
} if (data.page == 1) {
this.tableList = []
this.tableList = this.tableList.concat(res.data.list.data); // 使 concat }
// console.log('',this.tableList) //-
this.filteredData.total = res.data.list.total let res = await apiRoute.surveyList(data)
this.filteredData.page++ 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>
<style lang="less" scoped> <style lang="less" scoped>

Loading…
Cancel
Save