新建H5頁(yè)面
在小程序里面新建一個(gè)名為H5的文件夾,以及H5頁(yè)面文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-851026.html
H5.WXML
<web-view src="{{h5Url}}" bindmessage="handleGetMessage"></web-view>
H5.JS
data: {
h5Url:'https://xxx.com/login' 要跳轉(zhuǎn)的H5頁(yè)面
},
H5回來(lái)的回調(diào)方法
handleGetMessage: function (e) {
console.log('handleGetMessage', e)
if (e.detail.data[0].result == 'success') {
// 確認(rèn)支用-簽約成功調(diào)用
}
},
onLoad(options){
H5跳轉(zhuǎn)回來(lái)后的參數(shù)在options里面
}
?Vue處理
在index.html里面新增
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
// 跳回小程序
goBackMini() {
wx.miniProgram.navigateTo({
url: `/pages/insure/pay?paymentNo=33&checkNo=222`, // 指定跳轉(zhuǎn)至小程序頁(yè)面的路徑
success: (res) => {
console.log(res); // 頁(yè)面跳轉(zhuǎn)成功的回調(diào)函數(shù)
},
fail: (err) => {
console.log(err); // 頁(yè)面跳轉(zhuǎn)失敗的回調(diào)函數(shù)
},
});
},
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-851026.html
到了這里,關(guān)于Vue項(xiàng)目(H5)與微信小程序來(lái)回跳轉(zhuǎn)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!