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.

142 lines
2.9 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.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) {
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',
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: '工程师正在努力建设中,敬请期待!',
})
}
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',
})
}
})
},
2 months ago
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',
})
2 months ago
},
handleMiniDoctor() {
wx.navigateTo({
url: '/pages/webview/index',
})
},
handleFeedback() {
wx.navigateTo({
url: '/pages/feedback/index',
})
},
handleToastClose() {
this.setData({ toastShow: false, toastType: '' })
},
2 months ago
})