From 6ab7cc8c3fe8ce7be4cfb0449b0663282028648b Mon Sep 17 00:00:00 2001 From: liuqimichale <123456lq> Date: Tue, 26 Jan 2021 10:53:51 +0800 Subject: [PATCH] 赤峰 微信支付 --- src/components/orderPay.vue | 10 +++++----- src/components/parkRecord.vue | 4 +++- src/utils/utils.js | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/orderPay.vue b/src/components/orderPay.vue index 0305e1e..30cb9d7 100644 --- a/src/components/orderPay.vue +++ b/src/components/orderPay.vue @@ -76,7 +76,7 @@ export default { methods: { getCode() { var appID = this.$utils.myVxAppId; - var code = this.getUrlParamfunction(code) + var code = this.getUrlParam('code'); var local = window.location.href; if (code == null || code === '') { window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appID + '&redirect_uri=' + encodeURIComponent(local) + '&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect' @@ -84,7 +84,7 @@ export default { return code; } }, - getUrlParamfunction(name) { + getUrlParam(name) { var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); var r = window.location.search.substr(1).match(reg) if (r != null) return unescape(r[2]) @@ -149,6 +149,7 @@ export default { }, vxPay(openIdData, orderIdData) { + let vm = this var wxParams = {}; wxParams.orderId = orderIdData; wxParams.backType = 2, @@ -162,7 +163,6 @@ export default { wxParams.appId = this.$utils.myVxAppId; vxPayQuery(wxParams).then(res => { if (res.code == 0) { // - //alertMsg("出场成功"); if (res.data) { var data = res.data; console.log(JSON.stringify(data)); @@ -186,9 +186,8 @@ export default { } }) }, - onBridgeReady(data) { + onBridgeReady(params) { console.log('调用微信支付WeixinJSBridge') - var vm = this WeixinJSBridge.invoke( 'getBrandWCPayRequest', params, // @@ -204,6 +203,7 @@ export default { // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 if (res.err_msg === 'get_brand_wcpay_request:ok') { console.log('成功') + alert('支付成功') } else { console.log('失败') alert('支付失败') diff --git a/src/components/parkRecord.vue b/src/components/parkRecord.vue index 1e4e653..9072e01 100644 --- a/src/components/parkRecord.vue +++ b/src/components/parkRecord.vue @@ -310,12 +310,14 @@ export default { console.log(response) let res = response.data.carArrearages[0] console.log(res) + this.orderIds = JSON.stringify(this.orderIds) + console.log(this.orderIds) this.$router.push( { path:'orderPay', query:{ - carColor:0,// 车牌颜色 + carColor: this.carColor,// 车牌颜色 arrearageTotalFee: res.arrearageTotalFee,// 应收 arrearageDiscFee: res.arrearageDiscFee,// 优惠 arrearageActFee: res.arrearageActFee,// 实收 diff --git a/src/utils/utils.js b/src/utils/utils.js index a9151b8..5d9c564 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -95,7 +95,7 @@ export default { myDeviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E', // 公共请求设备信息 - myVxAppId: 'wx2af2bab90d433c86', + myVxAppId: 'wxff4cebaedbf4f886', // 测试环境 微信赤峰 appid wxff4cebaedbf4f886 // 微信赤峰 appid wx2af2bab90d433c86 // 黄石 appid wxa1a66cc7d263afe6 -- libgit2 0.21.4