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.
 
 
 

138 lines
3.3 KiB

import dayjs from 'dayjs'
const app = getApp<IAppOption>()
Page({
data: {
today: dayjs().format('YYYY年MM月DD日 dddd'),
userInfo: {} as any,
RegDay: 0,
RegDaysName: '',
integral: 0,
selfScore: {
expire: {},
},
adlNewRecord: {} as any,
},
onLoad() {
app.getTheme().then((res) => {
this.setData({
theme: res,
})
})
const SystemInfo = app.globalSystemInfo
if (SystemInfo) {
const { bottom } = SystemInfo.capsulePosition
this.setData({
bottom,
})
}
wx.hideShareMenu()
},
onShow() {
app.waitLogin().then(() => {
app.mpBehavior({ PageName: 'PG_PATIENTMY' })
app.getUserInfo(this, true, () => {})
this.getScore()
})
},
getScore() {
wx.ajax({
method: 'GET',
url: '?r=igg4/patient-score/get-self-score',
data: {},
}).then((res) => {
this.setData({
selfScore: res,
})
})
},
handleMyHealthRecord(e) {
app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEHEALTHRECORD' })
const { url } = e.currentTarget.dataset
app.permissionVerification(3, 0, url).then(() => {
wx.navigateTo({
url,
})
})
},
handleFamily(e) {
app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEFAMILYMEMBERS' })
const { url } = e.currentTarget.dataset
app.permissionVerification(3, 0, url).then(() => {
wx.navigateTo({
url,
})
})
},
handleAdlChaneg(e) {
if (!e.detail) {
app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGECLOSEADLREMINDER' })
}
wx.ajax({
method: 'POST',
url: '?r=igg4/account/update-adl-notify-switch',
data: {
AdlNotifySwitch: e.detail ? 1 : 2,
},
}).then(() => {
app.getUserInfo(this, true)
})
},
routerTo(e) {
const { url } = e.currentTarget.dataset
if (!url) {
wx.showToast({
icon: 'none',
title: '工程师正在努力建设中,敬请期待!',
})
}
if (url === '/pages/mySave/index') {
app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEFAVORITES' })
}
if (url === '/pages/myLive/index') {
app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGESIGNEDUPMEETINGS' })
}
if (url === '/pages/personalInformation/index') {
app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEPERSONALINFO' })
}
if (url === '/pages/storyList/index') {
app.mpBehavior({ PageName: 'BTN_PATIENTMYPAGEMYSTORIES' })
}
wx.navigateTo({
url,
})
},
routerVipTo() {
const { MedicineAuditSwitch, UseDrugsAuditStatus, isFollow } = this.data.userInfo
if (MedicineAuditSwitch === '0') {
wx.navigateTo({
url: '/pages/vipLogin/index',
})
} else if (MedicineAuditSwitch === '1') {
const pendPath = {
0: '/gift/pages/vipPending/index',
1: '/gift/pages/vipStartPending/index',
}[isFollow]
const url = {
1: pendPath,
2: '/gift/pages/vipReject/index',
}[UseDrugsAuditStatus]
wx.navigateTo({
url: url || '/gift/pages/vipCert/index',
})
} else {
wx.showToast({
icon: 'none',
title: '工程师正在努力建设中,敬请期待!',
})
}
},
handleMiniDoctor() {
wx.navigateTo({
url: '/pages/webview/index',
})
},
})