Files
MBTI_wang/miniprogram/pages/test-select/index.js
Ghost 1a66e77ab7 feat: 第三方渠道上下文与开放平台服务接入
1、修复了企业版/个人版在第三方入口下的人脸与测评跳转问题。

2、新增 ThirdPartyChannel/OpenPlatformService 及上下文 thirdPartyContext,补充相关迁移。

3、调整 Analyze/Auth/Test 等接口与小程序入口逻辑。

Made-with: Cursor
2026-04-03 14:18:34 +08:00

45 lines
824 B
JavaScript

// pages/test-select/index.js
const app = getApp()
Page({
data: {
permFace: true,
permMbti: true,
permPdp: true,
permDisc: true
},
onLoad(options) {
try {
require('../../utils/thirdPartyContext.js').ingestThirdPartyOnPageLoad(options || {}, app)
} catch (e) {}
this._syncPerms()
},
onShow() {
this._syncPerms()
},
_syncPerms() {
const p = app.globalData.enterprisePermissions
this.setData({
permFace: !p || p.face !== false,
permMbti: !p || p.mbti !== false,
permPdp: !p || p.pdp !== false,
permDisc: !p || p.disc !== false
})
},
goMBTI() {
wx.navigateTo({ url: '/pages/test/mbti' })
},
goPDP() {
wx.navigateTo({ url: '/pages/test/pdp' })
},
goDISC() {
wx.navigateTo({ url: '/pages/test/disc' })
}
})