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.

109 lines
2.8 KiB

const app = getApp<IAppOption>()
1 month ago
Page({
data: {
doctor: {},
hospital: {},
toastShow: false,
toastType: '',
toastParams: {},
1 month ago
},
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',
4 weeks ago
url: '?r=igg4/doctor/account/info',
1 month ago
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,
})
},
4 weeks ago
handlePrivacy() {
wx.navigateTo({
4 weeks ago
url: '/doc/pages/privacyAgreement/index',
4 weeks ago
})
},
handleFollow() {
this.setData({ toastShow: true, toastType: 'follow', toastParams: { close: true } })
4 weeks ago
},
handleFeedback() {
this.setData({ toastShow: true, toastType: 'feedback', toastParams: { close: true } })
},
handleToastClose() {
this.setData({ toastShow: false, toastType: '' })
4 weeks ago
},
handleLogout() {
wx.showModal({
title: '确认退出?',
confirmColor: 'rgba(22, 121, 203, 1)',
success: (res) => {
if (res.confirm) {
wx.ajax({
method: 'POST',
4 weeks ago
url: '?r=igg4/doctor/account/reg-logout',
4 weeks ago
data: {},
}).then((_res) => {
app.globalData.loginType = 1
app.globalData.anyWhere = true
app.globalData.first = true
wx.reLaunch({
url: '/pages/login/index',
})
})
}
},
})
},
1 month ago
onShareAppMessage() {
return {
title: '愈见昕生,重拾生活掌控感!',
1 month ago
path: '/doctor/pages/d_my/index',
}
},
})