From beea94ac66806d18be27ddf90fe1518899f58ca9 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Wed, 12 Mar 2025 11:20:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(coach):=20=E9=87=8D=E6=9E=84=E6=95=99?= =?UTF-8?q?=E7=BB=83=E7=AB=AF=E8=AF=BE=E7=A8=8B=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重新设计了课程详情页面的布局和样式,使其更加简洁明了- 添加了课程名称、班级、上课时间、上课地址等详细信息 - 增加了教练信息和扣除课时的展示- 优化了页面结构,提高了用户体验 - 调整了导航栏样式,与整体页面风格保持一致 --- pages.json | 4 +- pages/coach/course/info.vue | 560 ++++++++++-------------------------- pages/coach/course/list.vue | 17 +- 3 files changed, 164 insertions(+), 417 deletions(-) diff --git a/pages.json b/pages.json index dbaee0d..eca371e 100644 --- a/pages.json +++ b/pages.json @@ -90,8 +90,8 @@ "style": { "navigationBarTitleText": "课时详情", "navigationStyle": "default", - "navigationBarBackgroundColor": "#fff", - "navigationBarTextStyle": "black" + "navigationBarBackgroundColor": "#292929", + "navigationBarTextStyle": "white" } } diff --git a/pages/coach/course/info.vue b/pages/coach/course/info.vue index e862b56..16861ea 100644 --- a/pages/coach/course/info.vue +++ b/pages/coach/course/info.vue @@ -1,169 +1,57 @@ @@ -178,296 +66,162 @@ export default { }, data() { return { - list: [], - likes: 0, - type: 1, - type1: 1, - activity_id: 0, - um_id: 0, - urls: 'http://medication.zeyan.wang/' + formData:{}, + + //课程下拉菜单相关 + show_course:false,//是否显示下拉菜单 + //课程下拉菜单 + course_name:'课程',//选中的下拉菜单名称 + options_course: [ + { + text: '请选择课程', + value: '', + checked: true + }, { + text: '羽毛球课程1', + value: '1' + }, { + text: '篮球课程2', + value: '2' + } + ], + + //课室下拉菜单相关 + show_classroom:false,//是否显示下拉菜单 + //课程下拉菜单 + classroom_name:'课室',//选中的下拉菜单名称 + options_classroom: [ + { + text: '请选择课室', + value: '', + checked: true + }, { + text: '羽毛球201', + value: '1' + }, { + text: '篮球室101', + value: '2' + } + ], } }, onLoad() { - const um_id = uni.getStorageSync('um_id'); - this.um_id = um_id - if (um_id == '') { - uni.navigateTo({ - url: '/pages/login/login' - }) - } - this.fetchData(this.um_id) }, methods: { - - //打开-发布作业页 - openObjListView(){ - uni.navigateTo({ - url: '/pages/coach/job/add' - }) + //选中课程下拉菜单点击事件 + clickCourse(e){ + console.log(e) + this.course_name = e.text + this.show_course = true }, - - //打开作业列表页 - openObjListView(){ - uni.navigateTo({ - url: '/pages/coach/job/list' - }) + //显示下拉菜单 + filterTapCourse() { + //显示下拉框 + this.$refs.ref_course.show() + this.show_course = true; }, - fetchData(um_id) { - user.activity_index({ - um_id: um_id - }).then(res => { - console.log(res) - if (res.status == 200) { - if (res.data == null) { - this.list = [] - } else { - this.list = res.data - } - } else { - uni.showToast({ - title: res.msg, - icon: 'none' - }) - } - }); - }, - onPullDownRefresh() { - this.fetchData(this.um_id) - }, - publishing() { - uni.navigateTo({ - url: '/pages/index/publishing' - }) - }, - like(id, um_id) { - user.activity_like({um_id: um_id, activity_id: id, type: 1}).then(res => { - if (res.status == 200) { - user.activity_index({ - um_id: um_id - }).then(res => { - console.log(res) - if (res.status == 200) { - this.list = res.data - } - }); - this.type = res.data.type - this.activity_id = res.data.activity_id - } else { - uni.showToast({ - title: res.msg, - icon: 'none' - }) - } - }); + + + //选中课室 + clickClassroom(e){ + console.log(e) + this.classroom_name = e.text + this.show_classroom = true }, - collection(id, um_id) { - user.activity_like({um_id: um_id, activity_id: id, type: 2}).then(res => { - if (res.status == 200) { - console.log(res) - this.fetchData(this.um_id) - this.type1 = res.data.type - this.activity_id = res.data.activity_id - } else { - uni.showToast({ - title: res.msg, - icon: 'none' - }) - } - }); + //显示课室下拉菜单 + filterTapClassroom() { + //显示下拉框 + this.$refs.ref_classroom.show() + this.show_classroom = true; }, - coninfo(item) { - // user.coninfo({id:id}).then(res => { - // if(res.status == 200){ - uni.setStorageSync('coninfo', item); + + //打开课时详情页 + openViewCourseInfo(item){ uni.navigateTo({ - url: '/pages/index/coninfo' + url: '/pages/coach/course/info' }) - // }else{ - // uni.showToast({ - // title: res.msg, - // icon: 'none' - // }) - // } - // }); }, - Comment(id) { - uni.setStorageSync('actid', id); - uni.navigateTo({ - url: '/pages/index/Comment' - }) - } } }