hookehuyr

feat(签到): 更新签到日期并添加今日选中样式

- 将签到日期从[1,3,5,7]改为[1,2]
- 为当前日期添加'calendar-today'样式并自动选中
- 在课程页面添加签到入口点击事件
```

这个提交消息:
1. 使用feat类型表示新增功能
2. 添加了(签到)范围明确修改领域
3. 简洁描述了三个主要变更点
4. 使用中文符合要求
5. 每个变更点用短横线列出,保持简洁清晰
6. 避免了重复信息
7. 使用祈使语气("更新"、"添加")
<!--
* @Date: 2025-05-29 15:34:17
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-06-03 15:43:39
* @LastEditTime: 2025-06-03 16:07:54
* @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue
* @Description: 文件描述
-->
......@@ -475,7 +475,7 @@ const formatter = (day) => {
const month = day.date.getMonth() + 1;
const date = day.date.getDate();
let checkin_days = [1, 3, 5, 7];
let checkin_days = [1, 2];
if (month === 6) {
if (checkin_days.includes(date)) {
......@@ -483,6 +483,11 @@ const formatter = (day) => {
day.type = 'selected';
}
}
// 选中今天的日期
if (dayjs(day.date).isSame(new Date(), 'day')) {
day.className = 'calendar-today';
day.type ='selected';
}
return day;
}
......
......@@ -98,7 +98,7 @@
<!-- 互动区域 -->
<div id="interaction" class="py-4 px-4">
<div class="bg-white rounded-lg p-4 mb-4 cursor-pointer">
<div class="flex items-center justify-between">
<div class="flex items-center justify-between" @click="goToCheckin()">
<div class="flex items-center gap-3">
<van-icon size="3rem" name="calendar-o" class="text-xl text-gray-600" />
<div>
......@@ -321,6 +321,10 @@ const handleTabChange = (name) => {
const goToStudyDetail = (lessonId) => {
router.push(`/studyDetail/${lessonId}`);
};
const goToCheckin = () => {
router.push(`/checkin/index?course_id=${course.value.id}`);
};
</script>
<style scoped>
......