小程序跳转到H5页面
小程序跳转到H5页面跳转之前需要把链接域名配置到合法域名当中然后写一个跳转事件,后面可以带动态参数过去,然后新建一个webView页面
wx.navigateTo({
url: '../webView/webView?froms=' + that.data.froms ,
})
然后在webView页面的wxml文件里面写上
<web-view src="{{url}}"></web-view> webView.js文件里写
data: {
url:null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let that = this
console.log(options.froms)
let yumin = "https://wxtest.suoluomei.com/hpl/index.php?s=/Weixin/ShopRewardRubbish/shownewusertwo/channel_id/"
that.setData({
url: yumin + options.froms +"/"//拼接的跳转链接
})
console.log(that.data.url)
},
文章来源:https://blog.csdn.net/hql1024/article/details/102758478感谢作者分享
页:
[1]