hookehuyr

fix(booking): 修复日期选择逻辑和周历显示不全的问题

修复日期选择时未检查date存在导致的潜在错误
补全周历显示不足7天时的空日期项
<!--
* @Date: 2024-01-15 13:35:51
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-07 23:18:29
* @LastEditTime: 2026-01-13 14:15:29
* @FilePath: /xyxBooking-weapp/src/pages/booking/index.vue
* @Description: 预约页面
-->
......@@ -21,8 +21,8 @@
<view v-for="(date, dateIndex) in week" :key="dateIndex"
@tap="chooseDay(date)"
:class="[ 'item',
checked_day === findDatesInfo(date).date ? 'checked' : '',
findDatesInfo(date).reserve_full === ReserveStatus.FULL || findDatesInfo(date).reserve_full === ReserveStatus.OVERDUE ? 'disabled' : ''
date && checked_day === findDatesInfo(date).date ? 'checked' : '',
date && (findDatesInfo(date).reserve_full === ReserveStatus.FULL || findDatesInfo(date).reserve_full === ReserveStatus.OVERDUE) ? 'disabled' : ''
]"
>
<view v-if="findDatesInfo(date).date">
......@@ -188,6 +188,9 @@ const weeks = computed(() => {
// 添加最后一行
if (currentWeek.length > 0) {
while (currentWeek.length < 7) {
currentWeek.push('');
}
result.push(currentWeek);
}
......