This commit is contained in:
linfso 2025-06-20 10:22:05 +08:00
parent 61fe15bf1c
commit ff710d5f07

View File

@ -148,12 +148,19 @@ export default {
}; };
}, },
created() { created() {
const params = new URLSearchParams(window.location.search);
let code=params.get('code');
let state=params.get('code');
if (code) {
this.requestPayment(code,state);
}else{
this.reset(); this.reset();
const ua = window.navigator.userAgent.toLowerCase(); const ua = window.navigator.userAgent.toLowerCase();
if (!ua.match(/MicroMessenger/i)) { if (!ua.match(/MicroMessenger/i)) {
this.isWx=false; this.isWx=false;
} }
this.initPayOrder(); this.initPayOrder();
}
}, },
methods: { methods: {
// 表单重置 // 表单重置
@ -254,18 +261,9 @@ export default {
}); });
}, },
handleWeixinPay(){ handleWeixinPay(){
const params = new URLSearchParams(window.location.search);
let code=params.get('code');
let state=params.get('code');
// 如果是微信回调,拉起微信支付
if (code) {
this.requestPayment(code,state);
}
else{
this.billNo = this.$route.query.bid; this.billNo = this.$route.query.bid;
const authUrl = this.generateAuthUrl("https://oms.tanex56.com/onlinePay","snsapi_base",this.billNo); const authUrl = this.generateAuthUrl("https://oms.tanex56.com/onlinePay","snsapi_base",this.billNo);
window.location.href = authUrl; window.location.href = authUrl;
}
}, },
requestPayment(code,state) { requestPayment(code,state) {
this.loadingVisible = true; this.loadingVisible = true;