This commit is contained in:
@@ -6,6 +6,7 @@ const { uploadProfileImage } = require('../../utils/upload')
|
||||
const { normalizeAvatar } = require('../../utils/profile-card')
|
||||
const profileCache = require('../../utils/profile-cache')
|
||||
const employeesApi = require('../../api/employees')
|
||||
const { showErrorToast } = require('../../utils/toast')
|
||||
|
||||
function canCreateAppointment() {
|
||||
const app = getApp()
|
||||
@@ -287,7 +288,7 @@ Page({
|
||||
'profileForm.avatarFileId': uploaded && uploaded.fileId ? String(uploaded.fileId) : ''
|
||||
})
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '头像上传失败', icon: 'none' })
|
||||
showErrorToast(error, '头像上传失败')
|
||||
} finally {
|
||||
this.setData({ profileSaving: false })
|
||||
}
|
||||
@@ -313,7 +314,7 @@ Page({
|
||||
this.setData({ profilePromptVisible: false })
|
||||
wx.showToast({ title: '资料已保存', duration: 3000 })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '资料保存失败', icon: 'none', duration: 3000 })
|
||||
showErrorToast(error, '资料保存失败', { duration: 3000 })
|
||||
} finally {
|
||||
this.setData({ profileSaving: false })
|
||||
}
|
||||
@@ -872,7 +873,7 @@ Page({
|
||||
wx.showToast({ title: Number(event.currentTarget.dataset.status) === 2 ? '补单已完成' : '预约已确认', icon: 'success' })
|
||||
this.loadCalendar()
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '预约状态更新失败', icon: 'none' })
|
||||
showErrorToast(error, '预约状态更新失败')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -903,7 +904,7 @@ Page({
|
||||
wx.showToast({ title: '预约已取消', icon: 'success' })
|
||||
this.loadCalendar()
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '预约取消失败', icon: 'none' })
|
||||
showErrorToast(error, '预约取消失败')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user