功能:支持待分配预约与首次排班引导

This commit is contained in:
2026-10-12 23:52:20 +08:00
parent 59608ef57f
commit 3ab615ccd4
26 changed files with 816 additions and 82 deletions
@@ -68,6 +68,9 @@ function buildExceptionSummary(item) {
Page({
data: {
artistId: '',
onboarding: false,
onboardingSource: '',
appointmentContextText: '',
presets: PRESETS,
presetOptions: buildPresetOptions('DOUBLE_REST'),
weekdays: WEEKDAYS,
@@ -95,7 +98,13 @@ Page({
},
onLoad(options) {
this.setData({ artistId: options.id || '' })
const contextParts = [options.date, options.time, options.durationMinutes ? `${options.durationMinutes}分钟` : ''].filter(Boolean)
this.setData({
artistId: options.id || '',
onboarding: options.onboarding === '1',
onboardingSource: options.source || '',
appointmentContextText: contextParts.join(' · ')
})
this.loadRule()
},
@@ -235,7 +244,13 @@ Page({
})
markPlanningRefresh()
wx.showToast({ title: '排班规则已保存', icon: 'success' })
await this.loadRule()
if (this.data.onboarding) {
const eventChannel = this.getOpenerEventChannel && this.getOpenerEventChannel()
if (eventChannel && eventChannel.emit) eventChannel.emit('scheduleSaved', { artistId: this.data.artistId })
setTimeout(() => wx.navigateBack(), 250)
} else {
await this.loadRule()
}
} catch (error) {
const message = error.message || '保存失败'
wx.showModal({ title: '排班保存失败', content: message, showCancel: false, confirmText: '知道了' })