Browse Source

feat(api): 添加学生课程消耗记录接口并实现相关页面功能

- 在 apiRoute.js 中添加 xy_personCourseScheduleGetStudentCourseUsageList 方法
- 实现学生端我的课程消耗页面,包括:
  - 获取当前登录学生信息
  - 获取并展示学生课程消耗记录列表  - 优化页面样式,增加无数据提示
  -调整列表项显示内容,如课程使用日期等
master
liutong 10 months ago
parent
commit
6ff8d57bf6
  1. 10
      api/apiRoute.js
  2. 47
      pages/student/my/lesson_consumption.vue

10
api/apiRoute.js

@ -538,6 +538,7 @@ export default {
return res;
})
},
//学生端-学生课程安排-获取学生排课的全部场地列表
xy_personCourseScheduleGetMyCoach(data = {}) {
let url = '/xy/personCourseSchedule/getMyCoach'
@ -546,6 +547,15 @@ export default {
})
},
//学生端-学生课程安排-获取学生课程消耗记录列表
xy_personCourseScheduleGetStudentCourseUsageList(data = {}) {
let url = '/xy/personCourseSchedule/getStudentCourseUsageList'
return http.get(url, data).then(res => {
return res;
})
},

47
pages/student/my/lesson_consumption.vue

@ -2,27 +2,23 @@
<template>
<view class="assemble">
<view style="height: 50rpx;"></view>
<view class="ul">
<view class="message_box" v-if="!tableList.length">
暂无更多数据
</view>
<view class="ul" v-if="tableList.length">
<view class="li" v-for="(v,k) in tableList" :key="k">
<view class="left">
<view class="title">{{v.name}}</view>
<view class="date">上课时间{{v.create_time}}</view>
<view class="date">课程使用日期{{v.usage_date}}</view>
</view>
<view class="right">
<view
v-if="v.status == 1"
class="btn"
style="background-color: #29d3b4;"
>
{{v.hour}}课时
</view>
<view
v-if="v.status == 2"
class="btn"
style="background-color: #FAD04D;"
>
请假
{{v.usage_date}}课时
</view>
</view>
</view>
@ -31,7 +27,7 @@
</template>
<script>
import memberApi from '@/api/member.js';
import apiRoute from '@/api/apiRoute.js';
export default {
data() {
@ -45,9 +41,12 @@ import memberApi from '@/api/member.js';
page:1,//
limit:10,//
total:10,//
resources_id:'',//id
},
tableList:[],//
memberInfo:{},//
}
},
onLoad(options) {
@ -65,9 +64,24 @@ import memberApi from '@/api/member.js';
methods: {
//
async init(){
await this.getMemberInfo()//
await this.getList()//
},
//
async getMemberInfo() {
let res = await apiRoute.xy_memberInfo({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.memberInfo = res.data
this.filteredData.resources_id = res.data.id
},
//()
loadMoreData() {
//
@ -105,7 +119,7 @@ import memberApi from '@/api/member.js';
this.tableList = []
}
let res = await memberApi.studentsSignList(data)
let res = await apiRoute.xy_personCourseScheduleGetStudentCourseUsageList(data)
this.loading = false
this.isReachedBottom = false;
if (res.code != 1){
@ -128,6 +142,11 @@ import memberApi from '@/api/member.js';
</script>
<style lang="less" scoped>
.message_box{
font-size: 30rpx;
text-align: center;
color: #fff;
}
.assemble {
width: 100%;
height: 100vh;

Loading…
Cancel
Save