雅安论坛

标题: 小程序跳转到H5页面 [打印本页]

作者: 匿名    时间: 2022-1-3 18:59
标题: 小程序跳转到H5页面
小程序跳转到H5页面跳转之前需要把链接域名配置到合法域名当中
然后写一个跳转事件,后面可以带动态参数过去,然后新建一个webView页面
  1.         wx.navigateTo({
  2.             url: '../webView/webView?froms=' + that.data.froms ,
  3.           })
复制代码
然后在webView页面的wxml文件里面写上
  1. <web-view src="{{url}}"></web-view>   
复制代码
webView.js文件里写
  1.   data: {
  2.     url:null
  3.   },

  4.   /**
  5.    * 生命周期函数--监听页面加载
  6.    */
  7.   onLoad: function (options) {
  8.     let that = this
  9.     console.log(options.froms)
  10.     let yumin = "https://wxtest.suoluomei.com/hpl/index.php?s=/Weixin/ShopRewardRubbish/shownewusertwo/channel_id/"
  11.     that.setData({
  12.       url: yumin + options.froms +"/"  //拼接的跳转链接
  13.     })
  14.     console.log(that.data.url)
  15.   },
复制代码
文章来源:https://blog.csdn.net/hql1024/article/details/102758478感谢作者分享






欢迎光临 雅安论坛 (https://www.yaanbbs.net/) Powered by Discuz! X3.4