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.

127 lines
3.0 KiB

2 months ago
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: {},
},
toastShow: false,
toastType: '',
toastParams: {},
2 months ago
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',
2 months ago
url: '?r=igg4/patient-score/get-self-score',
2 months ago
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',
2 months ago
url: '?r=igg4/account/update-adl-notify-switch',
2 months ago
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 { UseDrugsAuditStatus } = this.data.userInfo
const url = {
1: '/gift/pages/vipPending/index',
2: '/gift/pages/vipReject/index',
}[UseDrugsAuditStatus]
wx.navigateTo({
url: url || '/gift/pages/vipCert/index',
})
2 months ago
},
handleMiniDoctor() {
wx.navigateTo({
url: '/pages/webview/index',
})
},
handleFeedback() {
this.setData({ toastShow: true, toastType: 'feedback', toastParams: { close: true } })
},
handleToastClose() {
this.setData({ toastShow: false, toastType: '' })
},
2 months ago
})