diff --git a/src/pages/base/club/index.vue b/src/pages/base/club/index.vue index 328271e..ddaea17 100644 --- a/src/pages/base/club/index.vue +++ b/src/pages/base/club/index.vue @@ -3,343 +3,37 @@ - - - {{ xkData.xkmc }} - 选课信息 - - 切换 - + + - - - - - - {{ curXs.xm }} - {{ curXs.njmc }} {{ curXs.bjmc }} - - 切换 - + - - - - {{ course.kcmc }} - - 上课人数: - {{ course.ybmr }} - - 详情 - - - - - - - - - - - - 暂无课程数据 - + - - - - - - - 选择学生 - - - - - - - - - {{ xs.xm }} - {{ xs.njmc }} {{ xs.bjmc }} - - - - - - - - - - - - - - 选择俱乐部 - - - - - - {{ xk.xkmc }} - - - - - - - \ No newline at end of file diff --git a/src/pages/base/components/XkPicker/index.vue b/src/pages/base/components/XkPicker/index.vue index 2ea5272..9976bb9 100644 --- a/src/pages/base/components/XkPicker/index.vue +++ b/src/pages/base/components/XkPicker/index.vue @@ -3,7 +3,7 @@ {{ curXk.xkmc }} - 选课信息 + {{ title }} 切换 @@ -31,15 +31,17 @@ + + \ No newline at end of file diff --git a/src/pages/base/components/XsPicker/index.vue b/src/pages/base/components/XsPicker/index.vue index ca4c860..50c3cd8 100644 --- a/src/pages/base/components/XsPicker/index.vue +++ b/src/pages/base/components/XsPicker/index.vue @@ -94,7 +94,7 @@ const switchXs = (xs: any) => { } // 如果是bar形式,则默认打开选择器 -if (props.isBar && getUser.xsList.length > 1) { +if (props.isBar && getUser.xsList.length > 1 && (getCurXs === null || !getCurXs.id)) { showPicker(); } diff --git a/src/pages/base/course-selection/club-selection.vue b/src/pages/base/course-selection/club-selection.vue index b324946..d5c9486 100644 --- a/src/pages/base/course-selection/club-selection.vue +++ b/src/pages/base/course-selection/club-selection.vue @@ -4,51 +4,26 @@ - + - + - - - - {{ course.kcmc }} - - 上课人数: - {{ course.ybmr }} - - 详情 - - - - - - - - - - - - 暂无课程数据 - + + + + + 已选 {{ selectedXkkcIds.length }} 门课程 + + 点击报名 + @@ -56,18 +31,14 @@ import XsPicker from "@/pages/base/components/XsPicker/index.vue" import XkPicker from "@/pages/base/components/XkPicker/index.vue" import XkCountdown from "@/pages/base/components/XkCountdown/index.vue" +import XkkcList from "@/pages/base/components/XkkcList/index.vue" import { useUserStore } from "@/store/modules/user"; -import { useDataStore } from "@/store/modules/data"; const { getCurXs } = useUserStore(); -const { setKcData } = useDataStore(); const curXs = computed(() => getCurXs); - -const curXk = ref(); -const kcStatus = ref(false); - -const courseInfo = ref({}); +const curXk = ref({}); +const selectedXkkcIds = ref([]); // 切换选课 const switchXk = (xk: any) => { curXk.value = xk; @@ -78,63 +49,17 @@ const xkTimeOver = (val: any) => { console.log(val); } -// 从课程数据中提取课程列表 -const displayCourseList = computed(() => { - if ( - !curXk.value || - !curXk.value.xkkcs || - !Array.isArray(curXk.value.xkkcs) - ) { - return []; - } +// 选中课程 +const changeXkkc = (ids: any) => { + console.log(ids); + selectedXkkcIds.value = ids; +} - // 获取本地存储的已选课程ID数组 - const selectedCourseIds = uni.getStorageSync("selectedCourseIds") || []; +// 提交选课 +const submit = () => { + console.log(selectedXkkcIds.value); +} - // 为课程添加选中状态属性 - return curXk.value.xkkcs.map((course: any) => ({ - ...course, - isSelected: selectedCourseIds.includes(course.id), - })); -}); - -// 可修改的课程列表数据 -const courseListData = ref([]); - -// 计算已选择的课程数量 -const selectedCoursesCount = computed(() => { - return courseListData.value.filter((course: any) => course.isSelected).length; -}); - -// 监听计算属性变化,更新可修改的数据 -watch( - displayCourseList, - (newVal) => { - courseListData.value = JSON.parse(JSON.stringify(newVal)); - - // 初始化时,将已选课程的全部信息存入courseInfo - const selectedCourseIds = uni.getStorageSync("selectedCourseIds") || []; - if (selectedCourseIds.length > 0) { - const selectedCourses = newVal.filter((course: any) => - selectedCourseIds.includes(course.id) - ); - courseInfo.value = selectedCourses; - } - }, - { immediate: true } -); - -// 查看课程详情 -const viewCourseDetail = (course: any) => { - setKcData(course); - uni.navigateTo({ - url: `/pages/base/course-selection/detail`, - }); -}; - -// 页面卸载前清除定时器 -onBeforeUnmount(() => { -}); diff --git a/src/pages/base/course-selection/index.vue b/src/pages/base/course-selection/index.vue index 860a208..2fa3405 100644 --- a/src/pages/base/course-selection/index.vue +++ b/src/pages/base/course-selection/index.vue @@ -3,706 +3,63 @@ - - - {{ kcData.xkmc }} - 选课信息 - - - + + - - - - - - {{ currentStudent.xm }} - {{ currentStudent.njmc }} {{ currentStudent.bjmc }} - - 切换 - - - - - + + + - - - - {{ course.kcmc }} - - 报名情况: - {{ course.ybmr }} - | {{ course.maxNum }} - - 详情 - - - - - - - - - - - - 暂无课程数据 - + - + - 点击报名 + + 已选 {{ selectedXkkcIds.length }} 门课程 + + 点击报名 - - - - - - - 选择学生 - - - - - - - - - {{ student.xm }} - {{ student.njmc }} {{ student.bjmc }} - - - - - - - - + diff --git a/src/pages/base/interest-class/index.vue b/src/pages/base/interest-class/index.vue index b0e9b18..72b2675 100644 --- a/src/pages/base/interest-class/index.vue +++ b/src/pages/base/interest-class/index.vue @@ -3,308 +3,37 @@ - - - {{ xkData.xkmc }} - 选课信息 - - - + + - - - - - - {{ currentStudent.xm }} - {{ currentStudent.njmc }} {{ currentStudent.bjmc }} - - 切换 - + - - - - {{ course.kcmc }} - - 上课人数: - {{ course.ybmr }} - - 详情 - - - - - - - - - - - - 暂无课程数据 - + - - - - - - - 选择学生 - - - - - - - - - {{ student.xm }} - {{ student.njmc }} {{ student.bjmc }} - - - - - - - - + +