关于微信小程序:微信小程序跳转外部h5微信webview浏览器代码技术

3次阅读

共计 990 个字符,预计需要花费 3 分钟才能阅读完成。

最近笔者钻研技术发现如何应用内部跳转微信小程序的技术都是利用 urlscheme 的调用技术来实现的,如何去微信小程序去跳转到内部微信浏览器 webview 关上网页,而且不须要验证业务域名的办法呢,笔者通过大量的逆向微信测试调试,总结以下代码技术。


咱们先来配置微信凋谢环境,代码截图如下。

外围代码如下,如何去是实现跳转内部微信 webview 的技术。

代码如下:

// www.wxticket.com 微信小程序跳转内部 h5 技术 webview 办法代码 qq904999988

Page({
return wx.navigateTo({

    url: `/pages/webView/webView?url=${defaultUrl}`
  })

data: {

weRunResult: '',
userInfoResult: '',

},

onGetWeRunData() {

wx.getWeRunData({
  success: res => {
    wx.cloud.callFunction({
      name: 'echo',
      data: {
        // info 字段在云函数 event 对象中会被主动替换为相应的敏感数据
        info: wx.cloud.CloudID(res.cloudID),
      },
    }).then(res => {console.log('[onGetWeRunData] 收到 echo 回包:', res)

      this.setData({weRunResult: JSON.stringify(res.result),
      })

      wx.showToast({title: '敏感数据获取胜利',})
    }).catch(err => {console.log('[onGetWeRunData] 失败:', err)
    })
  }
})

},

onGetUserInfo(e) {

console.log(e)
wx.cloud.callFunction({
  name: 'openapi',
  data: {
    action: 'getOpenData',
    openData: {
      list: [e.detail.cloudID,]
    }
  }
}).then(res => {console.log('[onGetUserInfo] 调用胜利:', res)

  this.setData({userInfoResult: JSON.stringify(res.result),
  })

  wx.showToast({title: '敏感数据获取胜利',})
})

}

正文完
 0