保留预约暂不分配美甲师状态
This commit is contained in:
@@ -608,6 +608,9 @@ Page({
|
||||
},
|
||||
|
||||
async loadArtists(preferredArtistId, fallbackEmployee) {
|
||||
const unassignedSelection = preferredArtistId === undefined && this.data.selectedArtist.id === '__unassigned__'
|
||||
? this.data.selectedArtist
|
||||
: {}
|
||||
try {
|
||||
const calendar = await planningApi.calendar({
|
||||
startDate: this.data.form.appointmentDate,
|
||||
@@ -622,20 +625,22 @@ Page({
|
||||
avatar: fallbackEmployee.avatar || ''
|
||||
})
|
||||
}
|
||||
const selectedArtist = requestedId ? findArtist(artists, requestedId) : {}
|
||||
const selectedArtist = requestedId
|
||||
? findArtist(artists, requestedId)
|
||||
: unassignedSelection
|
||||
this.setData({
|
||||
artists,
|
||||
artistSelectorItems: this.filterArtistItems(artists, this.data.artistKeyword),
|
||||
selectedArtist,
|
||||
artistError: '',
|
||||
'form.artistId': selectedArtist.id || ''
|
||||
'form.artistId': selectedArtist.id === '__unassigned__' ? '' : selectedArtist.id || ''
|
||||
})
|
||||
this.refreshProductCards()
|
||||
} catch (error) {
|
||||
this.setData({
|
||||
artists: [],
|
||||
artistSelectorItems: [],
|
||||
selectedArtist: {},
|
||||
artistSelectorItems: this.filterArtistItems([], this.data.artistKeyword),
|
||||
selectedArtist: unassignedSelection,
|
||||
'form.artistId': '',
|
||||
artistError: error.message || '美甲师列表加载失败',
|
||||
conflictTip: error.message || '美甲师列表加载失败',
|
||||
|
||||
Reference in New Issue
Block a user