hookehuyr

docs(booking): 更新预约状态和日期回调的注释说明

更新ReserveStatus对象的注释,更清晰地描述各状态含义
添加chooseDay函数的注释说明
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-13 14:15:29 4 + * @LastEditTime: 2026-01-15 16:47: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 -->
...@@ -143,7 +143,7 @@ const findDatesInfo = (date) => { ...@@ -143,7 +143,7 @@ const findDatesInfo = (date) => {
143 143
144 /** 144 /**
145 * @description: 预约状态 145 * @description: 预约状态
146 - * @return {object} {INFINITY: -1, FULL: 0, AVAILABLE: 1, OVERDUE: 'overdue' } 146 + * @return {object} {INFINITY: -1 无需预约, FULL: 0 约满, AVAILABLE: 1 可约, OVERDUE: 'overdue' 过期日期 }
147 */ 147 */
148 const ReserveStatus = { 148 const ReserveStatus = {
149 INFINITY: -1, // 无需预约 149 INFINITY: -1, // 无需预约
...@@ -219,12 +219,19 @@ const QtyStatus = { ...@@ -219,12 +219,19 @@ const QtyStatus = {
219 INFINITY: -1, // 无限制 219 INFINITY: -1, // 无限制
220 } 220 }
221 221
222 +/**
223 + * @description: 点击日期回调
224 + * @param {string} date
225 + * @return {void}
226 + */
222 const chooseDay = async (date) => { // 点击日期回调 227 const chooseDay = async (date) => { // 点击日期回调
223 if (!date) return; 228 if (!date) return;
224 const info = findDatesInfo(date); 229 const info = findDatesInfo(date);
230 + //
225 if (info.reserve_full === ReserveStatus.AVAILABLE || info.reserve_full === ReserveStatus.INFINITY) { // 状态 1可约 || -1不限制 231 if (info.reserve_full === ReserveStatus.AVAILABLE || info.reserve_full === ReserveStatus.INFINITY) { // 状态 1可约 || -1不限制
226 checked_day.value = date; // 当前日期 232 checked_day.value = date; // 当前日期
227 checked_day_reserve_full.value = info.reserve_full; // 当前状态 233 checked_day_reserve_full.value = info.reserve_full; // 当前状态
234 + // 如果可约,查询时间段信息
228 if (info.reserve_full === ReserveStatus.AVAILABLE) { 235 if (info.reserve_full === ReserveStatus.AVAILABLE) {
229 // 选择日期后,查询时间段信息 236 // 选择日期后,查询时间段信息
230 const { code, data } = await canReserveTimeListAPI({ month_date: checked_day.value}); 237 const { code, data } = await canReserveTimeListAPI({ month_date: checked_day.value});
......