保存客户资料与员工排班改造阶段成果

This commit is contained in:
2026-10-29 18:32:45 +08:00
parent 762be0d907
commit 369f58d24e
11 changed files with 152 additions and 18 deletions
@@ -129,7 +129,7 @@ Page({
url: `/pages/schedule-setting/index?${query.join('&')}`,
success: result => {
result.eventChannel.on('scheduleSaved', () => {
setTimeout(() => this.finishCreated(true, true), 250)
setTimeout(() => this.finishCreated(this.data.pickerMode, true), 250)
})
}
})
@@ -147,7 +147,7 @@ Page({
status: 1,
remark: '新建美甲师默认全天可预约,可在排班设置中调整'
}).then(() => {
this.finishCreated(!this.data.pickerMode, true)
this.finishCreated(this.data.pickerMode, true)
}).catch(error => {
wx.showModal({
title: '默认排班设置失败',
@@ -38,6 +38,7 @@ async function run() {
page.onInput({ currentTarget: { dataset: { field: 'phone' } }, detail: { value: '13900139000' } })
assert.strictEqual(page.data.form.account, 'staff_zhou')
assert.strictEqual(page.data.form.color, '#8FB89A')
Object.assign(page.data.form, {
nickname: '小周',
phone: '13800138000',
@@ -53,16 +54,19 @@ async function run() {
await page.submit()
assert.strictEqual(page.data.onboardingVisible, true)
assert.strictEqual(emitted, undefined)
let schedulePayload
page.data.pickerMode = true
employeesApi.saveScheduleRule = async payload => {
assert.deepStrictEqual(payload.workDays, [1, 2, 3, 4, 5, 6, 7])
assert.strictEqual(payload.startTime, '00:00')
assert.strictEqual(payload.endTime, '23:59')
schedulePayload = payload
}
page.skipFirstSchedule()
await new Promise(resolve => setImmediate(resolve))
assert.deepStrictEqual(schedulePayload.workDays, [1, 2, 3, 4, 5, 6, 7])
assert.strictEqual(schedulePayload.startTime, '00:00')
assert.strictEqual(schedulePayload.endTime, '23:59')
assert.strictEqual(emitted.name, 'employeeCreated')
assert.deepStrictEqual(emitted.value, { id: 88, name: '小周', title: '小周', avatar: '', autoSelect: false, scheduleSaved: false })
assert.deepStrictEqual(emitted.value, { id: 88, name: '小周', title: '小周', avatar: '', autoSelect: true, scheduleSaved: true })
assert.strictEqual(navigatedBack, true)
page.data.onboardingVisible = true
+15 -2
View File
@@ -90,8 +90,21 @@ async function run() {
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.match(planningWxss, /background-size:\s*100% 240rpx/)
assert.match(planningWxss, /\.control-card\s*\{[^}]*padding:\s*12rpx 16rpx;/)
const shortAppointmentState = dayPage.buildDayView({
businessStartTime: '10:30',
businessEndTime: '11:30',
artists: [{ id: 1, name: '美甲师', color: '#000' }],
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)
const shortAppointmentLane = shortAppointmentState.dayLanes.find(lane => lane.artistId === 1)
assert.strictEqual(shortAppointmentLane.blocks[0].height, 60)
assert.strictEqual(shortAppointmentLane.blocks[0].compact, true)
assert.match(planningWxml, /class="hour-line" style="top: \{\{hour\.top\}\}rpx;"/)
assert.match(planningWxml, /class="time-label" style="top: \{\{item\.top\}\}rpx;"/)
assert.doesNotMatch(planningWxss, /background-size:\s*100% 240rpx/)
assert.match(planningWxss, /\.control-card\s*\{[^}]*padding:\s*8rpx 14rpx;/)
const requestPage = createPage({ viewMode: 'day', currentDateText: '2026-10-11' })
let calendarRequests = 0
+1 -2
View File
@@ -95,10 +95,10 @@
<view class="chip-dot" style="background: {{item.color}};"></view>
<text>{{item.name}}</text>
</view>
<view wx:for="{{hours}}" wx:for-item="hour" wx:key="value" class="hour-line" style="top: {{hour.top}}rpx;"></view>
<view wx:for="{{item.blocks}}" wx:for-item="block" wx:key="orderItemId" class="appointment-block {{block.status === 0 ? 'pending' : ''}} {{block.compact ? 'compact' : ''}}" style="top: {{block.top}}rpx; height: {{block.height}}rpx; border-left-color: {{item.color}};" data-id="{{block.orderItemId}}" bindtap="openAppointment">
<text class="block-title">{{block.customerName}}</text>
<text class="block-meta">{{block.timeText}} · {{block.productTitle}}</text>
<view class="block-footer">
<view class="block-footer">
<text class="block-status">{{block.statusText}}</text>
<view class="block-actions" catchtap="stopTap">
@@ -108,7 +108,6 @@
<text wx:if="{{block.historicalBackfill && block.status === 4}}" data-id="{{block.orderItemId}}" data-status="2" catchtap="quickUpdateStatus">完成</text>
</view>
</view>
</view>
</view>
<view wx:if="{{item.blocks.length === 0}}" class="lane-empty">{{item.emptyText || '全天可约'}}</view>
</view>
+12 -3
View File
@@ -344,9 +344,17 @@
position: relative;
flex-shrink: 0;
border-right: 1rpx solid #e7ece9;
background-image: linear-gradient(to bottom, rgba(203, 220, 213, 0.45) 1rpx, transparent 1rpx);
background-position: 0 54rpx;
background-size: 100% 240rpx;
background: #ffffff;
}
.hour-line {
position: absolute;
z-index: 0;
right: 0;
left: 0;
height: 1rpx;
background: rgba(203, 220, 213, 0.72);
pointer-events: none;
}
.lane-head {
@@ -365,6 +373,7 @@
.appointment-block {
position: absolute;
z-index: 1;
right: 12rpx;
left: 12rpx;
display: flex;