feat(签到): 更新签到日期并添加今日选中样式
- 将签到日期从[1,3,5,7]改为[1,2]
- 为当前日期添加'calendar-today'样式并自动选中
- 在课程页面添加签到入口点击事件
```
这个提交消息:
1. 使用feat类型表示新增功能
2. 添加了(签到)范围明确修改领域
3. 简洁描述了三个主要变更点
4. 使用中文符合要求
5. 每个变更点用短横线列出,保持简洁清晰
6. 避免了重复信息
7. 使用祈使语气("更新"、"添加")
Showing
2 changed files
with
12 additions
and
3 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-05-29 15:34:17 | 2 | * @Date: 2025-05-29 15:34:17 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-06-03 15:43:39 | 4 | + * @LastEditTime: 2025-06-03 16:07:54 |
| 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue | 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -475,7 +475,7 @@ const formatter = (day) => { | ... | @@ -475,7 +475,7 @@ const formatter = (day) => { |
| 475 | const month = day.date.getMonth() + 1; | 475 | const month = day.date.getMonth() + 1; |
| 476 | const date = day.date.getDate(); | 476 | const date = day.date.getDate(); |
| 477 | 477 | ||
| 478 | - let checkin_days = [1, 3, 5, 7]; | 478 | + let checkin_days = [1, 2]; |
| 479 | 479 | ||
| 480 | if (month === 6) { | 480 | if (month === 6) { |
| 481 | if (checkin_days.includes(date)) { | 481 | if (checkin_days.includes(date)) { |
| ... | @@ -483,6 +483,11 @@ const formatter = (day) => { | ... | @@ -483,6 +483,11 @@ const formatter = (day) => { |
| 483 | day.type = 'selected'; | 483 | day.type = 'selected'; |
| 484 | } | 484 | } |
| 485 | } | 485 | } |
| 486 | + // 选中今天的日期 | ||
| 487 | + if (dayjs(day.date).isSame(new Date(), 'day')) { | ||
| 488 | + day.className = 'calendar-today'; | ||
| 489 | + day.type ='selected'; | ||
| 490 | + } | ||
| 486 | 491 | ||
| 487 | return day; | 492 | return day; |
| 488 | } | 493 | } | ... | ... |
| ... | @@ -98,7 +98,7 @@ | ... | @@ -98,7 +98,7 @@ |
| 98 | <!-- 互动区域 --> | 98 | <!-- 互动区域 --> |
| 99 | <div id="interaction" class="py-4 px-4"> | 99 | <div id="interaction" class="py-4 px-4"> |
| 100 | <div class="bg-white rounded-lg p-4 mb-4 cursor-pointer"> | 100 | <div class="bg-white rounded-lg p-4 mb-4 cursor-pointer"> |
| 101 | - <div class="flex items-center justify-between"> | 101 | + <div class="flex items-center justify-between" @click="goToCheckin()"> |
| 102 | <div class="flex items-center gap-3"> | 102 | <div class="flex items-center gap-3"> |
| 103 | <van-icon size="3rem" name="calendar-o" class="text-xl text-gray-600" /> | 103 | <van-icon size="3rem" name="calendar-o" class="text-xl text-gray-600" /> |
| 104 | <div> | 104 | <div> |
| ... | @@ -321,6 +321,10 @@ const handleTabChange = (name) => { | ... | @@ -321,6 +321,10 @@ const handleTabChange = (name) => { |
| 321 | const goToStudyDetail = (lessonId) => { | 321 | const goToStudyDetail = (lessonId) => { |
| 322 | router.push(`/studyDetail/${lessonId}`); | 322 | router.push(`/studyDetail/${lessonId}`); |
| 323 | }; | 323 | }; |
| 324 | + | ||
| 325 | +const goToCheckin = () => { | ||
| 326 | + router.push(`/checkin/index?course_id=${course.value.id}`); | ||
| 327 | +}; | ||
| 324 | </script> | 328 | </script> |
| 325 | 329 | ||
| 326 | <style scoped> | 330 | <style scoped> | ... | ... |
-
Please register or login to post a comment