Browse Source

接口

master
李双庆 10 months ago
parent
commit
168a7bf6cc
  1. 35
      api/apiRoute.js
  2. 1208
      pages/coach/class/info.vue
  3. 20
      pages/coach/course/info_list.vue
  4. 45
      pages/coach/student/info.vue
  5. 54
      pages/coach/student/physical_examination.vue

35
api/apiRoute.js

@ -143,13 +143,27 @@ export default {
//↓↓↓↓↓↓↓↓↓↓↓↓-----教练接口相关-----↓↓↓↓↓↓↓↓↓↓↓↓
//体测报告-详情
physicalTestInfo(data = {}) {
let url = '/class/physicalTest/info'
return http.get(url, data).then(res => {
return res;
})
},
//体测报告-列表
physicalTest(data = {}) {
let url = '/class/physicalTest'
return http.get(url, data).then(res => {
return res;
})
},
//获取学员详情
jlStudentsInfo(data = {}) {
let url = '/class/jlStudentsInfo'
return http.get(url, data).then(res => {
return res;
})
},
//获取添加学员列表
addStudentList(data = {}) {
let url = '/course/addStudentList'
@ -190,6 +204,13 @@ export default {
return res;
})
},
//获取班级课程列表
classCourseList(data = {}) {
let url = '/course/classCourseList'
return http.get(url, data).then(res => {
return res;
})
},
//获取课程详情
courseInfo(data = {}) {
let url = '/course/courseInfo'

1208
pages/coach/class/info.vue

File diff suppressed because it is too large

20
pages/coach/course/info_list.vue

@ -11,11 +11,11 @@
<view class="isbtn" @click="addStudent">
添加学员
</view>
<view v-if="courseInfo.status == 'ongoing'" class="tag" style="background-color: #FAD24E;">上课中
<view v-if="isNowBetween(courseInfo.student_courses[0].start_date, courseInfo.student_courses[0].end_date)" class="tag" style="background-color: #FAD24E;">上课中
</view>
<view v-if="courseInfo.status == 'completed'" class="tag" style="background-color: #e2e2e2;">已结束
<view v-if="!isCourseFuture(courseInfo.student_courses[0].end_date)" class="tag" style="background-color: #e2e2e2;">已结束
</view>
<view v-if="courseInfo.status == 'pending'" class="tag" style="background-color: #1cd188;">未开始
<view v-if="isCourseFuture(courseInfo.student_courses[0].start_date)" class="tag" style="background-color: #1cd188;">未开始
</view>
</view>
@ -189,6 +189,20 @@
async init() {
this.getCourseInfo()
},
isNowBetween(start_date, end_date) {
const now = new Date();
const start = new Date(start_date);
const end = new Date(end_date);
return now >= start && now <= end;
},
isCourseFuture(courseDate) {
const courseTime = new Date(courseDate).getTime();
const nowTime = new Date().getTime();
return courseTime > nowTime;
},
//-
async getCourseInfo() {

45
pages/coach/student/info.vue

@ -10,23 +10,24 @@
<view class="user_section">
<view class="box">
<view class="left">
<image class="pic" :src="$util.img(studentsInfo.header)"></image>
<view class="btn_box" v-if="checkExpireTime(studentsInfo.expire_time)">
<image class="pic" :src="$util.img(studentsInfo.customerResources.member.headimg)"></image>
<!-- <view class="btn_box" v-if="checkExpireTime(studentsInfo.expire_time)">
<view class="btn">即将到期</view>
</view>
</view> -->
</view>
<view class="right">
<view class="item">
<view class="name">{{studentsInfo.name}}</view>
<view class="age">
{{studentsInfo.age}}
<!-- {{formatAgeMonth(studentsInfo.age)}} -->
{{studentsInfo.customerResources.age}}
</view>
</view>
<!-- <view class="item">-->
<!-- <view class="title">家长姓名黄大呢</view>-->
<!-- </view>-->
<view class="item">
<view class="title">电话{{studentsInfo.phone}}</view>
<view class="title">电话{{studentsInfo.customerResources.phone_number}}</view>
</view>
</view>
</view>
@ -111,10 +112,10 @@
:key="k" @click="openViewPhysicalExamination(v)"
>
<view class="top">
<view class="title">综合评分:{{v.score}}</view>
<view class="title">综合评分:{{v.calculateChildHealthScore}}</view>
<!-- <view class="hint">打败了99%学员</view>-->
</view>
<view class="bottom">测试时间{{v.create_time}}</view>
<view class="bottom">测试时间{{$util.formatToDateTime(v.created_at, 'Y-m-d')}}</view>
</view>
</scroll-view>
</view>
@ -133,7 +134,7 @@
<script>
import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
export default {
components: {
@ -157,14 +158,13 @@ export default {
page:1,//
limit:10,//
total:10,//
students_id: '',//id
user_id: '',//id
},
surveyList:[],//
}
},
onLoad(options) {
this.students_id = options.students_id//id
this.filteredData.students_id = options.students_id//id
},
onShow(){
this.init()//
@ -174,14 +174,26 @@ export default {
async init(){
//
await this.getStudentsInfo()
this.getSurveyList()
await this.getSurveyList()
},
formatAgeMonth(input) {
let str = String(input);
//
let [yearPart, monthPart] = str.split('.');
// 0
if (!monthPart) {
monthPart = '00';
}
// 00 0
monthPart = monthPart === '00' ? '0' : monthPart;
return `${yearPart}${monthPart}`;
},
//
async getStudentsInfo(){
let data = {
students_id:this.students_id
}
let res = await memberApi.jlStudentsInfo(data)
let res = await apiRoute.jlStudentsInfo(data)
if (res.code != 1){
uni.showToast({
title: res.msg,
@ -192,7 +204,8 @@ export default {
this.studentsInfo = res.data//
this.assignmentsList = res.data.assignments_list//
this.assignmentsList = res.data.physical_test//
this.filteredData.user_id = res.data.user_id
},
// expire_time 5
@ -253,7 +266,7 @@ export default {
}
//-
let res = await memberApi.surveyList(data)
let res = await apiRoute.physicalTest(data)
this.loading = false
this.isReachedBottom = false;
if (res.code != 1){
@ -264,10 +277,10 @@ export default {
return
}
this.surveyList = this.surveyList.concat(res.data.list.data); // 使 concat
this.surveyList = this.surveyList.concat(res.data.data); // 使 concat
console.log('列表',this.surveyList)
this.filteredData.total = res.data.list.total
this.filteredData.total = res.data.total
this.filteredData.page++
},

54
pages/coach/student/physical_examination.vue

@ -4,38 +4,38 @@
<view class="date">{{$util.formatToDateTime(surveyInfo.create_time,'Y-m-d')}}</view>
<view class="content">
<view class="circle-container">
<view class="card-con-txt1-left">
<image :src="$util.img('/uniapp_src/static/images/index/score.png')" class="overlay-image"></image>
</view>
<view class="card-con-txt1-left-txt">{{surveyInfo.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;">{{surveyInfo.height}}</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;">{{surveyInfo.weight}}</view>
</view>
</view>
<view class="coach-message">
<view>
<image :src="$util.img('/uniapp_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;">{{surveyInfo.content}}</view>
</view>
<!-- <view style="font-size: 45rpx;text-align: center;margin-top: 30%;">详细数据信息</view>-->
<view class="circle-container">
<view class="card-con-txt1-left">
<image :src="$util.img('/uniapp_src/static/images/index/score.png')" class="overlay-image"></image>
</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;">{{(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;">{{v.weight}}</view>
</view>
</view>
<view class="coach-message">
<view>
<image :src="$util.img('/uniapp_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>
</template>
<script>
import memberApi from '@/api/member.js';
import apiRoute from '@/api/apiRoute.js';
export default {
data() {
return {
@ -61,7 +61,7 @@ import memberApi from '@/api/member.js';
let data = {
survey_id:this.survey_id
}
let res = await memberApi.jlSurveyInfo(data)
let res = await apiRoute.physicalTestInfo(data)
if(res.code != 1){
uni.showToast({
title: res.msg,

Loading…
Cancel
Save