From d26a8fb38fc8cbcc70f39c095ffd3f33e1874604 Mon Sep 17 00:00:00 2001 From: ywyonui Date: Mon, 29 Sep 2025 22:42:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/base/class-schedule/index.vue | 57 ++++++++++++++++++------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/src/pages/base/class-schedule/index.vue b/src/pages/base/class-schedule/index.vue index e8c3833..1a400b9 100644 --- a/src/pages/base/class-schedule/index.vue +++ b/src/pages/base/class-schedule/index.vue @@ -5,15 +5,18 @@ - + {{ day.zjmc }} {{ day.rqmc }} + + 本周处于节假日中,无课程信息 + - + {{ sj.mc }} @@ -88,7 +91,14 @@ const curRqIndex = ref(0) // 周次列表 const zcList = ref([]) // 日期列表 -const rqList = ref([]) +const rqList = computed(() => { + if (!curZc.value || !curZc.value.drList || !curZc.value.drList.length) { + return []; + } + return curZc.value.drList.filter((dr: any) => { + return (!dr.holiday && dr.zj <= 5) || (dr.holiday && dr.holiday.type != 2); + }); +}); // 时间列表 const sjList = ref([]) @@ -98,10 +108,8 @@ const isLoading = ref(false); const showWeekPicker = ref(false); const weekPopup = ref(null); -const selectedWeekNumber = ref(0); const targetScrollTop = ref(0); // 新增:用于绑定 scroll-top - // 打开周选择弹窗 const openWeekPicker = async () => { showWeekPicker.value = true; @@ -137,7 +145,6 @@ const selectWeek = (zc: any) => { } // 复制 Object.assign(curZc.value, zc); - Object.assign(rqList.value, curZc.value.drList); // 关闭弹窗 closeWeekPicker(); @@ -152,13 +159,21 @@ const selectDay = (index: number) => { if (!rqList.value.length) { return; } - drpkkbApi({ + const params = { jsId: "", bjId: getCurXs.bjId, xqId: xqId, rq: rqList.value[index].rq, // 用于查询代课信息 - zj: rqList.value[index].zj - }).then(res => { + zj: rqList.value[index].zj, + txDate: null + }; + if (params.zj > 5) { + const holiday = rqList.value[index].holiday || {}; + if (holiday && holiday.type === 3 && holiday.txDate) { + params.txDate = holiday.txDate; + } + } + drpkkbApi(params).then(res => { // 根据接口返回的result判断是否已报名 if (res && res.resultCode === 1) { sjList.value = res.result; @@ -185,10 +200,10 @@ const getCourseColorClass = (subject: string | undefined): string => { onMounted(async () => { const res = await dqpkApi(); const result = res.result; - dqZc = res.result.dqZc; - xqId = res.result.dqXq.id; + dqZc = res.result.zc; + xqId = res.result.xq.id; zcList.value = result.zcList; - sjList.value = result.sjList; + sjList.value = []; // 按当前日期定位到对应的周次和星期几 const today = dayjs(); @@ -235,6 +250,7 @@ onMounted(async () => { display: flex; background-color: #4477ee; padding: 10px 15px 15px 15px; + overflow-x: auto; gap: 10px; .date-tab-item { @@ -242,12 +258,13 @@ onMounted(async () => { flex-direction: column; align-items: center; justify-content: center; - padding: 8px 5px; - border-radius: 6px; + padding: 16rpx 10rpx; + border-radius: 12rpx; background-color: rgba(255, 255, 255, 0.1); color: #ffffff; flex: 1; - min-width: 50px; + min-width: 100rpx; + max-width: 118rpx; cursor: pointer; transition: background-color 0.2s ease; @@ -476,4 +493,14 @@ onMounted(async () => { } } } + +.no-course-notice { + margin: 15px; + background-color: #fff; + border-radius: 8px; + padding: 50px 15px; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); + text-align: center; +} +