Browse Source

接口

master
李双庆 10 months ago
parent
commit
54ccb7fded
  1. 43
      api/apiRoute.js
  2. 4
      pages/coach/class/list.vue
  3. 401
      pages/coach/course/info_list.vue
  4. 426
      pages/coach/course/list.vue
  5. 14
      pages/coach/my/index.vue

43
api/apiRoute.js

@ -128,9 +128,46 @@ export default {
//获取添加学员列表
addStudentList(data = {}) {
let url = '/course/addStudentList'
return http.get(url, data).then(res => {
return res;
})
},
addStudent(data = {}) {
let url = '/course/addStudent'
return http.post(url, data).then(res => {
return res;
})
},
delStudentCourse(data = {}) {
let url = '/course/delStudentCourse'
return http.get(url, data).then(res => {
return res;
})
},
//获取班级列表
jlClassList(data = {}) {
let url = '/class/jlClassList'
return http.get(url, data).then(res => {
return res;
})
},
//获取课程列表
courseList(data = {}) {
let url = '/course/courseList'
return http.get(url, data).then(res => {
return res;
})
},
//获取课程详情
courseInfo(data = {}) {
let url = '/course/courseInfo'
return http.get(url, data).then(res => {
return res;
})
},
//教研管理文章列表 //教研管理文章列表
teachingResearchList(data = {}) { teachingResearchList(data = {}) {
let url = '/teachingResearch/list' let url = '/teachingResearch/list'

4
pages/coach/class/list.vue

@ -59,7 +59,7 @@
<script> <script>
import memberApi from '@/api/member.js'; import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
export default { export default {
components: { components: {
@ -129,7 +129,7 @@ export default {
this.tableList = [] this.tableList = []
} }
let res = await memberApi.jlClassList(data) let res = await apiRoute.jlClassList(data)
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
if (res.code != 1){ if (res.code != 1){

401
pages/coach/course/info_list.vue

@ -3,22 +3,19 @@
<view class="main_box"> <view class="main_box">
<view class="main_section"> <view class="main_section">
<view class="section_1"> <view class="section_1">
<view class="title">班级{{courseInfo.classes_name}}</view> <view class="title">时间{{courseInfo.course_date}}</view>
<view class="title">时间{{courseInfo.date_time}} {{courseInfo.time_slot.replace(',', ' - ')}}</view> <view class="title">地点{{courseInfo.venue.venue_name}}</view>
<view class="title">地点{{courseInfo.address}}</view> <view class="title">课程{{courseInfo.course.course_name}}</view>
<view class="title">课程{{courseInfo.courses_name}}</view> <view class="title">教练{{courseInfo.coach.name}}</view>
<view class="title">教练{{courseInfo.staff_name}}</view> <view class="title">人数{{courseInfo.venue.capacity}}</view>
<view class="title">人数{{courseInfo.students_count}}</view> <view class="isbtn" @click="addStudent">
添加学员
<view </view>
v-if="courseInfo.status == 1" <view v-if="courseInfo.status == 'ongoing'" class="tag" style="background-color: #FAD24E;">上课中
class="tag"
style="background-color: #FAD24E;">上课中
</view> </view>
<view <view v-if="courseInfo.status == 'completed'" class="tag" style="background-color: #e2e2e2;">已结束
v-if="courseInfo.status == 2" </view>
class="tag" <view v-if="courseInfo.status == 'pending'" class="tag" style="background-color: #1cd188;">未开始
style="background-color: #e2e2e2;">已结束
</view> </view>
</view> </view>
@ -30,19 +27,19 @@
<!--签到情况--> <!--签到情况-->
<view class="section_3" v-if="tableType == 1"> <view class="section_3" v-if="tableType == 1">
<view class="tip_title" v-if="courseInfo.sign_list.length == 0">暂无数据</view> <view class="tip_title" v-if="courseInfo.student_courses.length == 0">暂无数据</view>
<view class="item" v-for="(v,k) in courseInfo.sign_list" :key="k"> <view class="item" v-for="(v,k) in courseInfo.student_courses" :key="k">
<view class="left"> <view class="left">
<image class="pic" model="aspectFit" :src="$util.img(v.header)"></image> <image class="pic" model="aspectFit" :src="$util.img(v.avatar)"></image>
<view class="box"> <view class="box">
<view class="title">{{v.name}}</view> <view class="title">{{v.name}}</view>
<view class="title">课程截止时间{{v.create_time}}</view> <view class="title">课程截止时间{{v.end_date}}</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right" v-if="courseInfo.status == 'pending'">
<view class="tag" v-if="v.status == 2">请假</view> <view class="tag" @click="written(v.student_id)" v-if="!isWithinOneHourBefore(courseInfo.time_slot)">请假</view>
</view> </view>
</view> </view>
@ -51,88 +48,89 @@
<!--作业情况--> <!--作业情况-->
<view class="section_4" v-if="tableType == 2"> <view class="section_4" v-if="tableType == 2">
<view class="item_box"> <view class="item_box">
<!-- 待批改--> <!-- 待批改-->
<fui-collapse-item @change="changeCollapse(1)" open="true" isBorder="false" contentBg="#434544"> <fui-collapse-item @change="changeCollapse(1)" open="true" isBorder="false" contentBg="#434544">
<view class="title_box"> <view class="title_box">
<text>待批改{{courseInfo.assignments.dpg_list.length}}</text> <text>待批改{{courseInfo.groupedByStatus1.length}}</text>
</view> </view>
<template v-slot:content> <template v-slot:content>
<view class="ul"> <view class="ul">
<view <view v-for="(v,k) in courseInfo.groupedByStatus1" :key="k" class="li"
v-for="(v,k) in courseInfo.assignments.dpg_list" @click="openViewWorkDetails(v)">
:key="k"
class="li"
@click="openViewWorkDetails(v)"
>
<view class="left"> <view class="left">
<image class="pic" model="aspectFit" :src="$util.img(v.header)"></image> <image class="pic" model="aspectFit"
:src="$util.img(v.student.customerResources.member.headimg)"></image>
<view class="box"> <view class="box">
<view class="title">{{v.name}}</view> <view class="title">{{v.student.name}}</view>
<view class="title">课程截止时间{{v.tj_time}}</view> <view class="title">
<view>提交时间</view>
<view>{{v.created_at}}</view>
</view> </view>
</view> </view>
<view class="right">
<view class="btn">查看并批改</view>
</view> </view>
<!-- <view class="right">
<view class="btn">查看并批改</view>
</view> -->
</view> </view>
</view> </view>
</template> </template>
</fui-collapse-item> </fui-collapse-item>
</view> </view>
<!-- 未提交--> <!-- 未提交-->
<view class="item_box"> <view class="item_box">
<fui-collapse-item @change="changeCollapse(2)" isBorder="false" contentBg="#434544"> <fui-collapse-item @change="changeCollapse(2)" isBorder="false" contentBg="#434544">
<view class="title_box"> <view class="title_box">
<text>未提交{{courseInfo.assignments.wtj_list.length}}</text> <text>未提交{{courseInfo.groupedByStatus2.length}}</text>
</view> </view>
<template v-slot:content> <template v-slot:content>
<view class="ul"> <view class="ul">
<view <view class="li" v-for="(v,k) in courseInfo.groupedByStatus2" :key="k"
class="li" @click="openViewWorkDetails(v)">
v-for="(v,k) in courseInfo.assignments.wtj_list"
:key="k"
@click="openViewWorkDetails(v)"
>
<view class="left"> <view class="left">
<image class="pic" model="aspectFit" :src="$util.img(v.header)"></image> <image class="pic" model="aspectFit"
:src="$util.img(v.student.customerResources.member.headimg)"></image>
<view class="box"> <view class="box">
<view class="title">{{v.name}}</view> <view class="title">{{v.student.name}}</view>
<!-- <view class="title">课程截止时间2025-05-25</view>--> <view class="title">
<view>提交时间</view>
<!-- <view>{{v.created_at}}</view> -->
</view> </view>
</view> </view>
<view class="right">
<!-- <view class="btn">查看并批改</view>-->
</view> </view>
<!-- <view class="right">
<view class="btn">查看并批改</view>
</view> -->
</view> </view>
</view> </view>
</template> </template>
</fui-collapse-item> </fui-collapse-item>
</view> </view>
<!-- 已提交--> <!-- 已提交-->
<view class="item_box"> <view class="item_box">
<fui-collapse-item @change="changeCollapse(3)" isBorder="false" contentBg="#434544"> <fui-collapse-item @change="changeCollapse(3)" isBorder="false" contentBg="#434544">
<view class="title_box"> <view class="title_box">
<text>已提交{{courseInfo.assignments.ypg_list.length}}</text> <text>已提交{{courseInfo.groupedByStatus3.length}}</text>
</view> </view>
<template v-slot:content> <template v-slot:content>
<view class="ul"> <view class="ul">
<view <view class="li" v-for="(v,k) in courseInfo.groupedByStatus3" :key="k"
class="li"
v-for="(v,k) in courseInfo.assignments.ypg_list"
:key="k"
@click="openViewWorkDetails(v)"> @click="openViewWorkDetails(v)">
<view class="left"> <view class="left">
<image class="pic" model="aspectFit" :src="$util.img(v.header)"></image> <image class="pic" model="aspectFit"
:src="$util.img(v.student.customerResources.member.headimg)"></image>
<view class="box"> <view class="box">
<view class="title">{{v.name}}</view> <view class="title">{{v.student.name}}</view>
<!-- <view class="title">课程截止时间2025-05-25</view>--> <view class="title">
<view>提交时间</view>
<view>{{v.created_at}}</view>
</view> </view>
</view> </view>
<view class="right">
<!-- <view class="btn">查看并批改</view>-->
</view> </view>
<!-- <view class="right">
<view class="btn">查看并批改</view>
</view> -->
</view> </view>
</view> </view>
</template> </template>
@ -140,49 +138,64 @@
</view> </view>
</view> </view>
</view> </view>
<fui-picker :options="StudentList" :linkage="true" :show="show" :layer="1" @change="change"
@cancel="cancel"></fui-picker>
<fui-actionsheet :show="written_show" :tips="written_tips" :isCancel="isCancel"
:itemList="itemList" @cancel="written_cancel" @click="written_click"></fui-actionsheet>
</view> </view>
</template> </template>
<script> <script>
import memberApi from '@/api/member.js'; import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
export default { export default {
components: { components: {
AQTabber, AQTabber,
}, },
data() { data() {
return { return {
course_id: '',//id course_id: '', //id
courseInfo: { courseInfo: {
sign_list: [],// sign_list: [], //
assignments: { assignments: {
dpg_list: [], // dpg_list: [], //
wtj_list: [], // wtj_list: [], //
ypg_list: [] // ypg_list: [] //
}, },
},// }, //
tableType: 1,//1=2= tableType: 1, //1=2=
show: false,
StudentList: [],
written_show: false,
written_tips: '确认请假',
isCancel: false,
itemList: ['确认', '取消'],
qingjia_student_id: 0
} }
}, },
onLoad(options) { onLoad(options) {
this.course_id = options.id this.course_id = options.id
}, },
onShow(){ onShow() {
this.init() this.init()
}, },
methods: { methods: {
// //
async init(){ async init() {
this.getCourseInfo() this.getCourseInfo()
}, },
//- //-
async getCourseInfo(){ async getCourseInfo() {
let res = await memberApi.courseInfo({id:this.course_id}) let res = await apiRoute.courseInfo({
if(res.code != 1){ id: this.course_id
})
if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
@ -190,7 +203,7 @@ export default {
return return
} }
this.courseInfo = res.data this.courseInfo = res.data
console.log('课程详情',this.courseInfo) console.log('课程详情', this.courseInfo)
}, },
// //
@ -198,43 +211,135 @@ export default {
this.tableType = type this.tableType = type
}, },
// //
openViewCourseInfo(item){ openViewCourseInfo(item) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/coach/course/info' url: '/pages/coach/course/info'
}) })
}, },
// //
changeCollapse(type){}, changeCollapse(type) {},
//- //-
openViewWorkDetails(item){ openViewWorkDetails(item) {
let id = item.id let id = item.id
uni.navigateTo({ uni.navigateTo({
url: `/pages/coach/student/work_details?id=${id}` url: `/pages/coach/student/work_details?id=${id}`
}) })
}, },
//
async addStudent() {
let res = await apiRoute.addStudentList({
id: this.course_id
})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.StudentList = res.data
if (this.StudentList.length == 0) {
uni.showToast({
title: '暂无可填加的学员',
icon: 'none'
})
return
} else {
this.show = true
}
},
async change(e) {
this.show = false
let res = await apiRoute.addStudent({
student_id: e.value,
schedule_id: this.course_id,
time_slot: this.courseInfo.time_slot,
course_date: this.courseInfo.course_date
})
if (res.code != 1) {
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.init()
},
cancel() {
this.show = false
},
//
written(student_id) {
this.qingjia_student_id = student_id
this.written_show = true
},
written_cancel() {
this.written_show = false
},
async written_click(e) {
if(e.text == '取消'){
this.written_show = false
} else {
let res = await apiRoute.delStudentCourse({
student_id: this.qingjia_student_id,
course_id: this.course_id,
})
if (res.data) {
uni.showToast({
title: '请假成功',
icon: 'none'
})
this.init()
} else {
uni.showToast({
title: '学员不存在',
icon: 'none'
})
}
this.written_show = false
}
},
isWithinOneHourBefore(time_slot) {
//
const [startStr] = time_slot.split('-');
const [hours, minutes] = startStr.split(':').map(Number);
//
const startTime = new Date();
startTime.setHours(hours, minutes, 0, 0);
//
const oneHourBeforeStart = new Date(startTime.getTime() - 60 * 60 * 1000);
//
const now = new Date();
// [, )
return now >= oneHourBeforeStart && now < startTime;
}
}
} }
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main_box {
background: #292929;
}
.main_box{ //
background: #292929 ; .navbar_section {
}
//
.navbar_section{
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: #292929; background: #292929;
.title{
.title {
padding: 40rpx 0rpx; padding: 40rpx 0rpx;
/* 小程序端样式 */ /* 小程序端样式 */
@ -245,9 +350,9 @@ export default {
font-size: 30rpx; font-size: 30rpx;
color: #fff; color: #fff;
} }
} }
.main_section{ .main_section {
min-height: 100vh; min-height: 100vh;
background: #292929 100%; background: #292929 100%;
padding: 30rpx 24rpx; padding: 30rpx 24rpx;
@ -256,7 +361,7 @@ export default {
font-size: 24rpx; font-size: 24rpx;
color: #FFFFFF; color: #FFFFFF;
.section_1{ .section_1 {
position: relative; position: relative;
padding: 18rpx 34rpx 50rpx; padding: 18rpx 34rpx 50rpx;
display: flex; display: flex;
@ -266,7 +371,8 @@ export default {
font-size: 24rpx; font-size: 24rpx;
background-color: #434544; background-color: #434544;
border-radius: 22rpx; border-radius: 22rpx;
.tag{
.tag {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
@ -281,7 +387,7 @@ export default {
} }
} }
.section_2{ .section_2 {
margin-top: 44rpx; margin-top: 44rpx;
color: #fff; color: #fff;
font-size: 30rpx; font-size: 30rpx;
@ -289,7 +395,8 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.table{
.table {
width: 50%; width: 50%;
height: 64rpx; height: 64rpx;
background-color: #1684FCFF; background-color: #1684FCFF;
@ -297,22 +404,24 @@ export default {
line-height: 62rpx; line-height: 62rpx;
text-align: center; text-align: center;
} }
.table:nth-child(1){
.table:nth-child(1) {
border-top-left-radius: 8rpx; border-top-left-radius: 8rpx;
border-bottom-left-radius: 8rpx; border-bottom-left-radius: 8rpx;
} }
.table:nth-child(2){
.table:nth-child(2) {
border-top-right-radius: 8rpx; border-top-right-radius: 8rpx;
border-bottom-right-radius: 8rpx; border-bottom-right-radius: 8rpx;
} }
.select{ .select {
background-color: #fff; background-color: #fff;
color: #1684FCFF; color: #1684FCFF;
} }
} }
.section_3{ .section_3 {
margin-top: 44rpx; margin-top: 44rpx;
min-height: 20vh; min-height: 20vh;
padding: 30rpx 0; padding: 30rpx 0;
@ -320,69 +429,78 @@ export default {
background-color: #434544; background-color: #434544;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
// //
.tip_title{ .tip_title {
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
color: #FFFFFF; color: #FFFFFF;
} }
.item{
.item {
border-top: 1px solid #D7D7D7; border-top: 1px solid #D7D7D7;
padding: 20rpx 33rpx 20rpx 14rpx; padding: 20rpx 33rpx 20rpx 14rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.left{
.left {
width: 80%; width: 80%;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 26rpx; gap: 26rpx;
.pic{
.pic {
width: 92rpx; width: 92rpx;
height: 92rpx; height: 92rpx;
border-radius: 50%; border-radius: 50%;
background-color: #797979FF; background-color: #797979FF;
} }
.box{
.box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10rpx; gap: 10rpx;
.title{
.title {
color: #fff; color: #fff;
font-size: 24rpx; font-size: 24rpx;
} }
} }
} }
.right{
.tag{ .right {
.tag {
width: 93rpx; width: 93rpx;
height: 93rpx; height: 93rpx;
border-radius: 50%; border-radius: 50%;
line-height: 90rpx; line-height: 90rpx;
font-size: 26rpx; font-size: 26rpx;
background-color: rgba(254,250,131,0.62); background-color: rgba(254, 250, 131, 0.62);
color: rgba(255,255,255,1); color: rgba(255, 255, 255, 1);
text-align: center; text-align: center;
border: 0rpx solid rgba(254,250,131,0.62); border: 0rpx solid rgba(254, 250, 131, 0.62);
//45° //45°
transform: rotate(-30deg); transform: rotate(-30deg);
} }
} }
} }
.item:nth-child(1){
.item:nth-child(1) {
border-top: 0px; border-top: 0px;
} }
} }
.section_4{ .section_4 {
margin-top: 44rpx; margin-top: 44rpx;
padding: 30rpx 0; padding: 30rpx 0;
border-radius: 22rpx; border-radius: 22rpx;
background-color: #434544; background-color: #434544;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.item_box{
.item_box {
margin-bottom: 30rpx; margin-bottom: 30rpx;
padding-left: 24rpx; padding-left: 24rpx;
padding-right: 32rpx; padding-right: 32rpx;
@ -391,18 +509,23 @@ export default {
font-size: 28rpx; font-size: 28rpx;
color: #fff; color: #fff;
background-color: #434544; background-color: #434544;
::v-deep .fui-collapse-item__title{
::v-deep .fui-collapse-item__title {
background-color: #434544 !important; background-color: #434544 !important;
} }
::v-deep .fui-collapse__border-color{
border-top: none !important; /* 取消上边框 */ ::v-deep .fui-collapse__border-color {
border-top: none !important;
/* 取消上边框 */
background: #434544 !important; background: #434544 !important;
} }
.title_box{
} .title_box {}
.ul{
.ul {
background-color: #434544; background-color: #434544;
.li{
.li {
background-color: #434544; background-color: #434544;
border-top: 1px solid #D7D7D7; border-top: 1px solid #D7D7D7;
padding: 20rpx 33rpx 20rpx 14rpx; padding: 20rpx 33rpx 20rpx 14rpx;
@ -410,29 +533,34 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.left{
.left {
width: 80%; width: 80%;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 26rpx; gap: 26rpx;
.pic{
.pic {
width: 92rpx; width: 92rpx;
height: 92rpx; height: 92rpx;
border-radius: 50%; border-radius: 50%;
background-color: #797979FF; background-color: #797979FF;
} }
.box{
.box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10rpx; gap: 10rpx;
.title{
.title {
color: #fff; color: #fff;
font-size: 24rpx; font-size: 24rpx;
} }
} }
} }
.right{
.btn{ .right {
.btn {
background-color: #a4adb3; background-color: #a4adb3;
color: #fff; color: #fff;
@ -440,20 +568,35 @@ export default {
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
border-radius: 8rpx; border-radius: 8rpx;
background-color: rgba(164,173,179,1); background-color: rgba(164, 173, 179, 1);
color: rgba(255,255,255,1); color: rgba(255, 255, 255, 1);
font-size: 24rpx; font-size: 24rpx;
text-align: center; text-align: center;
} }
} }
} }
.li:nth-child(1){
border-top: none !important; /* 取消上边框 */ .li:nth-child(1) {
border-top: none !important;
/* 取消上边框 */
}
} }
} }
} }
} }
}
.isbtn {
border: 1px solid #FAD04D;
border-radius: 10rpx;
background: #434544;
color: #FAD04D;
width: 110rpx;
height: 60rpx;
line-height: 55rpx;
text-align: center;
font-size: 24rpx;
position: absolute;
bottom: 20rpx;
right: 15rpx;
}
</style> </style>

426
pages/coach/course/list.vue

@ -9,12 +9,9 @@
<view class="main_section"> <view class="main_section">
<view class="section_1"> <view class="section_1">
<view class="ul"> <view class="ul">
<view class="li" v-for="(v,k) in dateList" :key="k" @click="selectDate(v.date)"> <view class="li" v-for="(v,k) in dates" :key="k" @click="selectDate(v.date)">
<text>{{v.week}}</text> <text>{{v.weekday}}</text>
<text :class="[filteredData.schedule_date == v.date ? 'today':'']">{{today == v.date ? '今':v.dayOfMonth}}</text>
<text :class="[filteredData.schedule_date == v.date ? 'today':'']">{{today == v.date ? '今':v.today}}</text>
<text :class="[v.status == 2 ?'select_plan':'']"></text>
</view> </view>
</view> </view>
<view class="btn" @click="show_calendar=true"> <view class="btn" @click="show_calendar=true">
@ -22,70 +19,61 @@
</view> </view>
</view> </view>
<!-- <view class="section_2">--> <!-- <view class="section_2">-->
<!-- <view class="item_box">--> <!-- <view class="item_box">-->
<!-- <fui-dropdown-menu :size="28" selectedColor="#465CFF" :options="options_course" @click="clickCourse" @close="show_course=false" ref="ref_course">--> <!-- <fui-dropdown-menu :size="28" selectedColor="#465CFF" :options="options_course" @click="clickCourse" @close="show_course=false" ref="ref_course">-->
<!-- <view class="fui-filter__item" @tap="filterTapCourse">--> <!-- <view class="fui-filter__item" @tap="filterTapCourse">-->
<!-- <text>{{course_name}}</text>--> <!-- <text>{{course_name}}</text>-->
<!-- <view class="fui-filter__icon" :class="{'fui-icon__ani':show_course}">--> <!-- <view class="fui-filter__icon" :class="{'fui-icon__ani':show_course}">-->
<!-- <fui-icon name="turningdown" :size="32" color="#FFF"></fui-icon>--> <!-- <fui-icon name="turningdown" :size="32" color="#FFF"></fui-icon>-->
<!-- </view>--> <!-- </view>-->
<!-- </view>--> <!-- </view>-->
<!-- </fui-dropdown-menu>--> <!-- </fui-dropdown-menu>-->
<!-- </view>--> <!-- </view>-->
<!-- <view class="item_box">--> <!-- <view class="item_box">-->
<!-- <fui-dropdown-menu :size="28" selectedColor="#465CFF" :options="options_classroom" @click="clickClassroom" @close="show_classroom=false" ref="ref_classroom">--> <!-- <fui-dropdown-menu :size="28" selectedColor="#465CFF" :options="options_classroom" @click="clickClassroom" @close="show_classroom=false" ref="ref_classroom">-->
<!-- <view class="fui-filter__item" @tap="filterTapClassroom">--> <!-- <view class="fui-filter__item" @tap="filterTapClassroom">-->
<!-- <text>{{classroom_name}}</text>--> <!-- <text>{{classroom_name}}</text>-->
<!-- <view class="fui-filter__icon" :class="{'fui-icon__ani':show_classroom}">--> <!-- <view class="fui-filter__icon" :class="{'fui-icon__ani':show_classroom}">-->
<!-- <fui-icon name="turningdown" :size="32" color="#FFF"></fui-icon>--> <!-- <fui-icon name="turningdown" :size="32" color="#FFF"></fui-icon>-->
<!-- </view>--> <!-- </view>-->
<!-- </view>--> <!-- </view>-->
<!-- </fui-dropdown-menu>--> <!-- </fui-dropdown-menu>-->
<!-- </view>--> <!-- </view>-->
<!-- </view>--> <!-- </view>-->
<scroll-view <scroll-view class="section_3" scroll-y="true" :lower-threshold="lowerThreshold"
class="section_3" @scrolltolower="loadMoreData" style="height: 100vh;">
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
style="height: 100vh;"
>
<view class="ul"> <view class="ul">
<view <view class="li" v-for="(v,k) in tableList" :key="k" @click="openViewCourseInfoList(v)">
class="li"
v-for="(v,k) in tableList"
:key="k"
@click="openViewCourseInfoList(v)"
>
<view class="top_box"> <view class="top_box">
<view class="center_box"> <view class="center_box">
<view>班级{{v.classes_name}}</view> <view>时间{{v.course_date}}</view>
<view>时间{{v.date}}</view> <view>课室{{v.venue.venue_name}}</view>
<view>课室{{v.address}} <view>课程{{v.course.course_name}}</view>
</view> <view>人数{{v.venue.capacity}}</view>
<view>课程{{v.courses_name}}
</view>
</view> </view>
<view class="right_box"> <view class="right_box">
<!-- v.status|1=未开始,2=进行中,3=已结束--> <!-- v.status|1=未开始,2=进行中,3=已结束-->
<view class="tag" :style="{background: v.status == 1 ? '#1cd188' : v.status == 2 ? '#fad24e' : '#ff4d4f'}"> <view class="tag"
{{ v.status === 1 ? '未开始' : v.status === 2 ? '上课中' : '已结束' }}</view> :style="{background: v.status == 'pending' ? '#1cd188' : v.status == 'ongoing' ? '#fad24e' : '#ff4d4f'}">
{{ v.status === 'pending' ? '未开始' : v.status === 'ongoing' ? '上课中' : '已结束' }}
</view>
<!-- <view class="tag" style="background:#1cd188;">待上课</view>--> <!-- <view class="tag" style="background:#1cd188;">待上课</view>-->
</view> </view>
</view> </view>
<!-- <view class="bottom_box" v-if="v.status !== 'pending'"> -->
<view class="bottom_box"> <view class="bottom_box">
<view class="hint"> <view class="hint">
已签到学生 ({{v.sign_list.length }}/{{v.max_students.split(',').length }}) 已签到学生 ({{v.student.length }}/{{v.venue.capacity}})
</view> </view>
<view class="list_box"> <view class="list_box">
<view class="list"> <view class="list">
<view class="itme" v-for="(item,index) in v.sign_list || 0" :key="index"> <view class="itme" v-for="(item,index) in v.student || 0" :key="index">
<image :src="$util.img(item.header)"></image> <image :src="$util.img(item.avatar)"></image>
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
@ -93,67 +81,63 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="isbtn" v-if="v.status === 'pending'">
详情
</view> -->
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- 日历选择--> <!-- 日历选择-->
<fui-bottom-popup :show="show_calendar" @close="show_calendar=false"> <fui-bottom-popup :show="show_calendar" @close="show_calendar=false">
<view class="fui-custom__wrap"> <view class="fui-custom__wrap">
<uni-calendar <uni-calendar :insert="true" :lunar="false" :selected="calendarSelected" :startDate="startDate"
:insert="true" :endDate="endDate" @change="changeCalendar" />
:lunar="false"
:selected="calendarSelected"
:startDate="startDate"
:endDate="endDate"
@change="changeCalendar"
/>
</view> </view>
</fui-bottom-popup> </fui-bottom-popup>
<!-- 底部导航--> <!-- 底部导航-->
<AQTabber/> <AQTabber />
</view> </view>
</template> </template>
<script> <script>
// import user from '@/api/user.js'; // import user from '@/api/user.js';
import memberApi from '@/api/member.js'; import memberApi from '@/api/member.js';
import commonApi from '@/api/common.js'; import commonApi from '@/api/common.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
export default { export default {
components: { components: {
AQTabber, AQTabber,
}, },
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, //
schedule_date: '',// schedule_date: '', //
venue_id: '',//id venue_id: '', //id
}, },
tableList: [],// tableList: [], //
venuesInfo: {},// venuesInfo: {}, //
formData:{}, formData: {},
// //
show_course:false,// show_course: false, //
// //
course_name:'课程',// course_name: '课程', //
options_course: [ options_course: [{
{
text: '请选择课程', text: '请选择课程',
value: '', value: '',
checked: true checked: true
@ -163,15 +147,13 @@ export default {
}, { }, {
text: '篮球课程2', text: '篮球课程2',
value: '2' value: '2'
} }],
],
// //
show_classroom:false,// show_classroom: false, //
// //
classroom_name:'课室',// classroom_name: '课室', //
options_classroom: [ options_classroom: [{
{
text: '请选择课室', text: '请选择课室',
value: '', value: '',
checked: true checked: true
@ -181,29 +163,29 @@ export default {
}, { }, {
text: '篮球室101', text: '篮球室101',
value: '2' value: '2'
} }],
],
// //
today: '', today: '',
dateList: [],// dateList: [], //
// //
show_calendar:false,// show_calendar: false, //
startDate:'',// startDate: '', //
endDate:'',// endDate: '', //
calendarSelected: [],// calendarSelected: [], //
dates: {}
} }
}, },
onLoad() { onLoad() {},
}, onShow() {
onShow(){ this.init() //
//this.init()//
}, },
// //
async onPullDownRefresh() { async onPullDownRefresh() {
// //
this.getThisDate()
let schedule_date = this.filteredData.schedule_date let schedule_date = this.filteredData.schedule_date
await this.loadData() await this.loadData()
this.filteredData.schedule_date = schedule_date this.filteredData.schedule_date = schedule_date
@ -211,16 +193,17 @@ export default {
}, },
methods: { methods: {
// //
async init(){ async init() {
await this.getThisDate() await this.getThisDate()
await this.getHeadDate() await this.getHeadDate()
await this.getList() await this.getList()
this.getDateRange() // this.getDateRange()
this.setCalendarSelected() // this.setCalendarSelected()
}, },
// //
clickCourse(e){ clickCourse(e) {
console.log(e) console.log(e)
this.course_name = e.text this.course_name = e.text
this.show_course = true this.show_course = true
@ -235,7 +218,7 @@ export default {
// //
clickClassroom(e){ clickClassroom(e) {
console.log(e) console.log(e)
this.classroom_name = e.text this.classroom_name = e.text
this.show_classroom = true this.show_classroom = true
@ -248,39 +231,57 @@ export default {
}, },
// //
openViewCourseInfoList(item){ openViewCourseInfoList(item) {
let id = item.id let id = item.id
uni.navigateTo({ uni.navigateTo({
url: `/pages/coach/course/info_list?id=${id}` url: `/pages/coach/course/info_list?id=${id}`
}) })
}, },
//
async getHeadDate() {
let res = await commonApi.getDate()
if (res.code != 1) {
//
uni.showToast({
title: res.msg,
icon: 'none',
})
return
}
this.dateList = []
res.data.forEach((v, k) => {
let today = v.date.split("-")[2]; // "09"
this.dateList.push({
date: v.date,
status: v.status,//1 2
week: v.week,
today: today,
})
})
getDatesAroundToday(offsetDays = 0) {
const date = new Date();
date.setDate(date.getDate() + offsetDays);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const weekDay = ['日', '一', '二', '三', '四', '五', '六'][date.getDay()];
return {
date: `${year}-${month}-${day}`,
weekday: `星期${weekDay}`,
dayOfMonth: day // 👈
};
},
console.log('xxx', res) //
async getHeadDate() {
// let res = await commonApi.getDate()
// if (res.code != 1) {
// //
// uni.showToast({
// title: res.msg,
// icon: 'none',
// })
// return
// }
// this.dateList = []
// res.data.forEach((v, k) => {
// let today = v.date.split("-")[2]; // "09"
// this.dateList.push({
// date: v.date,
// status: v.status, //1 2
// week: v.week,
// today: today,
// })
// })
this.dates = {};
for (let i = -3; i <= 3; i++) {
const key = i === 0 ? '今天' : `${Math.abs(i)}${i < 0 ? '前' : '后'}`;
this.dates[key] = this.getDatesAroundToday(i);
}
}, },
// //
@ -300,32 +301,34 @@ export default {
// //
async selectDate(date) { async selectDate(date) {
//this.loadData() this.loadData()
this.filteredData.schedule_date = date this.filteredData.schedule_date = date
//this.getList() this.getList()
}, },
//() //()
loadMoreData() { loadMoreData() {
// //
if (!this.isReachedBottom) { if (!this.isReachedBottom) {
this.isReachedBottom = true;// this.isReachedBottom = true; //
this.getList(); this.getList();
} }
}, },
// //
async loadData() { async loadData() {
this.isReachedBottom = false; // 便 this.isReachedBottom = false; // 便
this.filteredData.page = 1 //
this.filteredData.page = 1// this.filteredData.limit = 10 //
this.filteredData.limit = 10// this.filteredData.total = 10 //
this.filteredData.total = 10// this.filteredData.schedule_date = ''
}, },
// //
async getList() { async getList() {
this.loading = true this.loading = true
let data = {...this.filteredData} let data = {
...this.filteredData
}
// //
if (this.filteredData.page * this.filteredData.limit > this.filteredData.total || this.filteredData.limit > this.filteredData.total) { if (this.filteredData.page * this.filteredData.limit > this.filteredData.total || this.filteredData.limit > this.filteredData.total) {
@ -337,7 +340,7 @@ export default {
return return
} }
let res = await memberApi.courseList(data) let res = await apiRoute.courseList(data)
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
if (res.code != 1) { if (res.code != 1) {
@ -348,11 +351,11 @@ export default {
return return
} }
this.tableList = res.data.list.data this.tableList = res.data.data
// //
this.venuesInfo = res.data.venues_info this.venuesInfo = res.data.venues_info
this.filteredData.total = res.data.list.total this.filteredData.total = res.data.total
this.filteredData.page++ this.filteredData.page++
}, },
@ -381,15 +384,17 @@ export default {
// data startDate endDate // data startDate endDate
this.startDate = formatDate(startDate); this.startDate = formatDate(startDate);
this.endDate = formatDate(endDate); this.endDate = formatDate(endDate);
console.log([this.startDate,this.endDate]) console.log([this.startDate, this.endDate])
}, },
// //
async setCalendarSelected(){ async setCalendarSelected() {
// //
let month = new Date().getMonth() + 1; let month = new Date().getMonth() + 1;
let res = await commonApi.getMonthDate({month:month}) let res = await commonApi.getMonthDate({
if (res.code != 1){ month: month
})
if (res.code != 1) {
// //
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -399,7 +404,7 @@ export default {
return return
} }
this.calendarSelected = [] this.calendarSelected = []
res.data.forEach((v,k)=>{ res.data.forEach((v, k) => {
this.calendarSelected.push({ this.calendarSelected.push({
date: v.date, date: v.date,
}) })
@ -418,31 +423,31 @@ export default {
// ] // ]
}, },
// //
changeCalendar(e){ changeCalendar(e) {
console.log('日历',e) console.log('日历', e)
this.show_calendar = false this.show_calendar = false
//this.loadData() this.loadData()
this.filteredData.schedule_date = e.fulldate this.filteredData.schedule_date = e.fulldate
//this.getList() this.getList()
}, },
} }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main_box {
background: #292929;
}
.main_box{ //
background: #292929 ; .navbar_section {
}
//
.navbar_section{
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: #292929; background: #292929;
.title{
.title {
padding: 40rpx 0rpx; padding: 40rpx 0rpx;
/* 小程序端样式 */ /* 小程序端样式 */
@ -453,9 +458,9 @@ export default {
font-size: 30rpx; font-size: 30rpx;
color: #fff; color: #fff;
} }
} }
.main_section{ .main_section {
min-height: 100vh; min-height: 100vh;
background: #292929 100%; background: #292929 100%;
padding-top: 40rpx; padding-top: 40rpx;
@ -463,47 +468,55 @@ export default {
font-size: 24rpx; font-size: 24rpx;
color: #FFFFFF; color: #FFFFFF;
.section_1{ .section_1 {
background: #333333 100%; background: #333333 100%;
width: 100%; width: 100%;
padding: 30rpx 28rpx; padding: 30rpx 28rpx;
padding-bottom: 15rpx; padding-bottom: 15rpx;
.ul{
.ul {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.li{
.li {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 10rpx; gap: 10rpx;
text{
text {
font-size: 24rpx; font-size: 24rpx;
color: #FFFFFF; color: #FFFFFF;
text-align: center; text-align: center;
} }
text:nth-child(2){
text:nth-child(2) {
width: 44rpx; width: 44rpx;
height: 44rpx; height: 44rpx;
} }
text:nth-child(3){
text:nth-child(3) {
width: 8rpx; width: 8rpx;
height: 8rpx; height: 8rpx;
} }
.today{
.today {
border-radius: 50%; border-radius: 50%;
background: #29D3B4; background: #29D3B4;
text-align: center; text-align: center;
line-height: 42rpx; line-height: 42rpx;
} }
.select_plan{
.select_plan {
background: #F59A23; background: #F59A23;
border-radius: 50%; border-radius: 50%;
} }
} }
} }
.btn{
.btn {
margin-top: 20rpx; margin-top: 20rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -512,31 +525,35 @@ export default {
} }
} }
.section_2{ .section_2 {
margin-top: 30rpx; margin-top: 30rpx;
padding: 0 20rpx ; padding: 0 20rpx;
color: #fff; color: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 20rpx; gap: 20rpx;
.item_box { .item_box {
width: 45%; width: 45%;
.fui-filter__item { .fui-filter__item {
display: flex; display: flex;
} }
} }
} }
.section_3{ .section_3 {
margin-top: 36rpx; margin-top: 36rpx;
color: #fff; color: #fff;
font-size: 24rpx; font-size: 24rpx;
.ul{
.ul {
padding: 0 26rpx; padding: 0 26rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 30rpx; gap: 30rpx;
.li{
.li {
position: relative; position: relative;
border-radius: 22rpx; border-radius: 22rpx;
background: #434544 100%; background: #434544 100%;
@ -544,17 +561,21 @@ export default {
padding-bottom: 30rpx; padding-bottom: 30rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.top_box{
.top_box {
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
.center_box{
.center_box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10rpx; gap: 10rpx;
view{}
view {}
} }
.right_box{
.tag{ .right_box {
position:absolute; .tag {
position: absolute;
top: 0rpx; top: 0rpx;
right: 0rpx; right: 0rpx;
padding: 10rpx; padding: 10rpx;
@ -566,30 +587,36 @@ export default {
} }
} }
} }
.bottom_box{
.bottom_box {
border-top: 1px dashed #F2F2F2; border-top: 1px dashed #F2F2F2;
padding: 26rpx 16rpx 0 26rpx; padding: 26rpx 16rpx 0 26rpx;
.hint{
color:#D7D7D7; .hint {
color: #D7D7D7;
} }
.list_box{
.list_box {
margin-top: 22rpx; margin-top: 22rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.list{
.list {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 14rpx; gap: 14rpx;
.itme{
image{ .itme {
image {
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
border-radius: 50%; border-radius: 50%;
} }
} }
} }
.btn{
.btn {
border: 1px solid #FAD04D; border: 1px solid #FAD04D;
border-radius: 10rpx; border-radius: 10rpx;
background: #434544; background: #434544;
@ -607,7 +634,20 @@ export default {
} }
} }
} }
.isbtn {
border: 1px solid #FAD04D;
border-radius: 10rpx;
background: #434544;
color: #FAD04D;
width: 110rpx;
height: 60rpx;
line-height: 55rpx;
text-align: center;
font-size: 24rpx;
position: absolute;
bottom: 20rpx;
right: 15rpx;
}
</style> </style>

14
pages/coach/my/index.vue

@ -11,7 +11,7 @@
<view class="user_section"> <view class="user_section">
<view class="box"> <view class="box">
<view class="left" @click="openViewMyInfo()"> <view class="left" @click="openViewMyInfo()">
<image class="pic" :src="$util.img(memberInfo.headimg)"></image> <image class="pic" :src="$util.img(memberInfo.head_img)"></image>
<view class="name">{{memberInfo.name}}</view> <view class="name">{{memberInfo.name}}</view>
</view> </view>
<view class="right"> <view class="right">
@ -96,10 +96,10 @@
</view> </view>
<view class="section_box"> <view class="section_box">
<view class="item" @click="openViewFeedback()"> <!-- <view class="item" @click="openViewFeedback()">
<view>意见反馈</view> <view>意见反馈</view>
<view></view> <view></view>
</view> </view> -->
<view class="item" @click="openViewSetUp()"> <view class="item" @click="openViewSetUp()">
<view>设置</view> <view>设置</view>
@ -114,9 +114,9 @@
</template> </template>
<script> <script>
import memberApi from '@/api/member.js'; // import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
import apiRoute from '@/api/apiRoute.js';
export default { export default {
components: { components: {
@ -130,7 +130,7 @@ export default {
onLoad() { onLoad() {
}, },
onShow() { onShow() {
// this.init(); this.init();
}, },
methods: { methods: {
async init(){ async init(){
@ -139,7 +139,7 @@ export default {
//() //()
async getMemberInfo(){ async getMemberInfo(){
let res = await memberApi.member({}) let res = await apiRoute.getPersonnelInfo({})
if (res.code != 1) { if (res.code != 1) {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,

Loading…
Cancel
Save