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; return res;
}) })
}, },
//学生端-学生课程安排-获取学生排课的全部场地列表 //学生端-学生课程安排-获取学生排课的全部场地列表
xy_personCourseScheduleGetMyCoach(data = {}) { xy_personCourseScheduleGetMyCoach(data = {}) {
let url = '/xy/personCourseSchedule/getMyCoach' 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> <template>
<view class="assemble"> <view class="assemble">
<view style="height: 50rpx;"></view> <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="li" v-for="(v,k) in tableList" :key="k">
<view class="left"> <view class="left">
<view class="title">{{v.name}}</view> <view class="title">{{v.name}}</view>
<view class="date">上课时间{{v.create_time}}</view> <view class="date">课程使用日期{{v.usage_date}}</view>
</view> </view>
<view class="right"> <view class="right">
<view <view
v-if="v.status == 1"
class="btn" class="btn"
style="background-color: #29d3b4;" style="background-color: #29d3b4;"
> >
{{v.hour}}课时 {{v.usage_date}}课时
</view>
<view
v-if="v.status == 2"
class="btn"
style="background-color: #FAD04D;"
>
请假
</view> </view>
</view> </view>
</view> </view>
@ -31,7 +27,7 @@
</template> </template>
<script> <script>
import memberApi from '@/api/member.js'; import apiRoute from '@/api/apiRoute.js';
export default { export default {
data() { data() {
@ -45,9 +41,12 @@ import memberApi from '@/api/member.js';
page:1,// page:1,//
limit:10,// limit:10,//
total:10,// total:10,//
resources_id:'',//id
}, },
tableList:[],// tableList:[],//
memberInfo:{},//
} }
}, },
onLoad(options) { onLoad(options) {
@ -65,9 +64,24 @@ import memberApi from '@/api/member.js';
methods: { methods: {
// //
async init(){ async init(){
await this.getMemberInfo()//
await this.getList()// 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() { loadMoreData() {
// //
@ -105,7 +119,7 @@ import memberApi from '@/api/member.js';
this.tableList = [] this.tableList = []
} }
let res = await memberApi.studentsSignList(data) let res = await apiRoute.xy_personCourseScheduleGetStudentCourseUsageList(data)
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
if (res.code != 1){ if (res.code != 1){
@ -128,6 +142,11 @@ import memberApi from '@/api/member.js';
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.message_box{
font-size: 30rpx;
text-align: center;
color: #fff;
}
.assemble { .assemble {
width: 100%; width: 100%;
height: 100vh; height: 100vh;

Loading…
Cancel
Save