hookehuyr

feat(teacher): 在签到页面日期显示中添加星期几信息

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-12-14 01:33:55 4 + * @LastEditTime: 2025-12-14 22:37:25
5 * @FilePath: /mlaj/src/views/teacher/checkinPage.vue 5 * @FilePath: /mlaj/src/views/teacher/checkinPage.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 <div class="bg-white px-4 py-3 flex items-center justify-between border-b border-gray-100 cursor-pointer" @click="showCalendar = true"> 21 <div class="bg-white px-4 py-3 flex items-center justify-between border-b border-gray-100 cursor-pointer" @click="showCalendar = true">
22 <div class="flex items-center gap-2"> 22 <div class="flex items-center gap-2">
23 <van-icon name="calendar-o" class="text-xl" color="#4caf50" /> 23 <van-icon name="calendar-o" class="text-xl" color="#4caf50" />
24 - <span style="color: #4caf50;" class="text-base font-bold">{{ formattedSelectedDate }}</span> 24 + <span style="color: #4caf50;" class="text-base font-bold">{{ formattedSelectedDate }} {{ formattedWeekday }}</span>
25 </div> 25 </div>
26 <div class="flex items-center text-gray-400 text-sm"> 26 <div class="flex items-center text-gray-400 text-sm">
27 <span>切换日期</span> 27 <span>切换日期</span>
...@@ -172,6 +172,12 @@ const formattedSelectedDate = computed(() => { ...@@ -172,6 +172,12 @@ const formattedSelectedDate = computed(() => {
172 return dayjs(selectedDate.value).format('YYYY年MM月DD日'); 172 return dayjs(selectedDate.value).format('YYYY年MM月DD日');
173 }); 173 });
174 174
175 +// 计算属性:格式化星期几显示
176 +const formattedWeekday = computed(() => {
177 + const weekdays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
178 + return weekdays[dayjs(selectedDate.value).day()]
179 +})
180 +
175 /** 181 /**
176 * 重置分页参数并重新加载数据 182 * 重置分页参数并重新加载数据
177 */ 183 */
......