功能:支持待分配预约与首次排班引导
This commit is contained in:
@@ -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: '知道了' })
|
||||
|
||||
Reference in New Issue
Block a user