import dayjs from 'dayjs' const app = getApp() Page({ data: { today: dayjs().format('YYYY年MM月DD日 dddd'), userInfo: {} as any, RegDay: 0, RegDaysName: '', integral: 0, selfScore: { expire: {}, }, adlNewRecord: {} as any, }, onLoad() { 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=zd/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=zd/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', }) }, })