fix(booking): 修复日期选择逻辑和周历显示不全的问题
修复日期选择时未检查date存在导致的潜在错误 补全周历显示不足7天时的空日期项
Showing
1 changed file
with
6 additions
and
3 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-01-15 13:35:51 | 2 | * @Date: 2024-01-15 13:35:51 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2026-01-07 23:18:29 | 4 | + * @LastEditTime: 2026-01-13 14:15:29 |
| 5 | * @FilePath: /xyxBooking-weapp/src/pages/booking/index.vue | 5 | * @FilePath: /xyxBooking-weapp/src/pages/booking/index.vue |
| 6 | * @Description: 预约页面 | 6 | * @Description: 预约页面 |
| 7 | --> | 7 | --> |
| ... | @@ -21,8 +21,8 @@ | ... | @@ -21,8 +21,8 @@ |
| 21 | <view v-for="(date, dateIndex) in week" :key="dateIndex" | 21 | <view v-for="(date, dateIndex) in week" :key="dateIndex" |
| 22 | @tap="chooseDay(date)" | 22 | @tap="chooseDay(date)" |
| 23 | :class="[ 'item', | 23 | :class="[ 'item', |
| 24 | - checked_day === findDatesInfo(date).date ? 'checked' : '', | 24 | + date && checked_day === findDatesInfo(date).date ? 'checked' : '', |
| 25 | - findDatesInfo(date).reserve_full === ReserveStatus.FULL || findDatesInfo(date).reserve_full === ReserveStatus.OVERDUE ? 'disabled' : '' | 25 | + date && (findDatesInfo(date).reserve_full === ReserveStatus.FULL || findDatesInfo(date).reserve_full === ReserveStatus.OVERDUE) ? 'disabled' : '' |
| 26 | ]" | 26 | ]" |
| 27 | > | 27 | > |
| 28 | <view v-if="findDatesInfo(date).date"> | 28 | <view v-if="findDatesInfo(date).date"> |
| ... | @@ -188,6 +188,9 @@ const weeks = computed(() => { | ... | @@ -188,6 +188,9 @@ const weeks = computed(() => { |
| 188 | 188 | ||
| 189 | // 添加最后一行 | 189 | // 添加最后一行 |
| 190 | if (currentWeek.length > 0) { | 190 | if (currentWeek.length > 0) { |
| 191 | + while (currentWeek.length < 7) { | ||
| 192 | + currentWeek.push(''); | ||
| 193 | + } | ||
| 191 | result.push(currentWeek); | 194 | result.push(currentWeek); |
| 192 | } | 195 | } |
| 193 | 196 | ... | ... |
-
Please register or login to post a comment