改为店务小程序原生时间选择器
This commit is contained in:
@@ -457,43 +457,11 @@ function canUseTimeMinute(form, minute) {
|
|||||||
return minute > getCurrentMinuteOfDay()
|
return minute > getCurrentMinuteOfDay()
|
||||||
}
|
}
|
||||||
|
|
||||||
function splitTimeValue(value) {
|
|
||||||
const parts = String(value || '').split(':')
|
|
||||||
return {
|
|
||||||
hour: parts[0] || '',
|
|
||||||
minute: parts[1] || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildTimePickerState(selectedValue) {
|
|
||||||
const hourValues = []
|
|
||||||
const minuteValues = []
|
|
||||||
for (let hour = 0; hour < 24; hour += 1) {
|
|
||||||
hourValues.push(String(hour).padStart(2, '0'))
|
|
||||||
}
|
|
||||||
for (let minute = 0; minute < 60; minute += 1) {
|
|
||||||
minuteValues.push(String(minute).padStart(2, '0'))
|
|
||||||
}
|
|
||||||
const selectedParts = splitTimeValue(selectedValue)
|
|
||||||
const selectedHour = hourValues.includes(selectedParts.hour) ? selectedParts.hour : hourValues[0]
|
|
||||||
const selectedMinute = minuteValues.includes(selectedParts.minute) ? selectedParts.minute : minuteValues[0]
|
|
||||||
const value = `${selectedHour}:${selectedMinute}`
|
|
||||||
return {
|
|
||||||
hourValues,
|
|
||||||
minuteValues,
|
|
||||||
value,
|
|
||||||
indices: [hourValues.indexOf(selectedHour), minuteValues.indexOf(selectedMinute)]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolveInitialTimePickerValue(form) {
|
function resolveInitialTimePickerValue(form) {
|
||||||
if (form.appointmentTime) {
|
if (form.appointmentTime) {
|
||||||
return form.appointmentTime
|
return normalizeTimeText(form.appointmentTime)
|
||||||
}
|
}
|
||||||
if (!isToday(form.appointmentDate)) {
|
return '00:00'
|
||||||
return '00:00'
|
|
||||||
}
|
|
||||||
return dateUtil.timeFromMinutes(Math.min(DAY_MINUTES - 1, getCurrentMinuteOfDay() + 1))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveTimeConfirmTip(form) {
|
function resolveTimeConfirmTip(form) {
|
||||||
@@ -795,11 +763,7 @@ Page({
|
|||||||
canCreateAppointment: true,
|
canCreateAppointment: true,
|
||||||
draftSavedAtText: '',
|
draftSavedAtText: '',
|
||||||
manualImageUploading: false,
|
manualImageUploading: false,
|
||||||
timeSheetVisible: false,
|
|
||||||
timeSelectTip: '请选择预约时间',
|
timeSelectTip: '请选择预约时间',
|
||||||
timePickerHours: [],
|
|
||||||
timePickerMinutes: [],
|
|
||||||
timePickerIndices: [0, 0],
|
|
||||||
timePickerValue: '',
|
timePickerValue: '',
|
||||||
timePickerConfirming: false,
|
timePickerConfirming: false,
|
||||||
pageMaskVisible: false,
|
pageMaskVisible: false,
|
||||||
@@ -1341,76 +1305,31 @@ Page({
|
|||||||
void this.checkAvailability(this.data.form.appointmentTime)
|
void this.checkAvailability(this.data.form.appointmentTime)
|
||||||
},
|
},
|
||||||
|
|
||||||
canOpenTimeSheet() {
|
|
||||||
const form = this.data.form
|
|
||||||
return Boolean(form.appointmentDate)
|
|
||||||
},
|
|
||||||
|
|
||||||
refreshAvailableTimes() {
|
refreshAvailableTimes() {
|
||||||
const form = this.data.form
|
const form = this.data.form
|
||||||
if (!form.appointmentDate) {
|
if (!form.appointmentDate) {
|
||||||
this.setData({
|
this.setData({
|
||||||
timeSelectTip: '请选择预约时间',
|
timeSelectTip: '请选择预约时间',
|
||||||
timePickerHours: [],
|
|
||||||
timePickerMinutes: [],
|
|
||||||
timePickerIndices: [0, 0],
|
|
||||||
timePickerValue: ''
|
timePickerValue: ''
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const timePickerState = buildTimePickerState(resolveInitialTimePickerValue(form))
|
|
||||||
this.setData({
|
this.setData({
|
||||||
timeSelectTip: '请选择预约时间',
|
timeSelectTip: '请选择预约时间',
|
||||||
timePickerHours: timePickerState.hourValues,
|
timePickerValue: resolveInitialTimePickerValue(form)
|
||||||
timePickerMinutes: timePickerState.minuteValues,
|
|
||||||
timePickerIndices: timePickerState.indices,
|
|
||||||
timePickerValue: timePickerState.value
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
async openTimeSheet() {
|
async onNativeTimeChange(event) {
|
||||||
if (!this.canOpenTimeSheet()) {
|
|
||||||
wx.showToast({ title: '请先选择预约日期', icon: 'none' })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.setData({
|
|
||||||
timeSheetVisible: true,
|
|
||||||
timePickerConfirming: false
|
|
||||||
})
|
|
||||||
this.refreshAvailableTimes()
|
|
||||||
},
|
|
||||||
|
|
||||||
closeTimeSheet() {
|
|
||||||
this.setData({
|
|
||||||
timeSheetVisible: false,
|
|
||||||
timePickerConfirming: false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
onTimePickerChange(event) {
|
|
||||||
const value = Array.isArray(event.detail.value) ? event.detail.value : []
|
|
||||||
const hourValues = this.data.timePickerHours || []
|
|
||||||
const minuteValues = this.data.timePickerMinutes || []
|
|
||||||
const hourIndex = Math.max(0, Math.min(hourValues.length - 1, Number(value[0] || 0)))
|
|
||||||
const minuteIndex = Math.max(0, Math.min(minuteValues.length - 1, Number(value[1] || 0)))
|
|
||||||
const selectedHour = hourValues[hourIndex] || hourValues[0] || '00'
|
|
||||||
const selectedMinute = minuteValues[minuteIndex] || minuteValues[0] || '00'
|
|
||||||
const selectedValue = selectedHour && selectedMinute ? `${selectedHour}:${selectedMinute}` : ''
|
|
||||||
this.setData({
|
|
||||||
timePickerIndices: [hourIndex, minuteIndex],
|
|
||||||
timePickerValue: selectedValue
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
async confirmTimeSelection() {
|
|
||||||
if (this.data.timePickerConfirming) {
|
if (this.data.timePickerConfirming) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const selectedTime = this.data.timePickerValue
|
const selectedTime = normalizeTimeText(event.detail.value)
|
||||||
if (!selectedTime) {
|
if (!selectedTime) {
|
||||||
wx.showToast({ title: '请先选择预约时间', icon: 'none' })
|
wx.showToast({ title: '请先选择预约时间', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.setData({ timePickerValue: selectedTime })
|
||||||
const confirmTip = resolveTimeConfirmTip(this.data.form)
|
const confirmTip = resolveTimeConfirmTip(this.data.form)
|
||||||
if (confirmTip) {
|
if (confirmTip) {
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
@@ -1438,7 +1357,7 @@ Page({
|
|||||||
}
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
'form.appointmentTime': selectedTime,
|
'form.appointmentTime': selectedTime,
|
||||||
timeSheetVisible: false
|
timePickerValue: selectedTime
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.hidePageMask()
|
this.hidePageMask()
|
||||||
|
|||||||
@@ -59,13 +59,15 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="field">
|
<view class="field">
|
||||||
<text class="field-label required">预约时间</text>
|
<text class="field-label required">预约时间</text>
|
||||||
<view class="field-value time-value {{form.appointmentTime ? '' : 'placeholder'}}" bindtap="openTimeSheet">
|
<picker class="time-native-picker" mode="time" value="{{timePickerValue || form.appointmentTime || '00:00'}}" start="00:00" end="23:59" disabled="{{pageMaskVisible || timePickerConfirming}}" bindchange="onNativeTimeChange">
|
||||||
<view>
|
<view class="field-value time-value {{form.appointmentTime ? '' : 'placeholder'}}">
|
||||||
<text>{{form.appointmentTime || timeSelectTip}}</text>
|
<view>
|
||||||
<text wx:if="{{form.appointmentTime}}" class="time-range">{{form.appointmentDate}} · {{selectedArtist.name}} · {{form.durationMinutes}}分钟</text>
|
<text>{{form.appointmentTime || timeSelectTip}}</text>
|
||||||
|
<text wx:if="{{form.appointmentTime}}" class="time-range">{{form.appointmentDate}} · {{selectedArtist.name}} · {{form.durationMinutes}}分钟</text>
|
||||||
|
</view>
|
||||||
|
<text class="time-arrow">›</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="time-arrow">›</text>
|
</picker>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="appointment-flags">
|
<view class="appointment-flags">
|
||||||
<view class="flag-card {{form.depositPaid ? 'active' : ''}}" data-field="depositPaid" bindtap="toggleFlag">
|
<view class="flag-card {{form.depositPaid ? 'active' : ''}}" data-field="depositPaid" bindtap="toggleFlag">
|
||||||
@@ -221,45 +223,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view wx:if="{{timeSheetVisible}}" class="modal-mask" bindtap="closeTimeSheet">
|
|
||||||
<view class="time-modal" catchtap="stopTap">
|
|
||||||
<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">×</view>
|
|
||||||
</view>
|
|
||||||
<view class="time-picker-panel">
|
|
||||||
<view class="time-picker-summary">
|
|
||||||
<text class="time-picker-label">开始时间</text>
|
|
||||||
<text class="time-picker-value">{{timePickerValue || '--:--'}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="time-picker-head">
|
|
||||||
<text>时</text>
|
|
||||||
<text>分</text>
|
|
||||||
</view>
|
|
||||||
<view class="time-picker-stage">
|
|
||||||
<picker-view class="time-picker-view" value="{{timePickerIndices}}" bindchange="onTimePickerChange" indicator-class="time-picker-indicator" mask-class="time-picker-mask">
|
|
||||||
<picker-view-column>
|
|
||||||
<view wx:for="{{timePickerHours}}" wx:for-index="hourIndex" wx:key="*this" class="time-picker-item {{timePickerIndices[0] == hourIndex ? 'selected' : ''}}">{{item}}</view>
|
|
||||||
</picker-view-column>
|
|
||||||
<picker-view-column>
|
|
||||||
<view wx:for="{{timePickerMinutes}}" wx:for-index="minuteIndex" wx:key="*this" class="time-picker-item {{timePickerIndices[1] == minuteIndex ? 'selected' : ''}}">{{item}}</view>
|
|
||||||
</picker-view-column>
|
|
||||||
</picker-view>
|
|
||||||
<view class="time-picker-selected-overlay" aria-hidden="true">
|
|
||||||
<text>{{timePickerHours[timePickerIndices[0]] || '--'}}</text>
|
|
||||||
<text>{{timePickerMinutes[timePickerIndices[1]] || '--'}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="time-picker-actions">
|
|
||||||
<button class="time-confirm-btn" loading="{{timePickerConfirming}}" disabled="{{timePickerConfirming || !timePickerValue || pageMaskVisible}}" bindtap="confirmTimeSelection">确认时间</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="fixed-bottom">
|
<view class="fixed-bottom">
|
||||||
<view wx:if="{{canCreateAppointment}}" class="action-row">
|
<view wx:if="{{canCreateAppointment}}" class="action-row">
|
||||||
<button class="secondary-btn draft-btn" disabled="{{pageMaskVisible || loading}}" bindtap="saveDraft">保存草稿</button>
|
<button class="secondary-btn draft-btn" disabled="{{pageMaskVisible || loading}}" bindtap="saveDraft">保存草稿</button>
|
||||||
|
|||||||
@@ -283,6 +283,11 @@
|
|||||||
color: #aaa096;
|
color: #aaa096;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.time-native-picker {
|
||||||
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.time-range {
|
.time-range {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #9a9288;
|
color: #9a9288;
|
||||||
@@ -488,19 +493,9 @@
|
|||||||
box-shadow: 0 -18rpx 40rpx rgba(41, 31, 23, 0.16);
|
box-shadow: 0 -18rpx 40rpx rgba(41, 31, 23, 0.16);
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-modal {
|
|
||||||
width: 100%;
|
|
||||||
max-height: 82vh;
|
|
||||||
padding: 28rpx 28rpx calc(28rpx + env(safe-area-inset-bottom));
|
|
||||||
border-radius: 28rpx 28rpx 0 0;
|
|
||||||
background: #fffaf4;
|
|
||||||
box-shadow: 0 -18rpx 40rpx rgba(41, 31, 23, 0.16);
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-modal,
|
.product-modal,
|
||||||
.template-modal,
|
.template-modal,
|
||||||
.artist-modal,
|
.artist-modal {
|
||||||
.time-modal {
|
|
||||||
animation: appointment-sheet-enter 0.22s ease-out both;
|
animation: appointment-sheet-enter 0.22s ease-out both;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -852,143 +847,6 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-picker-panel {
|
|
||||||
padding-top: 4rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-summary {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 18rpx;
|
|
||||||
padding: 18rpx 22rpx;
|
|
||||||
border: 1rpx solid #eadfd2;
|
|
||||||
border-radius: 18rpx;
|
|
||||||
background: #fffdf8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-label {
|
|
||||||
display: block;
|
|
||||||
color: #8c8177;
|
|
||||||
font-size: 22rpx;
|
|
||||||
line-height: 1.25;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-value {
|
|
||||||
display: block;
|
|
||||||
min-width: 160rpx;
|
|
||||||
color: #2f2923;
|
|
||||||
font-size: 42rpx;
|
|
||||||
font-weight: 900;
|
|
||||||
line-height: 1.1;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-head {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
||||||
margin: 20rpx 0 10rpx;
|
|
||||||
color: #8c8177;
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-weight: 800;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-view {
|
|
||||||
width: 100%;
|
|
||||||
height: 370rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 1rpx solid #eadfd2;
|
|
||||||
border-radius: 18rpx;
|
|
||||||
background: #fffaf4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-stage {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 92rpx;
|
|
||||||
color: #c8beb2;
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: 800;
|
|
||||||
line-height: 92rpx;
|
|
||||||
transition: color 160ms ease, font-weight 160ms ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-item.selected {
|
|
||||||
color: #2f2923;
|
|
||||||
font-weight: 900;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-selected-overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
display: grid;
|
|
||||||
height: 92rpx;
|
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
||||||
align-items: center;
|
|
||||||
margin-top: -46rpx;
|
|
||||||
background: #fff2df;
|
|
||||||
border-top: 1rpx solid #e1d4c5;
|
|
||||||
border-bottom: 1rpx solid #e1d4c5;
|
|
||||||
pointer-events: none;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-selected-overlay text {
|
|
||||||
color: #2f2923;
|
|
||||||
font-size: 34rpx;
|
|
||||||
font-weight: 900;
|
|
||||||
line-height: 92rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-indicator {
|
|
||||||
height: 92rpx;
|
|
||||||
border-top: 1rpx solid #e1d4c5;
|
|
||||||
border-bottom: 1rpx solid #e1d4c5;
|
|
||||||
background: rgba(255, 242, 223, 0.82);
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-mask {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-picker-actions {
|
|
||||||
margin-top: 22rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-confirm-btn {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
height: 88rpx;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-radius: 18rpx;
|
|
||||||
background: #6f8f83;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 900;
|
|
||||||
line-height: 88rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-confirm-btn::after {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-confirm-btn[disabled] {
|
|
||||||
background: #d7d0c8;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time-empty {
|
.time-empty {
|
||||||
min-height: 220rpx;
|
min-height: 220rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -370,3 +370,11 @@
|
|||||||
- 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。
|
- 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。
|
||||||
- 影响范围:仅影响 `JY-Salon-WeChat/pages/appointment-form/` 时间选择弹窗的中间选中态视觉;不影响时间候选数据、确认时间校验、预约提交和后端接口。
|
- 影响范围:仅影响 `JY-Salon-WeChat/pages/appointment-form/` 时间选择弹窗的中间选中态视觉;不影响时间候选数据、确认时间校验、预约提交和后端接口。
|
||||||
- 验证方式:微信开发者工具自动化确认 `.time-picker-selected-overlay` 存在且 `.time-picker-item.selected` 仍有 2 个;截图通道仍可能超时,视觉验证以元素和数据断言为准。
|
- 验证方式:微信开发者工具自动化确认 `.time-picker-selected-overlay` 存在且 `.time-picker-item.selected` 仍有 2 个;截图通道仍可能超时,视觉验证以元素和数据断言为准。
|
||||||
|
|
||||||
|
## 2026-07-23 店务小程序预约时间改为原生时间选择器
|
||||||
|
|
||||||
|
- 变更原因:自定义 `picker-view` 时间滚轮的选中态颜色在微信原生渲染层下仍可能显示为灰色,用户要求改成和预约日期一样的系统选择器效果。
|
||||||
|
- 处理方式:预约时间字段改为原生 `picker mode="time"`,固定 `start="00:00"`、`end="23:59"`,不再构造小时/分钟自定义滚轮和底部弹窗;用户在系统时间选择器点确认后,继续复用 `checkAvailability` 校验过去时间、门店营业时间、员工排班和预约冲突,不可预约时弹窗展示具体原因。
|
||||||
|
- 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。
|
||||||
|
- 影响范围:仅影响 `JY-Salon-WeChat/pages/appointment-form/` 的预约时间选择交互;不影响后端、接口契约、SQL 和预约提交 payload。
|
||||||
|
- 验证方式:已执行预约表单 JS 语法检查、旧 `picker-view/time-picker` 引用检索、`git diff --check` 和 GitNexus staged `detect-changes`;微信开发者工具连接与当前路由验证通过,元素查询通道超时且 `mp_healthCheck` 显示 `needsRecovery=false`,运行态元素断言以工具通道缺口记录。
|
||||||
|
|||||||
@@ -463,3 +463,15 @@
|
|||||||
以后避免:修改 `picker-view` 视觉时不要只改条目颜色,先确认中间选中态是否需要独立叠层或遮罩;截图校验优先看最终像素,而不是只看 class 是否挂上。
|
以后避免:修改 `picker-view` 视觉时不要只改条目颜色,先确认中间选中态是否需要独立叠层或遮罩;截图校验优先看最终像素,而不是只看 class 是否挂上。
|
||||||
|
|
||||||
验证方式:自动化断言叠层存在且选中项数量正确;若截图通道超时,继续用元素数量和 page.data 兜底。
|
验证方式:自动化断言叠层存在且选中项数量正确;若截图通道超时,继续用元素数量和 page.data 兜底。
|
||||||
|
|
||||||
|
## 2026-07-23 小程序时间选择要优先用原生 picker mode=time
|
||||||
|
|
||||||
|
问题:店务小程序预约时间选择器连续修补自定义 `picker-view` 的选中态颜色后,用户仍觉得效果不像预约日期选择器。
|
||||||
|
|
||||||
|
原因:用户期望的是系统选择器的交互和视觉,而不是页面内自定义底部滚轮;继续修补 `picker-view` 的 item、indicator 或叠层只能局部缓解,无法稳定复刻系统选择器。
|
||||||
|
|
||||||
|
处理方式:预约时间字段改为原生 `picker mode="time"`,设置 `start="00:00"`、`end="23:59"`,选择器确认后再执行预约可用性校验并展示不可预约原因。
|
||||||
|
|
||||||
|
以后避免:当需求明确要求“和日期选择一样”“系统选择器效果”时,优先使用小程序原生 `picker` 对应 mode;只有用户明确要求页面内自定义滚轮时,才使用 `picker-view`。
|
||||||
|
|
||||||
|
验证方式:源码检索不再存在旧 `timeSheetVisible`、`picker-view`、`time-picker` 自定义滚轮引用;JS 语法检查、运行态元素断言和 `git diff --check` 通过。
|
||||||
|
|||||||
+9
-7
@@ -2,26 +2,28 @@
|
|||||||
|
|
||||||
## 当前任务
|
## 当前任务
|
||||||
|
|
||||||
店务小程序预约时间滚轮中间态叠层修复。
|
店务小程序预约时间改为原生时间选择器。
|
||||||
|
|
||||||
## 已完成
|
## 已完成
|
||||||
|
|
||||||
- 已读取项目规则、轻量记忆、文档索引、版本基线规则和错误记忆相关条目。
|
- 已读取项目规则、轻量记忆和错误记忆相关条目。
|
||||||
- 已按截图反馈将预约时间滚轮未选中项改为浅灰。
|
- 已按用户最新反馈放弃继续修补自定义 `picker-view` 视觉。
|
||||||
- 已将当前选中的小时和分钟项按 `timePickerIndices` 加上选中类,并额外叠加深色文本层覆盖原生中间态灰色。
|
- 已将预约时间字段改为原生 `picker mode="time"`,范围 `00:00-23:59`,确认后再复用原可约性校验。
|
||||||
|
- 已删除旧时间底部弹窗、自定义小时/分钟滚轮模板和相关样式。
|
||||||
|
- 已完成 JS 语法检查、旧引用检索、`git diff --check` 和 GitNexus staged 检测,检测结果为低风险、影响流程 0。
|
||||||
- 已补充 `docs/项目变更记录.md`。
|
- 已补充 `docs/项目变更记录.md`。
|
||||||
|
|
||||||
## 下一步
|
## 下一步
|
||||||
|
|
||||||
- 运行最终检查、GitNexus staged 变更检测并提交本次相关改动。
|
- 提交本次相关改动。
|
||||||
|
|
||||||
## 当前阻塞点
|
## 当前阻塞点
|
||||||
|
|
||||||
- 截图通道仍会超时,视觉验证依赖元素和数据断言。
|
- 微信开发者工具当前路由断言通过,但元素查询通道超时;`mp_healthCheck` 显示连接正常、`needsRecovery=false`,不建议重连。
|
||||||
|
|
||||||
## 最近一次重要操作结果
|
## 最近一次重要操作结果
|
||||||
|
|
||||||
2026-07-23 预约时间滚轮叠层方案已验证:微信开发者工具自动化构造 `21:04` 时间弹窗状态后,`.time-picker-selected-overlay` 存在且 `.time-picker-item.selected` 为 2 个;截图通道仍超时,元素断言兜底。
|
2026-07-23 已完成源码层和静态验证:旧 `timeSheetVisible`、`picker-view`、`time-picker` 样式和旧确认方法引用检索为空;微信开发者工具可确认路由在 `pages/appointment-form/index`,但元素查询通道超时。
|
||||||
## 2026-07-23 预约图片链路检查
|
## 2026-07-23 预约图片链路检查
|
||||||
- 已完成:梳理新建预约手工作品上传、预约详情上传/删除、后端 `PlanningServiceImpl` 回显链路,并修复详情页旧字段回退隐患。
|
- 已完成:梳理新建预约手工作品上传、预约详情上传/删除、后端 `PlanningServiceImpl` 回显链路,并修复详情页旧字段回退隐患。
|
||||||
- 下一步:无,等待用户验收预约图片链路。
|
- 下一步:无,等待用户验收预约图片链路。
|
||||||
|
|||||||
Reference in New Issue
Block a user