信达小程序
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.

111 lines
2.7 KiB

4 months ago
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,
},
4 months ago
zdUserInfo: {},
4 months ago
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,
})
4 months ago
app.zdWaitLogin({ isReg: false }).then(() => {
4 months ago
app.zdMpBehavior({ PageName: 'PG_PATIENTASSESSMENTSTART' })
4 months ago
app.getZdUserInfo(this, true)
4 months ago
this.getAdlScore()
if (options.adlPushId) {
wx.ajax({
method: 'POST',
url: '?r=xd/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')
) {
4 months ago
app.zdPermissionVerification(3, 15, `/patient/pages/index/index`).then(() => {
4 months ago
wx.reLaunch({
4 months ago
url: '/patient/pages/index/index',
4 months ago
})
})
} else {
resolve(true)
}
})
},
getAdlScore() {
wx.ajax({
method: 'GET',
url: '?r=xd/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({
4 months ago
url: '/patient/pages/adlShare/index',
4 months ago
})
},
handleTest() {
app.zdMpBehavior({ PageName: 'BTN_PATIENTASSESSMENTSTART' })
wx.navigateTo({
4 months ago
url: `/patient/pages/adlTest/index?m_d=${this.data.m_d}&nrdl=${this.data.nrdl}`,
4 months ago
})
},
handleBack() {
wx.navigateBack()
},
onShareAppMessage() {
return {
title: 'MG-ADL测评表:评估重症肌无力患者症状对生活质量的影响',
4 months ago
path: '/patient/pages/adl/index',
4 months ago
}
},
})