修复管理师端预约与登录体验

This commit is contained in:
2026-06-26 11:07:54 +08:00
parent f1fdf6e5d3
commit 078a2b32cd
48 changed files with 1044 additions and 276 deletions
@@ -1,12 +1,12 @@
const planningApi = require('../../api/planning')
const mock = require('../../utils/mock')
Page({
data: {
id: '',
appointment: {},
avatarText: '',
timeText: ''
timeText: '',
loadError: ''
},
onLoad(options) {
@@ -19,8 +19,12 @@ Page({
const appointment = await planningApi.appointment(this.data.id)
this.applyAppointment(appointment)
} catch (error) {
const demo = mock.buildCalendar(new Date()).appointments[0]
this.applyAppointment(demo)
this.setData({
appointment: {},
avatarText: '',
timeText: '',
loadError: error.message || '预约详情加载失败'
})
}
},
@@ -28,7 +32,8 @@ Page({
this.setData({
appointment,
avatarText: String(appointment.customerName || '客').slice(0, 1),
timeText: `${(appointment.startTime || '').slice(0, 16)} - ${(appointment.endTime || '').slice(11, 16)}`
timeText: `${(appointment.startTime || '').slice(0, 16)} - ${(appointment.endTime || '').slice(11, 16)}`,
loadError: ''
})
},