Files
JayuCloud/FM-Wechat-Fronted/pages/customer-detail/index.js
T

40 lines
1.0 KiB
JavaScript

function canCreateAppointment() {
const app = getApp()
const userInfo = app.globalData.userInfo || {}
return Number(userInfo.type) !== 3
}
Page({
data: {
id: '',
canCreateAppointment: true,
avatarText: '客',
customer: { name: '王女士', phone: '138****1201' },
stats: { orderCount: 12, amount: 2860, lastTime: '06-01' },
orders: [
{ id: 1, date: '2026-06-01', project: '纯色美甲', amount: 168, artist: '小王' },
{ id: 2, date: '2026-05-18', project: '猫眼延长', amount: 268, artist: '小李' },
{ id: 3, date: '2026-05-02', project: '手部护理', amount: 98, artist: '小张' }
]
},
onLoad(options) {
this.setData({
id: options.id || '',
canCreateAppointment: canCreateAppointment()
})
},
createAppointment() {
if (!this.data.canCreateAppointment) {
wx.showToast({ title: '美甲师账号只能查看预约', icon: 'none' })
return
}
wx.navigateTo({ url: '/pages/appointment-form/index' })
},
back() {
wx.navigateBack()
}
})