From 6db992d73f71b4c2e110efc1341bdbc538999677 Mon Sep 17 00:00:00 2001 From: linfso Date: Fri, 20 Jun 2025 08:42:04 +0800 Subject: [PATCH] md --- src/views/openpage/onlinePay.vue | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/views/openpage/onlinePay.vue b/src/views/openpage/onlinePay.vue index 1f65202..839fe75 100644 --- a/src/views/openpage/onlinePay.vue +++ b/src/views/openpage/onlinePay.vue @@ -149,6 +149,7 @@ export default { }, created() { this.reset(); + const ua = window.navigator.userAgent.toLowerCase(); if (!ua.match(/MicroMessenger/i)) { this.isWx=false; } @@ -253,23 +254,18 @@ export default { }); }, handleWeixinPay(){ - const ua = window.navigator.userAgent.toLowerCase(); - if (!ua.match(/MicroMessenger/i)) { - this.isWx=false; - }else{ - 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; - const authUrl = this.generateAuthUrl("https://oms.tanex56.com/onlinePay","snsapi_base",this.billNo); - window.location.href = authUrl; - } - } + 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; + const authUrl = this.generateAuthUrl("https://oms.tanex56.com/onlinePay","snsapi_base",this.billNo); + window.location.href = authUrl; + } }, requestPayment(code,state) { this.loadingVisible = true;