预约时间选择改为1分钟粒度:小程序预约时间滚轮与时段列表由15分钟一档改为逐分钟候选,分钟可选00-59并原样提交回显
自动发布开发环境 Nacos 配置 / publish (push) Successful in 34s
自动发布开发环境 Nacos 配置 / publish (push) Successful in 34s
This commit is contained in:
@@ -10,7 +10,8 @@ const { showActionModal } = require('../../utils/action-modal')
|
|||||||
const DRAFT_STORAGE_PREFIX = 'managerAppointmentDraft'
|
const DRAFT_STORAGE_PREFIX = 'managerAppointmentDraft'
|
||||||
const DRAFT_TTL_MS = 7 * 24 * 60 * 60 * 1000
|
const DRAFT_TTL_MS = 7 * 24 * 60 * 60 * 1000
|
||||||
const DRAFT_SAVE_DELAY_MS = 400
|
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) {
|
function buildClientRequestId(prefix) {
|
||||||
return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`
|
return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`
|
||||||
@@ -419,7 +420,7 @@ function buildTimeWheelState(slots, preferredTime) {
|
|||||||
: firstAvailableSlot || preferredSlot || slots[0]
|
: firstAvailableSlot || preferredSlot || slots[0]
|
||||||
const hours = Array.from(new Set(slots.map(slot => slot.hour)))
|
const hours = Array.from(new Set(slots.map(slot => slot.hour)))
|
||||||
const selectedHourIndex = Math.max(0, hours.indexOf(selectedSlot.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 minutes = minuteValues.map(minute => {
|
||||||
const slot = slots.find(item => item.hour === selectedSlot.hour && item.minute === minute)
|
const slot = slots.find(item => item.hour === selectedSlot.hour && item.minute === minute)
|
||||||
return {
|
return {
|
||||||
@@ -444,7 +445,7 @@ function buildTimeWheelState(slots, preferredTime) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function timeWheelStateForHour(slots, hour, selectedMinute) {
|
function timeWheelStateForHour(slots, hour, selectedMinute) {
|
||||||
const minuteValues = [0, 15, 30, 45]
|
const minuteValues = MINUTE_VALUES
|
||||||
const minutes = minuteValues.map(minute => {
|
const minutes = minuteValues.map(minute => {
|
||||||
const slot = slots.find(item => item.hour === hour && item.minute === minute)
|
const slot = slots.find(item => item.hour === hour && item.minute === minute)
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
<view wx:if="{{timeSheetVisible}}" class="modal-mask" bindtap="closeTimeSheet" catchtouchmove="stopTouchMove">
|
<view wx:if="{{timeSheetVisible}}" class="modal-mask" bindtap="closeTimeSheet" catchtouchmove="stopTouchMove">
|
||||||
<view class="time-modal" catchtap="stopTap" catchtouchmove="stopTouchMove">
|
<view class="time-modal" catchtap="stopTap" catchtouchmove="stopTouchMove">
|
||||||
<view class="modal-head"><view><text class="modal-title">选择预约时间</text><text class="modal-subtitle">{{form.appointmentDate}} · {{selectedArtist.name || '待分配'}} · {{form.durationMinutes}}分钟</text></view><view class="modal-close" bindtap="closeTimeSheet" aria-label="关闭时间选择"></view></view>
|
<view class="modal-head"><view><text class="modal-title">选择预约时间</text><text class="modal-subtitle">{{form.appointmentDate}} · {{selectedArtist.name || '待分配'}} · {{form.durationMinutes}}分钟</text></view><view class="modal-close" bindtap="closeTimeSheet" aria-label="关闭时间选择"></view></view>
|
||||||
<view class="time-mode-switch"><button class="{{timePickerMode === 'wheel' ? 'active' : ''}}" data-mode="wheel" bindtap="onTimePickerModeChange">滚轮选择</button><button class="{{timePickerMode === 'grid' ? 'active' : ''}}" data-mode="grid" bindtap="onTimePickerModeChange">15分钟时段</button></view>
|
<view class="time-mode-switch"><button class="{{timePickerMode === 'wheel' ? 'active' : ''}}" data-mode="wheel" bindtap="onTimePickerModeChange">滚轮选择</button><button class="{{timePickerMode === 'grid' ? 'active' : ''}}" data-mode="grid" bindtap="onTimePickerModeChange">逐分钟时段</button></view>
|
||||||
<view wx:if="{{timeLoading}}" class="time-empty">正在计算可约时间...</view>
|
<view wx:if="{{timeLoading}}" class="time-empty">正在计算可约时间...</view>
|
||||||
<view wx:elif="{{timeError}}" class="time-empty"><text>{{businessHoursMissing && !canManageShopSettings ? '门店营业时间尚未设置,请联系店长完成设置' : timeError}}</text><button wx:if="{{businessHoursMissing && canManageShopSettings}}" class="time-empty-action" bindtap="openShopSettings">前往店铺设置</button></view>
|
<view wx:elif="{{timeError}}" class="time-empty"><text>{{businessHoursMissing && !canManageShopSettings ? '门店营业时间尚未设置,请联系店长完成设置' : timeError}}</text><button wx:if="{{businessHoursMissing && canManageShopSettings}}" class="time-empty-action" bindtap="openShopSettings">前往店铺设置</button></view>
|
||||||
<block wx:elif="{{timePickerMode === 'wheel'}}">
|
<block wx:elif="{{timePickerMode === 'wheel'}}">
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ async function run() {
|
|||||||
assert.strictEqual(page.data.availableTimeGroups.length > 0, true)
|
assert.strictEqual(page.data.availableTimeGroups.length > 0, true)
|
||||||
assert.strictEqual(page.data.availableTimeGroups[0].times[0].value, '09:30')
|
assert.strictEqual(page.data.availableTimeGroups[0].times[0].value, '09:30')
|
||||||
assert.strictEqual(page.data.timeSelectTip, '请选择预约时间,美甲师可稍后分配')
|
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()
|
const availability = await page.checkAvailability()
|
||||||
assert.strictEqual(availability.ok, true)
|
assert.strictEqual(availability.ok, true)
|
||||||
assert.strictEqual(page.data.conflictTip.includes('待分配'), true)
|
assert.strictEqual(page.data.conflictTip.includes('待分配'), true)
|
||||||
|
|||||||
Reference in New Issue
Block a user