雅安论坛
标题:
小程序跳转到H5页面
[打印本页]
作者:
匿名
时间:
2022-1-3 18:59
标题:
小程序跳转到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
感谢作者分享
欢迎光临 雅安论坛 (https://www.yaanbbs.net/)
Powered by Discuz! X3.4