Vue项目(H5)与微信小程序来回跳转

新建H5页面

在小程序里面新建一个名为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里面

}
 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`, // 指定跳转至小程序页面的路径
        success: (res) => {
          console.log(res); // 页面跳转成功的回调函数
        },
        fail: (err) => {
          console.log(err); // 页面跳转失败的回调函数
        },
      });
    },

相关推荐

  1. Vue项目(H5)程序来回

    2024-04-11 12:34:03       36 阅读
  2. 程序页面

    2024-04-11 12:34:03       63 阅读
  3. 程序webView

    2024-04-11 12:34:03       41 阅读
  4. 程序到外部程序

    2024-04-11 12:34:03       60 阅读
  5. h5唤起程序

    2024-04-11 12:34:03       41 阅读
  6. vue3程序成功案例,报错分析

    2024-04-11 12:34:03       59 阅读
  7. 程序页面方法

    2024-04-11 12:34:03       63 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-11 12:34:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-11 12:34:03       101 阅读
  3. 在Django里面运行非项目文件

    2024-04-11 12:34:03       82 阅读
  4. Python语言-面向对象

    2024-04-11 12:34:03       91 阅读

热门阅读

  1. 微信小程序(总结)

    2024-04-11 12:34:03       36 阅读
  2. 使用Docker安装Kafka

    2024-04-11 12:34:03       37 阅读
  3. 简单聊聊,聚合支付+分账系统体系的运用

    2024-04-11 12:34:03       38 阅读
  4. 110.平衡二叉树

    2024-04-11 12:34:03       37 阅读
  5. Qt事件机制

    2024-04-11 12:34:03       39 阅读
  6. 3.12 Python赋值运算符

    2024-04-11 12:34:03       31 阅读
  7. KISS 原则和 YAGNI原则

    2024-04-11 12:34:03       39 阅读
  8. 「PHP系列」PHP超级全局变量详解

    2024-04-11 12:34:03       28 阅读
  9. 基于Spring Boot的宠物咖啡馆平台的设计与实现

    2024-04-11 12:34:03       37 阅读
  10. 【Linux】tcpdump P1 - 网络过滤选项

    2024-04-11 12:34:03       42 阅读
  11. git修改某个远端服务器的地址的方式以及4种remote

    2024-04-11 12:34:03       35 阅读