diff --git a/src/views/openpage/onlinePay.vue b/src/views/openpage/onlinePay.vue index e3bb109..0975cd9 100644 --- a/src/views/openpage/onlinePay.vue +++ b/src/views/openpage/onlinePay.vue @@ -3,6 +3,8 @@ + +
{{ errorMessage }}
@@ -148,9 +150,9 @@ export default { }; }, created() { - const params = new URLSearchParams(window.location.search); - let code=params.get('code'); - let state=params.get('code'); + let code=this.$route.query.code; + let state=this.$route.query.state; + console.log("====>created==code=state=>",code,state); if (code) { this.requestPayment(code,state); }else{ @@ -273,12 +275,13 @@ export default { state: state }) .then(response => { + console.log("===>requestPayment==response=>",response.data); this.loadingVisible = false; - if (response.data.code === 200) { - this.wechatPaymentParams = response.data.data; + if (response.code === 200) { + this.wechatPaymentParams = response.data; this.invokeWechatPayment(); } else { - this.showPaymentResult(false, response.data.message || '获取支付参数失败'); + this.showPaymentResult(false, response.message || '获取支付参数失败'); } }) .catch(error => {