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: {}, }, toastShow: false, toastType: '', toastParams: {}, adlNewRecord: {} as any, }, onLoad() { const SystemInfo = app.globalSystemInfo if (SystemInfo) { const { bottom } = SystemInfo.capsulePosition this.setData({ bottom, }) } wx.hideShareMenu() }, onShow() { app.waitLogin().then(() => { 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) { const { url } = e.currentTarget.dataset app.permissionVerification(3, 0, url).then(() => { wx.navigateTo({ url, }) }) }, handleFamily(e) { const { url } = e.currentTarget.dataset app.permissionVerification(3, 0, url).then(() => { wx.navigateTo({ url, }) }) }, handleAdlChaneg(e) { 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: '工程师正在努力建设中,敬请期待!', }) } wx.navigateTo({ url, }) }, handleQaForm() { wx.ajax({ method: 'GET', url: '?r=igg4/health-question/get-patient-questionnaire', data: {}, showMsg: false, }).then((res: any) => { const answers = res.questions || [] if (answers.length) { wx.navigateTo({ url: '/pages/qaFormDetail/index', }) } else { wx.navigateTo({ url: '/pages/qaForm/index', }) } }) }, routerVipTo() { const { UseDrugsAuditStatus, UserType } = this.data.userInfo if (!UserType) { app.getUserInfo(this, true, () => { this.routerVipTo() }) return } if (UserType == 4) { wx.navigateTo({ url: '/pages/certReslove/index', }) return } const url = { 1: '/gift/pages/vipPending/index', 2: '/gift/pages/vipReject/index', }[UseDrugsAuditStatus] wx.navigateTo({ url: url || '/gift/pages/vipCert/index', }) }, handleMiniDoctor() { wx.navigateTo({ url: '/pages/webview/index', }) }, handleFeedback() { wx.navigateTo({ url: '/pages/feedback/index', }) }, handleToastClose() { this.setData({ toastShow: false, toastType: '' }) }, })