From 8ecf38fbfa5fa30b6eb3f983f149948330c56709 Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Fri, 7 Jul 2023 12:22:26 +0800 Subject: [PATCH] 在停 聚合 支付 --- src/api/orderPay/orderPay.js | 7 +++++++ src/api/parkRecord/parkRecord.js | 17 ++++++++++++++--- src/components/orderPay.vue | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------- src/components/parkRecord.vue | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------- src/components/plateNumber.vue | 82 +++++++++++++++++++++++++++++++++++++++++++++------------------------------------- src/utils/request.js | 2 +- src/utils/utils.js | 44 +++++++++++++++++++++++++++++++++++++++++--- 7 files changed, 267 insertions(+), 148 deletions(-) diff --git a/src/api/orderPay/orderPay.js b/src/api/orderPay/orderPay.js index 0a9d574..b83d814 100644 --- a/src/api/orderPay/orderPay.js +++ b/src/api/orderPay/orderPay.js @@ -45,6 +45,13 @@ export function queryParkingRecordPageByCarNumbers(params) { // 支付完成后 +export function doPay(params) { // 支付信息获取 + return request({ + url: 'allInPay/doPay', + method: 'post', + data: params + }) +} diff --git a/src/api/parkRecord/parkRecord.js b/src/api/parkRecord/parkRecord.js index d785cb6..86aa32d 100644 --- a/src/api/parkRecord/parkRecord.js +++ b/src/api/parkRecord/parkRecord.js @@ -33,8 +33,19 @@ export function appApplyParkOut(params) { // 0元出场 }) } +export function queryArrearageSta(params) { // 查询补缴订单详情 + return request({ + url: 'queryParkOrder/queryArrearageSta', + method: 'post', + data: params + }) +} - - - +export function doOrderCreate(params) { // 查询补缴订单详情 + return request({ + url: 'allInPay/doOrderCreate', + method: 'post', + data: params + }) +} diff --git a/src/components/orderPay.vue b/src/components/orderPay.vue index d67a88d..9a7b113 100644 --- a/src/components/orderPay.vue +++ b/src/components/orderPay.vue @@ -47,7 +47,7 @@ // import CryptoJS from '../utils/AES.js' // let Base64 = require('js-base64').Base64 import { MessageBox } from 'mint-ui'; -import { aliPay, getOpenId, vxPayQuery, bankH5Pay, queryParkingRecordPageByCarNumbers } from '@/api/orderPay/orderPay' +import { aliPay, getOpenId, vxPayQuery, bankH5Pay, queryParkingRecordPageByCarNumbers, doPay } from '@/api/orderPay/orderPay' export default { name: 'orderPay', @@ -101,11 +101,11 @@ export default { } console.log(this.orderId) this.appOrderTimeout = this.$route.query.appOrderTimeout - if (this.clientBrowser == "微信") { - this.webAppCode = this.getCode(); - } - + // if (this.clientBrowser == "微信") { + // this.webAppCode = this.getCode(); + // } + console.log(this.$utils.clientBrowsePayType()) }, mounted(){ @@ -137,72 +137,101 @@ export default { this.backDeveloperCode = this.$route.query.backDeveloperCode } - if (this.clientBrowser == '支付宝') { // 支付宝支付 - let me = this - var aliParams = {}; - aliParams.orderId = this.orderId; - aliParams.carNumber = this.carNumber; - aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 - aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 - aliParams.paySrcType = this.paySrcType;//101停车支付 - aliParams.orgId = sessionStorage.getItem('orgId') - aliParams.backType = 2 - aliParams.backDeveloperCode = this.backDeveloperCode - aliParams.recordArreaInfos = this.orderId; - console.log(aliParams) - aliPay(aliParams).then(response => { - console.log(response) - if (response.code == 0) {//进场 - document.write(response.data);//打开支付表单 - } else if(response.code == 1002){//其他情况如【该卡号场内已存在】 - console.log(response.message); - MessageBox.confirm('', { - message: response.message, - title: '温馨提示', - showCancelButton:false, - confirmButtonText: '确定', - }).then(action => { - if (action == 'confirm') { //确认的回调 - console.log('确定'); - this.$router.go(-1) - } - }).catch(err => { - if (err == 'cancel') { //取消的回调 - console.log('取消'); - } - }); - }else{ - alert(response.message) - } - - }) - } - + var salt = this.$utils.myCommonSalt(32); + + var list = "[" + this.orderIds + "]" + console.log(this.orderIds) + + var jsondata = { + appId:this.$utils.xuanhuaAppid, + carNumber: me.carNumber, + orderActFee: me.arrearageActFee, // 应收 + orderBigType: '100', // 订单大类型 100:停车订单 200:充值订单 300:会员卡订单 + orderTotalFee: me.arrearageActFee, // 实收 + payOrderType: 101, // 支付单来源 101:停车付款单 102:停车预付单 103:停车补缴单 104 共享车位 201 余额充值单 202 押金充值单 301 会员卡购买单 302 会员卡续费 + paySource: '3', + //支付单来源 101:停车付款单 102:停车预付单 103:停车补缴单 104 共享车位 201 余额充值单 202 押金充值单 301 会员卡购买单 302 会员卡续费 + paySrcType: 101, + payType: this.$utils.clientBrowsePayType()==4?'36':'37', + rltOrderId: sessionStorage.getItem('pageIds'), + sourceType: '3', + orgId: this.$utils.myOrgId, + terminalSource: '7', + }; + jsondata.sign = this.$utils.signObject(jsondata) + + doPay(jsondata).then(response => { + console.log(response.data.payinfo) + window.location.href = response.data.payinfo + }) - if (this.clientBrowser == '微信') { // 微信支付 - let _openId = sessionStorage.getItem('openIdDataNew') - if(_openId){ - me.vxPay(_openId,this.orderId) - }else { - //第一步获取openid - var codeParams = { - code: this.webAppCode, - appId: this.$utils.myVxAppId - }; - getOpenId(codeParams).then(res => { - if (res.code == 0) { - me.vxPay(res.data, this.orderId) - sessionStorage.setItem('openIdDataNew', res.data) - } else if (res.code == 40163) { //code been used, hints[重复code问题] - alert('请重新扫码重复code问题') - console.log(res.message); - } else { - alert('请重新扫码') - } - }) - } - } + // if (this.clientBrowser == '支付宝') { // 支付宝支付 + // let me = this + // var aliParams = {}; + // aliParams.orderId = this.orderId; + // aliParams.carNumber = this.carNumber; + // aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 + // aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 + // aliParams.paySrcType = this.paySrcType;//101停车支付 + // aliParams.orgId = sessionStorage.getItem('orgId') + // aliParams.backType = 2 + // aliParams.backDeveloperCode = this.backDeveloperCode + // aliParams.recordArreaInfos = this.orderId; + // console.log(aliParams) + // aliPay(aliParams).then(response => { + // console.log(response) + // if (response.code == 0) {//进场 + // document.write(response.data);//打开支付表单 + // } else if(response.code == 1002){//其他情况如【该卡号场内已存在】 + // console.log(response.message); + // MessageBox.confirm('', { + // message: response.message, + // title: '温馨提示', + // showCancelButton:false, + // confirmButtonText: '确定', + // }).then(action => { + // if (action == 'confirm') { //确认的回调 + // console.log('确定'); + // this.$router.go(-1) + // } + // }).catch(err => { + // if (err == 'cancel') { //取消的回调 + // console.log('取消'); + // } + // }); + // }else{ + // alert(response.message) + // } + // + // }) + // } + // + // + // + // if (this.clientBrowser == '微信') { // 微信支付 + // let _openId = sessionStorage.getItem('openIdDataNew') + // if(_openId){ + // me.vxPay(_openId,this.orderId) + // }else { + // //第一步获取openid + // var codeParams = { + // code: this.webAppCode, + // appId: this.$utils.myVxAppId + // }; + // getOpenId(codeParams).then(res => { + // if (res.code == 0) { + // me.vxPay(res.data, this.orderId) + // sessionStorage.setItem('openIdDataNew', res.data) + // } else if (res.code == 40163) { //code been used, hints[重复code问题] + // alert('请重新扫码重复code问题') + // console.log(res.message); + // } else { + // alert('请重新扫码') + // } + // }) + // } + // } }, vxPay(openIdData, orderIdData) { diff --git a/src/components/parkRecord.vue b/src/components/parkRecord.vue index 54485cf..d45c55d 100644 --- a/src/components/parkRecord.vue +++ b/src/components/parkRecord.vue @@ -141,7 +141,7 @@