zoukankan      html  css  js  c++  java
  • 微信支付完成 vue 页面不跳转问题

    遇到的问题是 vue 调用微信支付 回调成功以后,页面路由不跳转。

    解决的办法是用window.location.href

    /**
    * @method 支付费用方法
    * @param data:后台返回的支付对象,(详情微信公众号支付API中H5提交支付);
    */
    onBridgeReady(params){
    var vm = this;
    WeixinJSBridge.invoke(
    'getBrandWCPayRequest',params,
    function(res){
    // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
    // if(localStorage.getItem('activityId')=='4'){
    // alert(JSON.stringify(res));
    // }
    var temp =res.err_msg;
    if(temp.indexOf('ok')>-1){
    // this.$router.push('/payShare');
    window.location.href = "https://www.lnart.com/vipidea-subscribe/index.html#/payShare"
    }else{
    alert("支付失败")
    }
    // if(res.err_msg == "get_brand_wcpay_request:ok" ){
    // this.$router.push('/payShare');
    // this.addaddress();
    // window.location.href = "https://www.lnart.com/vipidea-subscribe/index.html#/payShare"
    // }else{
    // this.$message({
    // message: '支付失败',
    // type: 'warning'
    // });
    // }
    }
    );
    },
     
  • 相关阅读:
    中文版CorelDRAW X8实战视频教程
    21天学通Java6(第5版)
    SAS高级统计分析教程(第2版)
    Access2007开发指南(修订版)
    Visual C++开发入行真功夫
    21天学编程系列:21天学通Java(第4版)
    102. Binary Tree Level Order Traversal
    78. Subsets
    79. Word Search
    46. Permutations
  • 原文地址:https://www.cnblogs.com/wupeng88/p/11780338.html
Copyright © 2011-2022 走看看