You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.8 KiB

1 month ago
const app = getApp<IAppOption>()
Page({
data: {
doctor: {},
hospital: {},
},
onLoad() {
const SystemInfo = app.globalSystemInfo
if (SystemInfo) {
const { top, bottom } = SystemInfo.capsulePosition
this.setData({
top,
bottom,
})
}
},
onShow() {
app.waitLogin().then((_res) => {
app.mpBehavior({ doctor: true, PageName: 'PG_DOCTORMY' })
this.getDetail()
})
},
getDetail() {
wx.ajax({
method: 'GET',
url: '?r=igg4/doctor/account/info',
data: {},
}).then((res) => {
let weekName = ''
if (res.doctor.ClinicType == 2) {
weekName = res.doctor.Clinic
} else {
weekName = (res.doctor.Clinic ? res.doctor.Clinic : [])
.map((subItem: { weekday: string | number; timeType: string | number }) => {
const week = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
const timeDay = { 1: '上午', 2: '下午' }
return `${week[Number(subItem.weekday) - 1]}${timeDay[subItem.timeType]}`
})
.join(',')
}
this.setData({
doctor: {
weekName,
...res.doctor,
},
hospital: res.hospital,
})
})
},
handleRouter(e) {
const { url } = e.currentTarget.dataset
if (url === '/doctor/pages/d_invite/index') {
app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORMYPAGEINVITEDPATIENTS' })
}
if (url === '/doctor/pages/d_userInfo/index') {
app.mpBehavior({ doctor: true, PageName: 'BTN_DOCTORMYPAGEPERSONALINFO' })
}
wx.navigateTo({
url,
})
},
onShareAppMessage() {
return {
title: '重症肌无力加油站,重拾生活掌控感!',
path: '/doctor/pages/d_my/index',
}
},
})