微信支付完成 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'
// });
// }
}
);
},
 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM