12345678910111213141516171819202122232425262728293031323334 |
- //app.js
- App({
- onLaunch: function () {},
- onShow(res) {
- console.log(res)
- if (res.scene === 1038) {
- // 场景值1038:从被打开的小程序返回
- const {
- appId,
- extraData
- } = res.referrerInfo
- if (appId == "wxbcad394b3d99dac9") {
- // appId为wxbcad394b3d99dac9:从车主小程序跳转回来
- if (typeof extraData == "undefined") {
- // TODO
- // 客户端小程序不确定授权结果,需要发起‘用户状态查询接口’确认授权结果
- console.log("客户端小程序不确定授权结果")
- return
- }
- if (extraData.auth == "true") {
- // TODO
- // 客户端小程序授权成功
- console.log("客户端小程序授权成功")
- return
- } else {
- // TODO
- // 授权失败
- console.log("客户端小程序授权失败")
- return
- }
- }
- }
- },
- })
|