diff --git a/JC-Salon-WeChat/pages/appointment-form/index.js b/JC-Salon-WeChat/pages/appointment-form/index.js index 136a7a04..3fa51657 100644 --- a/JC-Salon-WeChat/pages/appointment-form/index.js +++ b/JC-Salon-WeChat/pages/appointment-form/index.js @@ -10,7 +10,8 @@ const { showActionModal } = require('../../utils/action-modal') const DRAFT_STORAGE_PREFIX = 'managerAppointmentDraft' const DRAFT_TTL_MS = 7 * 24 * 60 * 60 * 1000 const DRAFT_SAVE_DELAY_MS = 400 -const TIME_SLOT_MINUTES = 15 +const TIME_SLOT_MINUTES = 1 +const MINUTE_VALUES = Array.from({ length: 60 }, (_, index) => index) function buildClientRequestId(prefix) { return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 10)}` @@ -419,7 +420,7 @@ function buildTimeWheelState(slots, preferredTime) { : firstAvailableSlot || preferredSlot || slots[0] const hours = Array.from(new Set(slots.map(slot => slot.hour))) const selectedHourIndex = Math.max(0, hours.indexOf(selectedSlot.hour)) - const minuteValues = [0, 15, 30, 45] + const minuteValues = MINUTE_VALUES const minutes = minuteValues.map(minute => { const slot = slots.find(item => item.hour === selectedSlot.hour && item.minute === minute) return { @@ -444,7 +445,7 @@ function buildTimeWheelState(slots, preferredTime) { } function timeWheelStateForHour(slots, hour, selectedMinute) { - const minuteValues = [0, 15, 30, 45] + const minuteValues = MINUTE_VALUES const minutes = minuteValues.map(minute => { const slot = slots.find(item => item.hour === hour && item.minute === minute) return { diff --git a/JC-Salon-WeChat/pages/appointment-form/index.wxml b/JC-Salon-WeChat/pages/appointment-form/index.wxml index 574b029a..d1a61071 100644 --- a/JC-Salon-WeChat/pages/appointment-form/index.wxml +++ b/JC-Salon-WeChat/pages/appointment-form/index.wxml @@ -137,7 +137,7 @@ 选择预约时间{{form.appointmentDate}} · {{selectedArtist.name || '待分配'}} · {{form.durationMinutes}}分钟 - + 正在计算可约时间... {{businessHoursMissing && !canManageShopSettings ? '门店营业时间尚未设置,请联系店长完成设置' : timeError}} diff --git a/JC-Salon-WeChat/pages/appointment-form/unassigned.test.js b/JC-Salon-WeChat/pages/appointment-form/unassigned.test.js index e4185048..412bbc8e 100644 --- a/JC-Salon-WeChat/pages/appointment-form/unassigned.test.js +++ b/JC-Salon-WeChat/pages/appointment-form/unassigned.test.js @@ -76,6 +76,8 @@ async function run() { assert.strictEqual(page.data.availableTimeGroups.length > 0, true) assert.strictEqual(page.data.availableTimeGroups[0].times[0].value, '09:30') assert.strictEqual(page.data.timeSelectTip, '请选择预约时间,美甲师可稍后分配') + assert.strictEqual(page.data.timePickerMinutes.length, 60) + assert.strictEqual(page.data.timePickerSlots.some(slot => slot.value === '09:31'), true) const availability = await page.checkAvailability() assert.strictEqual(availability.ok, true) assert.strictEqual(page.data.conflictTip.includes('待分配'), true)