|
|
|
|
const app = getApp<IAppOption>()
|
|
|
|
|
|
|
|
|
|
Page({
|
|
|
|
|
data: {
|
|
|
|
|
pageShow: false,
|
|
|
|
|
audio: {
|
|
|
|
|
url: 'https://voice-hb.oss-cn-beijing.aliyuncs.com/zaiding/voice_1690445548-5.mp3',
|
|
|
|
|
size: 50,
|
|
|
|
|
},
|
|
|
|
|
zdUserInfo: {},
|
|
|
|
|
|
|
|
|
|
m_d: '',
|
|
|
|
|
nrdl: '',
|
|
|
|
|
|
|
|
|
|
rewardScore: undefined,
|
|
|
|
|
|
|
|
|
|
bottom: wx.getMenuButtonBoundingClientRect().bottom,
|
|
|
|
|
},
|
|
|
|
|
videoContext: null as WechatMiniprogram.VideoContext | null,
|
|
|
|
|
async onLoad(options) {
|
|
|
|
|
await this.handleScene(options)
|
|
|
|
|
|
|
|
|
|
this.videoContext = wx.createVideoContext('video')
|
|
|
|
|
|
|
|
|
|
this.setData({
|
|
|
|
|
m_d: options.m_d,
|
|
|
|
|
nrdl: options.nrdl,
|
|
|
|
|
})
|
|
|
|
|
app.zdWaitLogin({ isReg: false }).then(() => {
|
|
|
|
|
app.zdMpBehavior({ PageName: 'PG_PATIENTASSESSMENTSTART' })
|
|
|
|
|
app.getZdUserInfo(this, true)
|
|
|
|
|
this.getAdlScore()
|
|
|
|
|
if (options.adlPushId) {
|
|
|
|
|
wx.ajax({
|
|
|
|
|
method: 'POST',
|
|
|
|
|
url: '?r=zd/push-click/adl-push-click',
|
|
|
|
|
data: { adlPushId: options.adlPushId },
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (options.es === '201502') {
|
|
|
|
|
app.globalData.IsAliQiWei = 1
|
|
|
|
|
app.zdMpBehavior({ PageName: 'JUMP_INSURANCE_ADL_PAGE' })
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 拦截通过小程序码进入的场景
|
|
|
|
|
handleScene(options: any) {
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
console.log(options)
|
|
|
|
|
const { scene, ...reset } = wx.getLaunchOptionsSync()
|
|
|
|
|
console.log(scene)
|
|
|
|
|
console.log(reset)
|
|
|
|
|
if (
|
|
|
|
|
[1047, 1048, 1049, 1089].includes(scene) &&
|
|
|
|
|
options.scene?.includes('doctorId') &&
|
|
|
|
|
options.scene?.includes('inviteChan')
|
|
|
|
|
) {
|
|
|
|
|
app.zdPermissionVerification(3, 15, `/patient/pages/index/index`).then(() => {
|
|
|
|
|
wx.reLaunch({
|
|
|
|
|
url: '/patient/pages/index/index',
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
resolve(true)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getAdlScore() {
|
|
|
|
|
wx.ajax({
|
|
|
|
|
method: 'GET',
|
|
|
|
|
url: '?r=zd/adl/get-score',
|
|
|
|
|
data: {},
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.setData({
|
|
|
|
|
rewardScore: res.rewardScore,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handlePlay() {
|
|
|
|
|
this.videoContext?.play()
|
|
|
|
|
this.videoContext?.requestFullScreen({})
|
|
|
|
|
},
|
|
|
|
|
handleFullScreen(e) {
|
|
|
|
|
if (!e.detail.fullScreen) {
|
|
|
|
|
this.videoContext?.pause()
|
|
|
|
|
this.videoContext?.seek(0)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleShare() {
|
|
|
|
|
app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTSTARTSHARE' })
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: '/patient/pages/adlShare/index',
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleTest() {
|
|
|
|
|
app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTSTART' })
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: `/patient/pages/adlTest/index?m_d=${this.data.m_d}&nrdl=${this.data.nrdl}`,
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleBack() {
|
|
|
|
|
wx.navigateBack()
|
|
|
|
|
},
|
|
|
|
|
onShareAppMessage() {
|
|
|
|
|
return {
|
|
|
|
|
title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响',
|
|
|
|
|
path: '/patient/pages/adl/index',
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
})
|