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. 32
      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(){

32
pages/student/index/physical_examination.vue

@ -1,4 +1,4 @@
<!--体测数据-详情--> <!--体测数据-列表详情-->
<template> <template>
<view class="overall"> <view class="overall">
@ -46,35 +46,35 @@
</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:[],// tableList: [],//
} }
}, },
onLoad(options) { onLoad(options) {
this.filteredData.students_id = options.students_id//id this.filteredData.students_id = options.students_id//id
}, },
onShow(){ onShow() {
this.init() this.init()
}, },
methods: { methods: {
// //
async init(){ async init() {
this.getList() this.getList()
}, },
@ -96,7 +96,7 @@ import memberApi from '@/api/member.js';
}, },
//-- //--
async getList(){ async getList() {
this.loading = true this.loading = true
let data = {...this.filteredData} let data = {...this.filteredData}
@ -111,15 +111,15 @@ import memberApi from '@/api/member.js';
return return
} }
if(data.page == 1){ if (data.page == 1) {
this.tableList = [] this.tableList = []
} }
//- //-
let res = await memberApi.surveyList(data) let res = await apiRoute.surveyList(data)
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
if (res.code != 1){ if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
@ -134,7 +134,7 @@ import memberApi from '@/api/member.js';
this.filteredData.page++ this.filteredData.page++
}, },
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

Loading…
Cancel
Save