docs(api): 更新预约日期列表接口参数说明
添加reserve_full、open_time和tips参数的详细描述
Showing
2 changed files
with
20 additions
and
4 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2023-08-24 09:42:27 | 2 | * @Date: 2023-08-24 09:42:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2026-01-20 11:40:31 | 4 | + * @LastEditTime: 2026-01-22 09:41:23 |
| 5 | * @FilePath: /xyxBooking-weapp/src/api/index.js | 5 | * @FilePath: /xyxBooking-weapp/src/api/index.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -31,7 +31,7 @@ const Api = { | ... | @@ -31,7 +31,7 @@ const Api = { |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * @description: 可预约日期列表 | 33 | * @description: 可预约日期列表 |
| 34 | - * @param {Array} month 月份,格式yyyy-mm | 34 | + * @param {Array} month 月份,格式yyyy-mm, reserve_full 是否可约 1=可约,0=约满,-1=没有配置预约时段, open_time 在今天,开放预约最晚可预约日期的后一天的时间点, tips 不可预约的提示信息 |
| 35 | * @returns | 35 | * @returns |
| 36 | */ | 36 | */ |
| 37 | export const canReserveDateListAPI = (params) => fn(fetch.get(Api.CAN_RESERVE_DATE_LIST, params)); | 37 | export const canReserveDateListAPI = (params) => fn(fetch.get(Api.CAN_RESERVE_DATE_LIST, params)); | ... | ... |
| 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-16 17:33:27 | 4 | + * @LastEditTime: 2026-01-22 09:47:48 |
| 5 | * @FilePath: /xyxBooking-weapp/src/pages/booking/index.vue | 5 | * @FilePath: /xyxBooking-weapp/src/pages/booking/index.vue |
| 6 | * @Description: 预约页面 | 6 | * @Description: 预约页面 |
| 7 | --> | 7 | --> |
| ... | @@ -65,7 +65,7 @@ | ... | @@ -65,7 +65,7 @@ |
| 65 | <view class="text">选择参访时间段</view> | 65 | <view class="text">选择参访时间段</view> |
| 66 | </view> | 66 | </view> |
| 67 | <view style="padding: 48rpx 24rpx; color: #A67939; text-align: center;"> | 67 | <view style="padding: 48rpx 24rpx; color: #A67939; text-align: center;"> |
| 68 | - 暂未开启预约 | 68 | + {{ infinity_tips_text }} |
| 69 | </view> | 69 | </view> |
| 70 | </view> | 70 | </view> |
| 71 | </view> | 71 | </view> |
| ... | @@ -137,6 +137,7 @@ const findDatesInfo = (date) => { | ... | @@ -137,6 +137,7 @@ const findDatesInfo = (date) => { |
| 137 | text: currentDate.getDate().toString().padStart(2, '0'), | 137 | text: currentDate.getDate().toString().padStart(2, '0'), |
| 138 | date: result?.month_date, | 138 | date: result?.month_date, |
| 139 | reserve_full: result?.reserve_full, | 139 | reserve_full: result?.reserve_full, |
| 140 | + tips: result?.tips || '', | ||
| 140 | lunar_date: lunarDate | 141 | lunar_date: lunarDate |
| 141 | }; | 142 | }; |
| 142 | }; | 143 | }; |
| ... | @@ -203,6 +204,21 @@ const checked_day_reserve_full = ref(null); | ... | @@ -203,6 +204,21 @@ const checked_day_reserve_full = ref(null); |
| 203 | const checked_time = ref(-1); | 204 | const checked_time = ref(-1); |
| 204 | const timePeriod = ref([]); // 当前时间段信息 | 205 | const timePeriod = ref([]); // 当前时间段信息 |
| 205 | 206 | ||
| 207 | +/** | ||
| 208 | + * @description: 无预约提示 | ||
| 209 | + * @return {string} 提示信息 | ||
| 210 | + */ | ||
| 211 | + | ||
| 212 | +const infinity_tips_text = computed(() => { | ||
| 213 | + if (!checked_day.value || checked_day_reserve_full.value !== ReserveStatus.INFINITY) return ''; | ||
| 214 | + const info = findDatesInfo(checked_day.value); | ||
| 215 | + if (dayjs(checked_day.value).isAfter(dayjs(), 'day')) { | ||
| 216 | + const tips = (info.tips || '').trim(); | ||
| 217 | + if (tips) return tips; | ||
| 218 | + } | ||
| 219 | + return '暂未开启预约'; | ||
| 220 | +}); | ||
| 221 | + | ||
| 206 | const chooseTime = (item, index) => { // 选择时间段回调 | 222 | const chooseTime = (item, index) => { // 选择时间段回调 |
| 207 | if (item.rest_qty || item.rest_qty === QtyStatus.INFINITY) { // 余量等于-1为不限制数量 | 223 | if (item.rest_qty || item.rest_qty === QtyStatus.INFINITY) { // 余量等于-1为不限制数量 |
| 208 | checked_time.value = index; | 224 | checked_time.value = index; | ... | ... |
-
Please register or login to post a comment