修复管理师端预约与登录体验
This commit is contained in:
@@ -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: ''
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user