完善店员申请关联与预约页面
自动发布开发环境 Nacos 配置 / publish (push) Successful in 21s
环境分支晋级检查 / environment-promotion-source (pull_request_target) Successful in 8s

This commit is contained in:
2026-11-03 23:29:40 +08:00
parent 1fc46f3835
commit 4b4c1ddef5
18 changed files with 442 additions and 64 deletions
+7 -4
View File
@@ -121,7 +121,7 @@ function layoutAppointmentBlocks(items, startMinute, minuteScale, laneHeaderHeig
return {
...entry,
top: Math.max(0, entry.itemStart - startMinute) * minuteScale + laneHeaderHeight,
height: entry.durationMinutes * minuteScale,
height: Math.max(40, entry.durationMinutes * minuteScale),
left: Math.round(entry.columnIndex * slotWidth + 12),
width: Math.round(slotWidth - 24),
compact: entry.durationMinutes <= 15,
@@ -167,6 +167,7 @@ Page({
hours: [],
hasTimedAppointments: false,
timelineHeight: 720,
timelineViewportHeight: 720,
laneWidth: 720,
laneItemWidth: 240,
laneHeaderHeight: 54,
@@ -601,7 +602,7 @@ Page({
},
buildDayView(calendar) {
const minuteScale = 4
const minuteScale = 2.5
const daySummary = this.summaryMap(calendar)[this.data.currentDateText] || null
const businessHours = resolveBusinessHours(calendar, this.data.currentDateText)
const filteredArtists = this.data.selectedArtistId
@@ -622,6 +623,7 @@ Page({
hours: [],
hasTimedAppointments: false,
timelineHeight: 0,
timelineViewportHeight: 320,
laneHeaderHeight: 54,
laneItemWidth: 248,
laneWidth: 720,
@@ -644,7 +646,7 @@ Page({
const endMinute = businessHours
? dateUtil.minutesOfDay(businessHours.end)
: Math.min(1440, Math.max(startMinute + 60, Math.ceil(latestAppointmentEnd / 60) * 60))
const timelineHeight = Math.max(560, (endMinute - startMinute) * minuteScale)
const timelineHeight = (endMinute - startMinute) * minuteScale
const laneHeaderHeight = 54
const hours = []
for (let cursor = startMinute; cursor <= endMinute; cursor += 60) {
@@ -663,7 +665,7 @@ Page({
return {
...item,
top: Math.max(0, itemStart - startMinute) * minuteScale + laneHeaderHeight,
height: Math.max(60, (item.durationMinutes || 60) * minuteScale),
height: Math.max(40, (item.durationMinutes || 60) * minuteScale),
left: 12,
width: 224,
compact: Number(item.durationMinutes || 60) <= 15,
@@ -696,6 +698,7 @@ Page({
hours,
hasTimedAppointments: timedAppointments.length > 0,
timelineHeight: timelineHeight + laneHeaderHeight,
timelineViewportHeight: Math.min(820, timelineHeight + laneHeaderHeight),
laneHeaderHeight,
laneItemWidth: 248,
laneWidth: Math.max(720, lanes.reduce((width, lane) => width + (lane.width || 248), 0)),
+7 -5
View File
@@ -123,9 +123,10 @@ async function run() {
assert.strictEqual(dayState.dayLanes[0].artistId, '__unassigned__')
assert.strictEqual(dayState.dayLanes[0].blocks.length, 1)
assert.strictEqual(dayState.unassignedCount, 1)
assert.strictEqual(dayState.timelineHeight, 2934)
assert.strictEqual(dayState.hours.find(item => item.label === '14:00').top, 1014)
assert.strictEqual(dayState.dayLanes[0].blocks[0].height, 240)
assert.strictEqual(dayState.timelineHeight, 1854)
assert.strictEqual(dayState.timelineViewportHeight, 820)
assert.strictEqual(dayState.hours.find(item => item.label === '14:00').top, 654)
assert.strictEqual(dayState.dayLanes[0].blocks[0].height, 150)
const shortAppointmentState = dayPage.buildDayView({
businessStartTime: '10:30',
businessEndTime: '11:30',
@@ -133,9 +134,10 @@ async function run() {
appointments: [{ orderItemId: 9, date: '2026-10-12', startTime: '2026-10-12 10:45:00', durationMinutes: 15, artistId: 1 }]
})
assert.strictEqual(shortAppointmentState.hours[0].top, 54)
assert.strictEqual(shortAppointmentState.hours[1].top, 294)
assert.strictEqual(shortAppointmentState.hours[1].top, 204)
assert.strictEqual(shortAppointmentState.timelineViewportHeight, 204)
const shortAppointmentLane = shortAppointmentState.dayLanes.find(lane => lane.artistId === 1)
assert.strictEqual(shortAppointmentLane.blocks[0].height, 60)
assert.strictEqual(shortAppointmentLane.blocks[0].height, 40)
assert.strictEqual(shortAppointmentLane.blocks[0].compact, true)
const missingHoursPage = createPage({ viewMode: 'day', currentDateText: '2026-10-12' })
const missingHoursEmptyState = missingHoursPage.buildDayView({
+1 -1
View File
@@ -96,7 +96,7 @@
<text class="business-hours-empty-title">预约时间轴暂不可用</text>
<text class="business-hours-empty-desc">请先设置门店营业时间,再安排普通预约。</text>
</view>
<scroll-view wx:else class="day-board card" scroll-y>
<scroll-view wx:else class="day-board card" style="height: {{timelineViewportHeight}}rpx;" scroll-y>
<view class="timeline-wrap" style="height: {{timelineHeight}}rpx;">
<view class="time-axis">
<view wx:for="{{hours}}" wx:key="value" class="time-label" style="top: {{item.top}}rpx;">{{item.label}}</view>
+1 -2
View File
@@ -359,14 +359,13 @@
}
.day-board {
height: 820rpx;
max-height: 820rpx;
margin-top: 12rpx;
overflow: hidden;
}
.timeline-wrap {
position: relative;
min-height: 774rpx;
}
.time-axis {