赞
踩
在小程序里面新建一个名为H5的文件夹,以及H5页面
- H5.WXML
- <web-view src="{{h5Url}}" bindmessage="handleGetMessage"></web-view>
-
- H5.JS
- data: {
- h5Url:'https://xxx.com/login' 要跳转的H5页面
- },
-
- H5回来的回调方法
- handleGetMessage: function (e) {
- console.log('handleGetMessage', e)
- if (e.detail.data[0].result == 'success') {
- // 确认支用-签约成功调用
- }
- },
-
- onLoad(options){
-
- H5跳转回来后的参数在options里面
-
- }
- 在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`, // 指定跳转至小程序页面的路径
- success: (res) => {
- console.log(res); // 页面跳转成功的回调函数
- },
- fail: (err) => {
- console.log(err); // 页面跳转失败的回调函数
- },
- });
- },
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。