|
|
@ -12,11 +12,11 @@ |
|
|
<view class="isbtn" @click="addStudent"> |
|
|
<view class="isbtn" @click="addStudent"> |
|
|
添加学员 |
|
|
添加学员 |
|
|
</view> |
|
|
</view> |
|
|
<view v-if="isNowBetween(courseInfo.student_courses[0].start_date, courseInfo.student_courses[0].end_date)" class="tag" style="background-color: #FAD24E;">上课中 |
|
|
<view v-if="courseInfo.student_courses[0] && isNowBetween(courseInfo.student_courses[0].start_date, courseInfo.student_courses[0].end_date)" class="tag" style="background-color: #FAD24E;">上课中 |
|
|
</view> |
|
|
</view> |
|
|
<view v-if="!isCourseFuture(courseInfo.student_courses[0].end_date)" class="tag" style="background-color: #e2e2e2;">已结束 |
|
|
<view v-if="courseInfo.student_courses[0] && !isCourseFuture(courseInfo.student_courses[0].end_date)" class="tag" style="background-color: #e2e2e2;">已结束 |
|
|
</view> |
|
|
</view> |
|
|
<view v-if="isCourseFuture(courseInfo.student_courses[0].start_date)" class="tag" style="background-color: #1cd188;">未开始 |
|
|
<view v-if="courseInfo.student_courses[0] && isCourseFuture(courseInfo.student_courses[0].start_date)" class="tag" style="background-color: #1cd188;">未开始 |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
@ -35,6 +35,10 @@ |
|
|
<image class="pic" model="aspectFit" :src="$util.img(v.avatar)"></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.source}}</view> |
|
|
|
|
|
<view class="title">一访情况:{{v['school_six_speed'].first_visit_time}}</view> |
|
|
|
|
|
<view class="title">一访时间:{{v['school_six_speed'].first_visit_status}}</view> |
|
|
|
|
|
|
|
|
<view class="title">课程截止时间:{{v.end_date}}</view> |
|
|
<view class="title">课程截止时间:{{v.end_date}}</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -209,59 +213,60 @@ |
|
|
|
|
|
|
|
|
//教练端-课程详情 |
|
|
//教练端-课程详情 |
|
|
async getCourseInfo() { |
|
|
async getCourseInfo() { |
|
|
// let res = await apiRoute.courseInfo({ |
|
|
let res = await apiRoute.courseInfo({ |
|
|
// id: this.course_id |
|
|
id: this.course_id |
|
|
// }) |
|
|
}) |
|
|
// if (res.code != 1) { |
|
|
if (res.code != 1) { |
|
|
// uni.showToast({ |
|
|
uni.showToast({ |
|
|
// title: res.msg, |
|
|
title: res.msg, |
|
|
// icon: 'none' |
|
|
icon: 'none' |
|
|
// }) |
|
|
}) |
|
|
// return |
|
|
return |
|
|
// } |
|
|
} |
|
|
// this.courseInfo = res.data |
|
|
console.log('课程详情', res.data) |
|
|
// console.log('课程详情', this.courseInfo) |
|
|
this.courseInfo = res.data |
|
|
|
|
|
|
|
|
// 使用模拟数据 |
|
|
|
|
|
this.courseInfo = { |
|
|
|
|
|
id: this.course_id || '1', |
|
|
|
|
|
course_date: '2025-07-25', |
|
|
|
|
|
time_slot: '14:00-15:30', |
|
|
|
|
|
status: 'pending', |
|
|
|
|
|
venue: { |
|
|
|
|
|
venue_name: '总部校区 305教室', |
|
|
|
|
|
capacity: 20 |
|
|
|
|
|
}, |
|
|
|
|
|
course: { |
|
|
|
|
|
course_name: '少儿英语基础班' |
|
|
|
|
|
}, |
|
|
|
|
|
coach: { |
|
|
|
|
|
name: '王教练' |
|
|
|
|
|
}, |
|
|
|
|
|
student_courses: [ |
|
|
|
|
|
{ |
|
|
|
|
|
student_id: '1001', |
|
|
|
|
|
name: '张三', |
|
|
|
|
|
avatar: '', |
|
|
|
|
|
start_date: '2025-07-25', |
|
|
|
|
|
end_date: '2025-10-25', |
|
|
|
|
|
status: 'pending' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
student_id: '1002', |
|
|
|
|
|
name: '李四', |
|
|
|
|
|
avatar: '', |
|
|
|
|
|
start_date: '2025-07-25', |
|
|
|
|
|
end_date: '2025-10-25', |
|
|
|
|
|
status: 'pending' |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
groupedByStatus1: [], // 待批改 |
|
|
|
|
|
groupedByStatus2: [], // 未提交 |
|
|
|
|
|
groupedByStatus3: [] // 已提交 |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
console.log('课程详情(模拟数据)', this.courseInfo); |
|
|
// 使用模拟数据 |
|
|
|
|
|
// this.courseInfo = { |
|
|
|
|
|
// id: this.course_id || '1', |
|
|
|
|
|
// course_date: '2025-07-25', |
|
|
|
|
|
// time_slot: '14:00-15:30', |
|
|
|
|
|
// status: 'pending', |
|
|
|
|
|
// venue: { |
|
|
|
|
|
// venue_name: '总部校区 305教室', |
|
|
|
|
|
// capacity: 20 |
|
|
|
|
|
// }, |
|
|
|
|
|
// course: { |
|
|
|
|
|
// course_name: '少儿英语基础班' |
|
|
|
|
|
// }, |
|
|
|
|
|
// coach: { |
|
|
|
|
|
// name: '王教练' |
|
|
|
|
|
// }, |
|
|
|
|
|
// student_courses: [ |
|
|
|
|
|
// { |
|
|
|
|
|
// student_id: '1001', |
|
|
|
|
|
// name: '张三', |
|
|
|
|
|
// avatar: '', |
|
|
|
|
|
// start_date: '2025-07-25', |
|
|
|
|
|
// end_date: '2025-10-25', |
|
|
|
|
|
// status: 'pending' |
|
|
|
|
|
// }, |
|
|
|
|
|
// { |
|
|
|
|
|
// student_id: '1002', |
|
|
|
|
|
// name: '李四', |
|
|
|
|
|
// avatar: '', |
|
|
|
|
|
// start_date: '2025-07-25', |
|
|
|
|
|
// end_date: '2025-10-25', |
|
|
|
|
|
// status: 'pending' |
|
|
|
|
|
// } |
|
|
|
|
|
// ], |
|
|
|
|
|
// groupedByStatus1: [], // 待批改 |
|
|
|
|
|
// groupedByStatus2: [], // 未提交 |
|
|
|
|
|
// groupedByStatus3: [] // 已提交 |
|
|
|
|
|
// }; |
|
|
|
|
|
|
|
|
|
|
|
// console.log('课程详情(模拟数据)', this.courseInfo); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//切换标签 |
|
|
//切换标签 |
|
|
@ -292,97 +297,97 @@ |
|
|
|
|
|
|
|
|
//获取添加学员列表 |
|
|
//获取添加学员列表 |
|
|
async addStudent() { |
|
|
async addStudent() { |
|
|
// let res = await apiRoute.addStudentList({ |
|
|
let res = await apiRoute.addStudentList({ |
|
|
// id: this.course_id |
|
|
id: this.course_id |
|
|
// }) |
|
|
}) |
|
|
// if (res.code != 1) { |
|
|
if (res.code != 1) { |
|
|
// uni.showToast({ |
|
|
uni.showToast({ |
|
|
// title: res.msg, |
|
|
title: res.msg, |
|
|
// icon: 'none' |
|
|
icon: 'none' |
|
|
// }) |
|
|
}) |
|
|
// return |
|
|
return |
|
|
// } |
|
|
} |
|
|
// this.StudentList = res.data |
|
|
this.StudentList = res.data |
|
|
// if (this.StudentList.length == 0) { |
|
|
if (this.StudentList.length == 0) { |
|
|
// uni.showToast({ |
|
|
uni.showToast({ |
|
|
// title: '暂无可填加的学员', |
|
|
title: '暂无可填加的学员', |
|
|
// icon: 'none' |
|
|
icon: 'none' |
|
|
// }) |
|
|
}) |
|
|
// return |
|
|
return |
|
|
// } else { |
|
|
} else { |
|
|
// this.show = true |
|
|
this.show = true |
|
|
// } |
|
|
} |
|
|
|
|
|
|
|
|
// 使用模拟数据 |
|
|
// 使用模拟数据 |
|
|
this.StudentList = [ |
|
|
// this.StudentList = [ |
|
|
{ |
|
|
// { |
|
|
text: '张三', |
|
|
// text: '张三', |
|
|
value: '1001' |
|
|
// value: '1001' |
|
|
}, |
|
|
// }, |
|
|
{ |
|
|
// { |
|
|
text: '李四', |
|
|
// text: '李四', |
|
|
value: '1002' |
|
|
// value: '1002' |
|
|
}, |
|
|
// }, |
|
|
{ |
|
|
// { |
|
|
text: '王五', |
|
|
// text: '王五', |
|
|
value: '1003' |
|
|
// value: '1003' |
|
|
}, |
|
|
// }, |
|
|
{ |
|
|
// { |
|
|
text: '赵六', |
|
|
// text: '赵六', |
|
|
value: '1004' |
|
|
// value: '1004' |
|
|
}, |
|
|
// }, |
|
|
{ |
|
|
// { |
|
|
text: '钱七', |
|
|
// text: '钱七', |
|
|
value: '1005' |
|
|
// value: '1005' |
|
|
} |
|
|
// } |
|
|
]; |
|
|
// ]; |
|
|
this.show = true; |
|
|
// this.show = true; |
|
|
}, |
|
|
}, |
|
|
async change(e) { |
|
|
async change(e) { |
|
|
this.show = false |
|
|
this.show = false |
|
|
// let res = await apiRoute.addStudent({ |
|
|
let res = await apiRoute.addStudent({ |
|
|
// student_id: e.value, |
|
|
student_id: e.value, |
|
|
// schedule_id: this.course_id, |
|
|
schedule_id: this.course_id, |
|
|
// time_slot: this.courseInfo.time_slot, |
|
|
time_slot: this.courseInfo.time_slot, |
|
|
// course_date: this.courseInfo.course_date |
|
|
course_date: this.courseInfo.course_date |
|
|
// }) |
|
|
}) |
|
|
// if (res.code != 1) { |
|
|
if (res.code != 1) { |
|
|
// uni.showToast({ |
|
|
uni.showToast({ |
|
|
// title: res.msg, |
|
|
title: res.msg, |
|
|
// icon: 'none' |
|
|
icon: 'none' |
|
|
// }) |
|
|
}) |
|
|
// return |
|
|
return |
|
|
// } |
|
|
} |
|
|
// this.init() |
|
|
this.init() |
|
|
|
|
|
|
|
|
// 使用模拟数据,直接添加到学生列表中 |
|
|
// 使用模拟数据,直接添加到学生列表中 |
|
|
const selectedStudent = this.StudentList.find(student => student.value === e.value); |
|
|
// const selectedStudent = this.StudentList.find(student => student.value === e.value); |
|
|
if (!selectedStudent) return; |
|
|
// if (!selectedStudent) return; |
|
|
|
|
|
|
|
|
// 添加新学生到签到列表 |
|
|
// // 添加新学生到签到列表 |
|
|
if (!this.courseInfo.student_courses) { |
|
|
// if (!this.courseInfo.student_courses) { |
|
|
this.courseInfo.student_courses = []; |
|
|
// this.courseInfo.student_courses = []; |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
// 创建当前日期和未来日期(课程结束日期) |
|
|
// // 创建当前日期和未来日期(课程结束日期) |
|
|
const now = new Date(); |
|
|
// const now = new Date(); |
|
|
const futureDate = new Date(); |
|
|
// const futureDate = new Date(); |
|
|
futureDate.setMonth(futureDate.getMonth() + 3); // 设置为3个月后 |
|
|
// futureDate.setMonth(futureDate.getMonth() + 3); // 设置为3个月后 |
|
|
|
|
|
|
|
|
// 添加新学生 |
|
|
// // 添加新学生 |
|
|
this.courseInfo.student_courses.push({ |
|
|
// this.courseInfo.student_courses.push({ |
|
|
student_id: e.value, |
|
|
// student_id: e.value, |
|
|
name: selectedStudent.text, |
|
|
// name: selectedStudent.text, |
|
|
avatar: '', // 默认头像 |
|
|
// avatar: '', // 默认头像 |
|
|
start_date: now.toISOString().split('T')[0], |
|
|
// start_date: now.toISOString().split('T')[0], |
|
|
end_date: futureDate.toISOString().split('T')[0], |
|
|
// end_date: futureDate.toISOString().split('T')[0], |
|
|
status: 'pending' // 待上课状态 |
|
|
// status: 'pending' // 待上课状态 |
|
|
}); |
|
|
// }); |
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
// uni.showToast({ |
|
|
title: '添加学员成功', |
|
|
// title: '添加学员成功', |
|
|
icon: 'success' |
|
|
// icon: 'success' |
|
|
}); |
|
|
// }); |
|
|
}, |
|
|
}, |
|
|
cancel() { |
|
|
cancel() { |
|
|
this.show = false |
|
|
this.show = false |
|
|
|