保留预约暂不分配美甲师状态

This commit is contained in:
2026-10-29 15:34:38 +08:00
parent 6a278616a8
commit bb3d00c51e
3 changed files with 32 additions and 4 deletions
@@ -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 || '美甲师列表加载失败',