hookehuyr

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

更新ReserveStatus对象的注释,更清晰地描述各状态含义
添加chooseDay函数的注释说明
<!--
* @Date: 2024-01-15 13:35:51
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-13 14:15:29
* @LastEditTime: 2026-01-15 16:47:29
* @FilePath: /xyxBooking-weapp/src/pages/booking/index.vue
* @Description: 预约页面
-->
......@@ -143,7 +143,7 @@ const findDatesInfo = (date) => {
/**
* @description: 预约状态
* @return {object} {INFINITY: -1, FULL: 0, AVAILABLE: 1, OVERDUE: 'overdue' }
* @return {object} {INFINITY: -1 无需预约, FULL: 0 约满, AVAILABLE: 1 可约, OVERDUE: 'overdue' 过期日期 }
*/
const ReserveStatus = {
INFINITY: -1, // 无需预约
......@@ -219,12 +219,19 @@ const QtyStatus = {
INFINITY: -1, // 无限制
}
/**
* @description: 点击日期回调
* @param {string} date
* @return {void}
*/
const chooseDay = async (date) => { // 点击日期回调
if (!date) return;
const info = findDatesInfo(date);
//
if (info.reserve_full === ReserveStatus.AVAILABLE || info.reserve_full === ReserveStatus.INFINITY) { // 状态 1可约 || -1不限制
checked_day.value = date; // 当前日期
checked_day_reserve_full.value = info.reserve_full; // 当前状态
// 如果可约,查询时间段信息
if (info.reserve_full === ReserveStatus.AVAILABLE) {
// 选择日期后,查询时间段信息
const { code, data } = await canReserveTimeListAPI({ month_date: checked_day.value});
......