From 7707ea3eb752ed4243bf1c39816a91696feaeb3e Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Tue, 10 Jun 2025 13:09:46 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat(student):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=88=91=E7=9A=84=E6=95=99=E7=BB=83=E5=8A=9F=E8=83=BD-=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=88=91=E7=9A=84=E6=95=99=E7=BB=83=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=B1=95=E7=A4=BA=E5=AD=A6=E7=94=9F=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E6=95=99=E7=BB=83=E5=88=97=E8=A1=A8=20-=20?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=95=99=E7=BB=83=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8A=A0=E8=BD=BD=E5=92=8C=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91-=20=E6=B7=BB=E5=8A=A0=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E6=88=91=E7=9A=84=E6=95=99=E7=BB=83=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD=20-=20=E6=9B=B4=E6=96=B0=20API=20?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=95=99=E7=BB=83=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/apiRoute.js | 7 ++ pages.json | 9 ++ pages/student/login/login.vue | 4 +- pages/student/my/my.vue | 9 +- pages/student/my/my_coach.vue | 211 ++++++++++++++++++++++++++++++++++ 5 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 pages/student/my/my_coach.vue diff --git a/api/apiRoute.js b/api/apiRoute.js index 90fc535..b326865 100644 --- a/api/apiRoute.js +++ b/api/apiRoute.js @@ -538,6 +538,13 @@ export default { return res; }) }, + //学生端-学生课程安排-获取学生排课的全部场地列表 + xy_personCourseScheduleGetMyCoach(data = {}) { + let url = '/xy/personCourseSchedule/getMyCoach' + return http.get(url, data).then(res => { + return res; + }) + }, diff --git a/pages.json b/pages.json index e4795b8..063c1d3 100644 --- a/pages.json +++ b/pages.json @@ -36,6 +36,15 @@ "navigationBarTextStyle": "white" } }, + { + "path": "pages/student/my/my_coach", + "style": { + "navigationBarTitleText": "我的教练", + "navigationStyle": "default", + "navigationBarBackgroundColor": "#29d3b4", + "navigationBarTextStyle": "white" + } + }, { "path": "pages/student/login/forgot", diff --git a/pages/student/login/login.vue b/pages/student/login/login.vue index e803674..84c408c 100644 --- a/pages/student/login/login.vue +++ b/pages/student/login/login.vue @@ -277,8 +277,8 @@ export default { this.password1= '123123' //密码 }else{ //学生端 - this.user= '15335526445' //账户 - this.password1= '123123' //密码 + this.user= '13042409890' //账户 + this.password1= '13042409890' //密码 } }, diff --git a/pages/student/my/my.vue b/pages/student/my/my.vue index 3c65ac9..ce10eae 100644 --- a/pages/student/my/my.vue +++ b/pages/student/my/my.vue @@ -64,7 +64,7 @@ - 我的教练 + 我的教练 @@ -160,6 +160,13 @@ url: `/pages/common/my_message` }) }, + + //跳转页面-我的教练 + openViewMyCoach(){ + uni.navigateTo({ + url: `/pages/student/my/my_coach` + }) + }, } } 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 2/6] =?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 4/6] =?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 5/6] =?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 6/6] =?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 @@