From c7c79981b1deb9b7dfe61e5d7c6060fa39ee1b48 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Fri, 6 Jun 2025 10:49:41 +0800 Subject: [PATCH 01/23] =?UTF-8?q?feat(student):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E8=AF=BE=E7=A8=8B=E5=AE=89=E6=8E=92=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 apiRoute.js 中新增 xy_personCourseSchedule 方法获取学生课程安排列表 - 在学生首页中添加课程安排信息展示区域 - 实现获取学生课程安排数据并展示在首页的功能 - 优化课程安排信息的显示样式,包括日期、时间、地点和课程名称 --- api/apiRoute.js | 8 +++ pages/student/index/index.vue | 96 ++++++++++++++++++++++++----------- 2 files changed, 74 insertions(+), 30 deletions(-) diff --git a/api/apiRoute.js b/api/apiRoute.js index 8ed87fb..683688a 100644 --- a/api/apiRoute.js +++ b/api/apiRoute.js @@ -499,6 +499,14 @@ export default { }) }, + //学生端-学生课程安排-列表 + xy_personCourseSchedule(data = {}) { + let url = '/xy/personCourseSchedule' + return http.get(url, data).then(res => { + return res; + }) + }, + diff --git a/pages/student/index/index.vue b/pages/student/index/index.vue index 6e85635..063282f 100644 --- a/pages/student/index/index.vue +++ b/pages/student/index/index.vue @@ -49,17 +49,19 @@ 更多 - + 课程预告 - - - {{$util.formatToDateTime(memberIndexData.kcyg.date_time,'m-d')}} {{memberIndexData.kcyg.weekday}} {{memberIndexData.kcyg.time_slot[0]}}-{{memberIndexData.kcyg.time_slot[1]}} - {{memberIndexData.kcyg.address}} {{memberIndexData.kcyg.courses_name}} - - + + + + + {{$util.formatToDateTime(personCourseScheduleInfo.course_date,'m-d')}} {{personCourseScheduleInfo.time_slot}} + {{personCourseScheduleInfo.venue.venue_name}} {{personCourseScheduleInfo.course.course_name}}xxxx123123 + + + 详情 @@ -177,6 +179,10 @@ height:'0',//身高 weight:'0',//体重 },//体测报告详情 + + personCourseScheduleInfo:{ + id:'', + },//课程安排详情 } }, onLoad() { @@ -194,6 +200,7 @@ async init(){ await this.member_init() await this.getPhysicalTestList() + await this.getPersonCourseScheduleList() this.getMemberIndex() this.getList() this.getJobAssignmentsInfo() @@ -223,6 +230,30 @@ } }, + //学生端-学生课程安排-列表 + async getPersonCourseScheduleList(){ + let params = { + page: 1,//当前页码 + limit: 1,//每页返回数据条数 + total: 1,//数据总条数 + resources_id:this.member_info.id,//学生资源表id + } + let res = await apiRoute.xy_personCourseSchedule(params) + if(res.code != 1){ + uni.showToast({ + title: res.msg, + icon: 'none' + }) + } + + console.log('kc',res.data) + + let arr = res.data.data + if(arr.length){ + this.personCourseScheduleInfo = arr[0] + } + }, + async openViewHome_COPY(){ @@ -696,32 +727,37 @@ .upcomin-classes-div-con { display: flex; + justify-content: space-between; align-items: center; color: #fff; + padding: 0 40rpx; + .upcomin-classes-div-con-left { + width: 60rpx; + text-align: right; + } + .centre_box{ + display: flex; + align-items: center; + .upcomin-classes-div-con-centre { + margin: 0 20rpx; + width: 2rpx; + height: 60rpx; + background-color: #fff; + } + .centre{ + width:80%; + } + } + .upcomin-classes-div-con-right { + width: 100rpx; + height: 50rpx; + background-color: #32baa1; + text-align: center; + line-height: 50rpx; + border-radius: 50rpx; + } } - .upcomin-classes-div-con-left { - width: 60rpx; - margin-left: 80rpx; - text-align: right; - } - - .upcomin-classes-div-con-centre { - width: 2rpx; - height: 60rpx; - background-color: #fff; - margin-left: 25rpx; - } - - .upcomin-classes-div-con-right { - width: 100rpx; - height: 50rpx; - background-color: #32baa1; - text-align: center; - line-height: 50rpx; - border-radius: 50rpx; - margin-left: 80rpx; - } .after-class { background-color: #292929; From d133f69ed7f2e89b430c1a1ea77a4984f0b0500b Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Fri, 6 Jun 2025 15:48:35 +0800 Subject: [PATCH 02/23] =?UTF-8?q?feat(student):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E8=AF=BE=E7=A8=8B=E5=AE=89=E6=8E=92=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增学生课程安排详情接口和相关功能 - 重构课程安排详情页面,展示更详细的信息 - 添加请假和取消请假功能 - 优化页面跳转逻辑,增加状态传递 --- api/apiRoute.js | 19 ++++++ common/axios.js | 8 +-- pages/student/index/index.vue | 20 +++---- pages/student/login/login.vue | 4 +- pages/student/timetable/info.vue | 99 +++++++++++++++++++------------- 5 files changed, 92 insertions(+), 58 deletions(-) diff --git a/api/apiRoute.js b/api/apiRoute.js index 683688a..42da9c1 100644 --- a/api/apiRoute.js +++ b/api/apiRoute.js @@ -507,6 +507,25 @@ export default { }) }, + //学生端-学生课程安排-详情 + xy_personCourseScheduleInfo(data = {}) { + let url = '/xy/personCourseSchedule/info' + return http.get(url, data).then(res => { + return res; + }) + }, + + //学生端-学生课程安排-详情 + xy_personCourseScheduleEditStatus(data = {}) { + let url = '/xy/personCourseSchedule/editStatus' + return http.post(url, data).then(res => { + return res; + }) + }, + + + + diff --git a/common/axios.js b/common/axios.js index 5766b1f..7cf0f5e 100644 --- a/common/axios.js +++ b/common/axios.js @@ -37,7 +37,7 @@ export default { title:'加载中...' }) return new Promise((cback, reject) => { - console.log(Api_url + url) + console.log('请求地址',Api_url + url) uni.request({ url: Api_url + url, data: param, @@ -55,8 +55,8 @@ export default { if (res_code == 200) { if (res_codes == 401) { uni.navigateTo({ - url: '/pages/student/login/login' - }) + url: `/pages/student/login/login?res_codes=${res_codes}` + }) }else{ cback(res.data); } @@ -70,7 +70,7 @@ export default { } else { if (res_codes == 401) { uni.navigateTo({ - url: '/pages/student/login/login' + url: `/pages/student/login/login?res_codes=${res_codes}` }) } else { console.log('400/500', url, error, res) diff --git a/pages/student/index/index.vue b/pages/student/index/index.vue index 063282f..e09ee43 100644 --- a/pages/student/index/index.vue +++ b/pages/student/index/index.vue @@ -58,7 +58,7 @@ {{$util.formatToDateTime(personCourseScheduleInfo.course_date,'m-d')}} {{personCourseScheduleInfo.time_slot}} - {{personCourseScheduleInfo.venue.venue_name}} {{personCourseScheduleInfo.course.course_name}}xxxx123123 + {{personCourseScheduleInfo.courseScheduleHasOne.venue.venue_name}} {{personCourseScheduleInfo.courseScheduleHasOne.course.course_name}} @@ -135,7 +135,6 @@ }, data() { return { - inited: false, // 添加标记位控制 init 只执行一次 //上传接口地址 uploadApiUrl: ``, @@ -185,15 +184,9 @@ },//课程安排详情 } }, - onLoad() { - this.openViewHome()//检测首页是否正确跳转-不正确则进行重定向 - }, + onLoad() {}, onShow(){ - // 防止 onShow 触发后重复 init - if (!this.inited) { - this.init() - this.inited = true - } + this.init() }, methods: { //学生页面初始化 @@ -237,6 +230,7 @@ limit: 1,//每页返回数据条数 total: 1,//数据总条数 resources_id:this.member_info.id,//学生资源表id + status:'0',//状态0待上课1已上课2请假 } let res = await apiRoute.xy_personCourseSchedule(params) if(res.code != 1){ @@ -246,7 +240,7 @@ }) } - console.log('kc',res.data) + console.log('课程安排',res.data) let arr = res.data.data if(arr.length){ @@ -532,9 +526,9 @@ //跳转页面-打开课时详情 openViewTimetableInfo(item) { - let id = item.id + let person_course_schedule_id = item.id uni.navigateTo({ - url: `/pages/student/timetable/info?id=${id}` + url: `/pages/student/timetable/info?person_course_schedule_id=${person_course_schedule_id}` }) }, diff --git a/pages/student/login/login.vue b/pages/student/login/login.vue index efe201c..66ed1c5 100644 --- a/pages/student/login/login.vue +++ b/pages/student/login/login.vue @@ -103,7 +103,9 @@ export default { // uni.hideHomeButton() // console.log(uni.getStorageSync('um_id')) // 防止 onShow 触发后重复 init - if (!this.inited) { + + // let res_codes = options.res_codes || '' + if (!this.inited && !res_codes) { this.openViewHome() this.inited = true } diff --git a/pages/student/timetable/info.vue b/pages/student/timetable/info.vue index 4e1fea5..d35776c 100644 --- a/pages/student/timetable/info.vue +++ b/pages/student/timetable/info.vue @@ -3,55 +3,55 @@ - {{infoData.courses_name}} + {{infoData.courseScheduleHasOne.course.course_name}} 课程名称 - {{infoData.courses_name}} + {{infoData.courseScheduleHasOne.course.course_name}} - - 班级 - {{infoData.classes_name}} - + + + + 上课时间 - {{infoData.date_time}} {{infoData.time_slot.replace(',', '-')}} + {{infoData.courseScheduleHasOne.course_date}} {{infoData.courseScheduleHasOne.time_slot}} 上课地址 - {{infoData.address}} + {{infoData.courseScheduleHasOne.campus_name}} {{infoData.courseScheduleHasOne.venue.venue_name}} 教练 - {{infoData.staff_name}} + {{infoData.courseScheduleHasOne.coach.name}} 教练号码 - {{infoData.staff_phone}} + {{infoData.courseScheduleHasOne.coach.phone}} 扣除课时 - {{infoData.hour}}个课时 + {{infoData.courseScheduleHasOne.course.single_session_count}}个课时 - - + + 已上 - - - 请假 + + + 取消请假 - 取消请假 + 请假 @@ -61,11 +61,11 @@ 请假申请 - - - - - + + + + + @@ -74,6 +74,7 @@ diff --git a/pages/student/my/my_coach.vue b/pages/student/my/my_coach.vue new file mode 100644 index 0000000..aedc37f --- /dev/null +++ b/pages/student/my/my_coach.vue @@ -0,0 +1,211 @@ + + + + + + \ No newline at end of file From 6ff8d57bf649dd692fc035698a6d728dc579720c Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Tue, 10 Jun 2025 15:32:55 +0800 Subject: [PATCH 07/23] =?UTF-8?q?feat(api):=20=E6=B7=BB=E5=8A=A0=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E8=AF=BE=E7=A8=8B=E6=B6=88=E8=80=97=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=B9=B6=E5=AE=9E=E7=8E=B0=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 apiRoute.js 中添加 xy_personCourseScheduleGetStudentCourseUsageList 方法 - 实现学生端我的课程消耗页面,包括: - 获取当前登录学生信息 - 获取并展示学生课程消耗记录列表 - 优化页面样式,增加无数据提示 -调整列表项显示内容,如课程使用日期等 --- api/apiRoute.js | 10 ++++++ pages/student/my/lesson_consumption.vue | 47 +++++++++++++++++-------- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/api/apiRoute.js b/api/apiRoute.js index b326865..c6375ca 100644 --- a/api/apiRoute.js +++ b/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; + }) + }, + + diff --git a/pages/student/my/lesson_consumption.vue b/pages/student/my/lesson_consumption.vue index 6dca018..f48aa9b 100644 --- a/pages/student/my/lesson_consumption.vue +++ b/pages/student/my/lesson_consumption.vue @@ -2,27 +2,23 @@ \ No newline at end of file From 7be4dbaa1f3470292c4b30a335dcad394b558b59 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Wed, 11 Jun 2025 10:51:53 +0800 Subject: [PATCH 09/23] =?UTF-8?q?feat(student):=20=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E7=AB=AF=E5=A2=9E=E5=8A=A0=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 xy_assignmentSubmitObj 接口用于提交作业 - 修改作业上传逻辑,支持图片和视频上传 - 优化作业提交数据结构,增加学生资源 ID 和内容文本字段 - 调整作业列表页面样式,移除视频边框 --- api/apiRoute.js | 12 +++++++++++- pages/student/index/index.vue | 37 ++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/api/apiRoute.js b/api/apiRoute.js index 840c772..749a5a7 100644 --- a/api/apiRoute.js +++ b/api/apiRoute.js @@ -555,7 +555,7 @@ export default { }) }, - //学生端-- + //学生端-获取作业列表 xy_assignment(data = {}) { let url = '/xy/assignment' return http.get(url, data).then(res => { @@ -563,6 +563,16 @@ export default { }) }, + //学生端-提交作业 + xy_assignmentSubmitObj(data = {}) { + let url = '/xy/assignment/submitObj' + return http.get(url, data).then(res => { + return res; + }) + }, + + + diff --git a/pages/student/index/index.vue b/pages/student/index/index.vue index c5ac969..d8862b9 100644 --- a/pages/student/index/index.vue +++ b/pages/student/index/index.vue @@ -149,8 +149,8 @@ //上传接口地址 uploadApiUrl: ``, - uploadImageApiUrl: `${Api_url}/file/image`, - uploadVideoApiUrl: `${Api_url}/file/video`, + uploadImageApiUrl: `${Api_url}/memberUploadImage`,//图片上传接口 + uploadVideoApiUrl: `${Api_url}/memberUploadVideo`,//视频上传接口 member_info: {},//学生信息 @@ -386,15 +386,15 @@ // 上传作业 async submitJob(item) { - let type = item.content_type // 作业类型1图片2视频 + let type = item.content_type // 作业类型1图片2视频3文本 try { // 等待上传文件的返回结果 let uploadRes = await this.uploadFile(type) - // console.log('上传结果', uploadRes) + console.log('上传结果', uploadRes) // 检查上传结果 - if (!uploadRes.data.path) { + if (!uploadRes.data.url) { return } @@ -402,22 +402,28 @@ let data = { id: item.id, // 作业列表id student_file: uploadRes.data.path, // 附件 - student_file_type: type, // 作业类型1图片2视频 - student_content: '', // 内容 + resources_id:this.member_info.id, // 学生资源id + content_text:uploadRes.data.url } // 提交作业 await this.assignmentsSubmit(data) } catch (error) { console.error('上传或提交作业失败:', error) - alert('上传或提交作业失败') + //alert('上传或提交作业失败') + //提示 + uni.showToast({ + title: '上传或提交作业失败', + icon: 'none' + }) } }, -// 上传单文件(视频/图片) type=作业类型1图片2视频 +// 上传单文件(视频/图片) type=作业类型1图片2视频3文本 async uploadFile(type) { return new Promise((resolve, reject) => { if (type == 1) { + //图片作业 this.uploadApiUrl = this.uploadImageApiUrl uni.chooseImage({ count: 1, @@ -437,7 +443,8 @@ reject(error) } }) - } else { + } else if(type == 2){ + //视频作业 this.uploadApiUrl = this.uploadVideoApiUrl uni.chooseVideo({ count: 1, @@ -506,12 +513,11 @@ // 提交作业接口 async assignmentsSubmit(item) { let data = { - id: item.id, // 作业列表id - student_file: item.student_file, // 附件 - student_file_type: item.student_file_type, // 作业类型1图片2视频 - student_content: item.student_content, // 内容 + resources_id:item.resources_id, // 学生资源id + id:item.id, + content_text:item.content_text } - let res = await memberApi.assignmentsSubmit(data) + let res = await apiRoute.xy_assignmentSubmitObj(data) if (res.code != 1) { uni.showToast({ title: res.msg, @@ -832,7 +838,6 @@ margin-top: 20rpx; border-radius: 15rpx; .video{ - border: 1px solid red; width: 100%; border-radius: 15rpx; } From db53cbe471060f6c927ddddaeae1ab90a3ba7cff Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Wed, 11 Jun 2025 10:53:39 +0800 Subject: [PATCH 10/23] =?UTF-8?q?refactor(student):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E9=A6=96=E9=A1=B5=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了未使用的 memberIndexData 对象 - 删除了冗余的 getMemberIndex 方法 - 简化了页面初始化逻辑 --- pages/student/index/index.vue | 69 ----------------------------------- 1 file changed, 69 deletions(-) diff --git a/pages/student/index/index.vue b/pages/student/index/index.vue index d8862b9..09eaf39 100644 --- a/pages/student/index/index.vue +++ b/pages/student/index/index.vue @@ -157,24 +157,6 @@ assignmentsList: [],//作业列表 jobAssignmentsInfo: [],//待完成的作业 - memberIndexData:{ - tx:{//体测信息 - height: '', // 身高(单位:米) - weight: '', // 体重(单位:公斤) - score: '', // 综合评分 - create_time: '' // 体测时间 - }, - kcyg: { // 课程预告信息 - id: '', // 课程ID - date_time: "", // 课程日期 - time_slot: "", // 课程时间段 - address: "", // 课程地点 - courses_name: "", // 课程名称 - date_md: "", // 课程日期(月/日格式) - weekday: "" // 课程星期 - } - },//首页数据 - path_arr:{ '1':'/pages/coach/home/index',//教练 '2':'/pages/market/index/index',//销售 @@ -205,7 +187,6 @@ await this.member_init() await this.getPhysicalTestList() await this.getPersonCourseScheduleList() - this.getMemberIndex() this.getList() this.getJobAssignmentsInfo() }, @@ -259,56 +240,6 @@ } }, - - - async openViewHome_COPY(){ - //获取当前页面路径 - let pages = getCurrentPages(); - //当前页面路径 - this.thisPath = '/' + pages[0].route - //获取缓存用户登陆类型 - let userType = String(uni.getStorageSync('userType')) - - this.openPath = this.path_arr[userType] - - console.log( - '跳转', - this.thisPath, - userType, - this.path_arr[userType] - ) - if(this.thisPath != this.openPath){ - console.log('打印1') - //跳转tabBar首页-页面 - uni.setStorageSync('tabBerIndex', 0) - uni.navigateTo({ - url: this.openPath - }) - return - }else{ - //页面正确的情况下->执行学生页面初始化 - this.init() - } - }, - - async getMemberIndex(){ - let res = await memberApi.memberIndex({}) - if(res.code != 1){ - uni.showToast({ - title: res.msg, - icon: 'none' - }) - return - } - // console.log('首页',res) - - if(res.data.kcyg.time_slot){ - res.data.kcyg.time_slot = res.data.kcyg.time_slot.split(','); - } - - this.memberIndexData = res.data - }, - //获取作业列表 async getList(){ let data = { From 5cd4d54d90cad0a03df68a37fb4f613d21fbc9fb Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Wed, 11 Jun 2025 12:01:17 +0800 Subject: [PATCH 11/23] =?UTF-8?q?refactor(student):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新数据结构和 API 调用 -优化作业列表的展示逻辑 - 添加学生信息获取功能 -调整作业状态的显示方式 - 优化页面样式,支持文本、图片和视频的动态显示 --- pages/student/index/job_list.vue | 45 +++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/pages/student/index/job_list.vue b/pages/student/index/job_list.vue index e46ba6e..c334388 100644 --- a/pages/student/index/job_list.vue +++ b/pages/student/index/job_list.vue @@ -13,24 +13,25 @@ > - - - + + + + {{v.content_text}} - 时间:{{v.create_time}} + 时间:{{v.created_at}} - + - + {{v.type == 1 ? '班级作业' : '个人作业'}} @@ -44,6 +45,7 @@