• 微信支付完成 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'
    // });
    // }
    }
    );
    },
     
  • 相关阅读:
    day32-python阶段性复习六
    golang 项目中坑
    golang crawler
    router
    golang in ubuntu
    go channel 案例分析
    go channel learning
    bee go + mgo
    URL escape and unescape
    [转]good sample of Go
  • 原文地址:https://www.cnblogs.com/wupeng88/p/11780338.html
Copyright © 2020-2023  润新知