Browse Source

refactor(student): 优化课表详情页面功能

- 修改详情按钮点击事件,添加跳转到课表详情页的功能
- 更新课表详情页布局,移除不必要的下拉菜单相关代码
- 添加课程ID参数传递,以便在详情页显示对应课程信息
-优化样式,使用 scoped 属性限制样式范围
master
liutong 2 years ago
parent
commit
ae9f961ea4
  1. 8
      pages/student/timetable/index.vue
  2. 77
      pages/student/timetable/info.vue

8
pages/student/timetable/index.vue

@ -64,7 +64,7 @@
<image src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image>
</view>
</view>
<view class="btn">
<view class="btn" @click="openViewTimetableInfo(v)">
详情
</view>
</view>
@ -249,10 +249,10 @@ export default {
//打开课时详情页
openViewCourseInfo(item){
//打开课表详情页
openViewTimetableInfo(item){
uni.navigateTo({
url: '/pages/student/timetable/info'
url: `/pages/student/timetable/info?id=${item.id}`
})
},
//体育馆列表

77
pages/student/timetable/info.vue

@ -49,7 +49,6 @@
<view>已上</view>
</view>
</view>
</view>
</view>
</view>
</view>
@ -67,75 +66,25 @@ export default {
data() {
return {
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'
}
],
//筛选条件
filteredData: {
id: '',//课程id
},
}
},
onLoad() {
onLoad(options) {
this.filteredData.id = options.id//课程id
},
onShow(){
this.init()
},
methods: {
//选中课程下拉菜单点击事件
clickCourse(e){
console.log(e)
this.course_name = e.text
this.show_course = true
},
//显示下拉菜单
filterTapCourse() {
//显示下拉框
this.$refs.ref_course.show()
this.show_course = true;
},
//初始化
async init(){
//选中课室
clickClassroom(e){
console.log(e)
this.classroom_name = e.text
this.show_classroom = true
},
//显示课室下拉菜单
filterTapClassroom() {
//显示下拉框
this.$refs.ref_classroom.show()
this.show_classroom = true;
},
//打开课时详情页
openViewCourseInfo(item){
uni.navigateTo({
@ -146,7 +95,7 @@ export default {
}
</script>
<style lang="less" >
<style lang="less" scoped>
.main_box{
background: #292929 ;

Loading…
Cancel
Save