Commit 8ecf38fbfa5fa30b6eb3f983f149948330c56709

Authored by 刘淇
1 parent a17ce3df

在停 聚合 支付

src/api/orderPay/orderPay.js
... ... @@ -45,6 +45,13 @@ export function queryParkingRecordPageByCarNumbers(params) { // 支付完成后
45 45  
46 46  
47 47  
  48 +export function doPay(params) { // 支付信息获取
  49 + return request({
  50 + url: 'allInPay/doPay',
  51 + method: 'post',
  52 + data: params
  53 + })
  54 +}
48 55  
49 56  
50 57  
... ...
src/api/parkRecord/parkRecord.js
... ... @@ -33,8 +33,19 @@ export function appApplyParkOut(params) { // 0元出场
33 33 })
34 34 }
35 35  
  36 +export function queryArrearageSta(params) { // 查询补缴订单详情
  37 + return request({
  38 + url: 'queryParkOrder/queryArrearageSta',
  39 + method: 'post',
  40 + data: params
  41 + })
  42 +}
36 43  
37   -
38   -
39   -
  44 +export function doOrderCreate(params) { // 查询补缴订单详情
  45 + return request({
  46 + url: 'allInPay/doOrderCreate',
  47 + method: 'post',
  48 + data: params
  49 + })
  50 +}
40 51  
... ...
src/components/orderPay.vue
... ... @@ -47,7 +47,7 @@
47 47 // import CryptoJS from '../utils/AES.js'
48 48 // let Base64 = require('js-base64').Base64
49 49 import { MessageBox } from 'mint-ui';
50   -import { aliPay, getOpenId, vxPayQuery, bankH5Pay, queryParkingRecordPageByCarNumbers } from '@/api/orderPay/orderPay'
  50 +import { aliPay, getOpenId, vxPayQuery, bankH5Pay, queryParkingRecordPageByCarNumbers, doPay } from '@/api/orderPay/orderPay'
51 51  
52 52 export default {
53 53 name: 'orderPay',
... ... @@ -101,11 +101,11 @@ export default {
101 101 }
102 102 console.log(this.orderId)
103 103 this.appOrderTimeout = this.$route.query.appOrderTimeout
104   - if (this.clientBrowser == "微信") {
105   - this.webAppCode = this.getCode();
106   - }
107   -
  104 + // if (this.clientBrowser == "微信") {
  105 + // this.webAppCode = this.getCode();
  106 + // }
108 107  
  108 + console.log(this.$utils.clientBrowsePayType())
109 109  
110 110 },
111 111 mounted(){
... ... @@ -137,72 +137,101 @@ export default {
137 137 this.backDeveloperCode = this.$route.query.backDeveloperCode
138 138 }
139 139  
140   - if (this.clientBrowser == '支付宝') { // 支付宝支付
141   - let me = this
142   - var aliParams = {};
143   - aliParams.orderId = this.orderId;
144   - aliParams.carNumber = this.carNumber;
145   - aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
146   - aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
147   - aliParams.paySrcType = this.paySrcType;//101停车支付
148   - aliParams.orgId = sessionStorage.getItem('orgId')
149   - aliParams.backType = 2
150   - aliParams.backDeveloperCode = this.backDeveloperCode
151   - aliParams.recordArreaInfos = this.orderId;
152   - console.log(aliParams)
153   - aliPay(aliParams).then(response => {
154   - console.log(response)
155   - if (response.code == 0) {//进场
156   - document.write(response.data);//打开支付表单
157   - } else if(response.code == 1002){//其他情况如【该卡号场内已存在】
158   - console.log(response.message);
159   - MessageBox.confirm('', {
160   - message: response.message,
161   - title: '温馨提示',
162   - showCancelButton:false,
163   - confirmButtonText: '确定',
164   - }).then(action => {
165   - if (action == 'confirm') { //确认的回调
166   - console.log('确定');
167   - this.$router.go(-1)
168   - }
169   - }).catch(err => {
170   - if (err == 'cancel') { //取消的回调
171   - console.log('取消');
172   - }
173   - });
174   - }else{
175   - alert(response.message)
176   - }
177   -
178   - })
179   - }
180   -
181 140  
  141 + var salt = this.$utils.myCommonSalt(32);
  142 +
  143 + var list = "[" + this.orderIds + "]"
  144 + console.log(this.orderIds)
  145 +
  146 + var jsondata = {
  147 + appId:this.$utils.xuanhuaAppid,
  148 + carNumber: me.carNumber,
  149 + orderActFee: me.arrearageActFee, // 应收
  150 + orderBigType: '100', // 订单大类型 100:停车订单 200:充值订单 300:会员卡订单
  151 + orderTotalFee: me.arrearageActFee, // 实收
  152 + payOrderType: 101, // 支付单来源 101:停车付款单 102:停车预付单 103:停车补缴单 104 共享车位 201 余额充值单 202 押金充值单 301 会员卡购买单 302 会员卡续费
  153 + paySource: '3',
  154 + //支付单来源 101:停车付款单 102:停车预付单 103:停车补缴单 104 共享车位 201 余额充值单 202 押金充值单 301 会员卡购买单 302 会员卡续费
  155 + paySrcType: 101,
  156 + payType: this.$utils.clientBrowsePayType()==4?'36':'37',
  157 + rltOrderId: sessionStorage.getItem('pageIds'),
  158 + sourceType: '3',
  159 + orgId: this.$utils.myOrgId,
  160 + terminalSource: '7',
  161 + };
  162 + jsondata.sign = this.$utils.signObject(jsondata)
  163 +
  164 + doPay(jsondata).then(response => {
  165 + console.log(response.data.payinfo)
  166 + window.location.href = response.data.payinfo
  167 + })
182 168  
183   - if (this.clientBrowser == '微信') { // 微信支付
184   - let _openId = sessionStorage.getItem('openIdDataNew')
185   - if(_openId){
186   - me.vxPay(_openId,this.orderId)
187   - }else {
188   - //第一步获取openid
189   - var codeParams = {
190   - code: this.webAppCode,
191   - appId: this.$utils.myVxAppId
192   - };
193   - getOpenId(codeParams).then(res => {
194   - if (res.code == 0) {
195   - me.vxPay(res.data, this.orderId)
196   - sessionStorage.setItem('openIdDataNew', res.data)
197   - } else if (res.code == 40163) { //code been used, hints[重复code问题]
198   - alert('请重新扫码重复code问题')
199   - console.log(res.message);
200   - } else {
201   - alert('请重新扫码')
202   - }
203   - })
204   - }
205   - }
  169 + // if (this.clientBrowser == '支付宝') { // 支付宝支付
  170 + // let me = this
  171 + // var aliParams = {};
  172 + // aliParams.orderId = this.orderId;
  173 + // aliParams.carNumber = this.carNumber;
  174 + // aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
  175 + // aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
  176 + // aliParams.paySrcType = this.paySrcType;//101停车支付
  177 + // aliParams.orgId = sessionStorage.getItem('orgId')
  178 + // aliParams.backType = 2
  179 + // aliParams.backDeveloperCode = this.backDeveloperCode
  180 + // aliParams.recordArreaInfos = this.orderId;
  181 + // console.log(aliParams)
  182 + // aliPay(aliParams).then(response => {
  183 + // console.log(response)
  184 + // if (response.code == 0) {//进场
  185 + // document.write(response.data);//打开支付表单
  186 + // } else if(response.code == 1002){//其他情况如【该卡号场内已存在】
  187 + // console.log(response.message);
  188 + // MessageBox.confirm('', {
  189 + // message: response.message,
  190 + // title: '温馨提示',
  191 + // showCancelButton:false,
  192 + // confirmButtonText: '确定',
  193 + // }).then(action => {
  194 + // if (action == 'confirm') { //确认的回调
  195 + // console.log('确定');
  196 + // this.$router.go(-1)
  197 + // }
  198 + // }).catch(err => {
  199 + // if (err == 'cancel') { //取消的回调
  200 + // console.log('取消');
  201 + // }
  202 + // });
  203 + // }else{
  204 + // alert(response.message)
  205 + // }
  206 + //
  207 + // })
  208 + // }
  209 + //
  210 + //
  211 + //
  212 + // if (this.clientBrowser == '微信') { // 微信支付
  213 + // let _openId = sessionStorage.getItem('openIdDataNew')
  214 + // if(_openId){
  215 + // me.vxPay(_openId,this.orderId)
  216 + // }else {
  217 + // //第一步获取openid
  218 + // var codeParams = {
  219 + // code: this.webAppCode,
  220 + // appId: this.$utils.myVxAppId
  221 + // };
  222 + // getOpenId(codeParams).then(res => {
  223 + // if (res.code == 0) {
  224 + // me.vxPay(res.data, this.orderId)
  225 + // sessionStorage.setItem('openIdDataNew', res.data)
  226 + // } else if (res.code == 40163) { //code been used, hints[重复code问题]
  227 + // alert('请重新扫码重复code问题')
  228 + // console.log(res.message);
  229 + // } else {
  230 + // alert('请重新扫码')
  231 + // }
  232 + // })
  233 + // }
  234 + // }
206 235  
207 236 },
208 237 vxPay(openIdData, orderIdData) {
... ...
src/components/parkRecord.vue
... ... @@ -141,7 +141,7 @@
141 141 </template>
142 142  
143 143 <script>
144   -import {parkRecordList, historyQuery, parkingQuery, appApplyParkOut} from '@/api/parkRecord/parkRecord.js'
  144 +import {parkRecordList, historyQuery, parkingQuery, appApplyParkOut, queryArrearageSta, doOrderCreate} from '@/api/parkRecord/parkRecord.js'
145 145 import axios from 'axios'
146 146  
147 147 export default {
... ... @@ -217,9 +217,7 @@ export default {
217 217 this.historyList = this.parkList.filter(item => {
218 218 return item.parkState == '20'
219 219 })
220   - this.historyList.forEach( i => {
221   - this.allMoney += Number(i.unPayFee)
222   - })
  220 +
223 221  
224 222 if(this.parkingData.length==0 && this.historyList.length>0){
225 223 this.currentTabActive = 1
... ... @@ -239,10 +237,15 @@ export default {
239 237 tabHandle(index) { // tab 切换
240 238 this.currentTabActive = index
241 239 if(index==0){
242   - this.parkRecordList(10)
  240 + // this.parkRecordList(10)
  241 +
243 242 }else{
244 243 this.allMoney = 0
245   - this.parkRecordList(30)
  244 + this.historyList.forEach( i => {
  245 + this.allMoney += Number(i.unPayFee)
  246 + })
  247 + // this.allChecked = false
  248 + // this.parkRecordList(10)
246 249 }
247 250 },
248 251 chooseHandle(i, index) { // 历史欠费单个选择事件
... ... @@ -357,46 +360,69 @@ export default {
357 360 var salt = this.$utils.myCommonSalt(32);
358 361  
359 362 var list = "[" + this.orderIds + "]"
  363 + console.log(this.orderIds)
360 364  
361 365 var jsondata = {
362 366 app_id: this.$utils.myVarAppid,
363 367 deviceInfo: this.$utils.myDeviceInfo,
364 368 salt: salt,
365   - // sign: md5sign,
366 369 sign_type: "md5",
367   - appId: this.$utils.myVxAppId,
368   - orderIds: list,
369   - terminalSource: '7',
370 370 payType: this.$utils.clientBrowsePayType(),
371   - orgId: sessionStorage.getItem('orgId'),
372   - backDeveloperCode: this.$route.query.backDeveloperCode
  371 + // appId: this.$utils.myVxAppId,
  372 + terminalSource: '7',
  373 + orderIds: JSON.stringify(this.orderIds)
373 374 }
374 375 jsondata.sign = this.$utils.signObject(jsondata)
375 376 console.log(jsondata)
376   - historyQuery(jsondata).then(response => {
  377 + queryArrearageSta(jsondata).then(response => {
377 378 console.log(response)
378   - let res = response.data.carArrearages[0]
379   - console.log(res)
380   -
381   - this.orderIds = JSON.stringify(this.orderIds)
382   - sessionStorage.setItem('pageIds',this.orderIds)
383   - console.log(this.orderIds)
384   - this.$router.push(
385   - {
386   - path: 'orderPay',
387   - query: {
388   - carColor: this.carColor,// 车牌颜色
389   - arrearageTotalFee: res.arrearageTotalFee,// 应收
390   - arrearageDiscFee: res.arrearageDiscFee,// 优惠
391   - arrearageActFee: res.arrearageActFee,// 实收
392   - carNumber: this.carNumber, // 车牌
393   - paySrcType: 103, //支付的类型 101 是本次 103是历史欠费
394   - // ordeID: this.orderIds, //支付的订单号
395   - appOrderTimeout: '',
396   - backDeveloperCode: response.data.inChargerCode
397   - }
398   - }
399   - )
  379 +
  380 + this.doOrderCreate()
  381 +
  382 + // let res = response.data.carArrearages[0]
  383 + // console.log(res)
  384 +
  385 + // this.orderIds = JSON.stringify(this.orderIds)
  386 + // sessionStorage.setItem('pageIds',this.orderIds)
  387 + // console.log(this.orderIds)
  388 + // this.$router.push(
  389 + // {
  390 + // path: 'orderPay',
  391 + // query: {
  392 + // carColor: this.carColor,// 车牌颜色
  393 + // arrearageTotalFee: res.arrearageTotalFee,// 应收
  394 + // arrearageDiscFee: res.arrearageDiscFee,// 优惠
  395 + // arrearageActFee: res.arrearageActFee,// 实收
  396 + // carNumber: this.carNumber, // 车牌
  397 + // paySrcType: 103, //支付的类型 101 是本次 103是历史欠费
  398 + // // ordeID: this.orderIds, //支付的订单号
  399 + // appOrderTimeout: '',
  400 + // backDeveloperCode: response.data.inChargerCode
  401 + // }
  402 + // }
  403 + // )
  404 + })
  405 + },
  406 + doOrderCreate(){
  407 + var salt = this.$utils.myCommonSalt(32);
  408 +
  409 + var list = "[" + this.orderIds + "]"
  410 + console.log(this.orderIds)
  411 +
  412 + var jsondata = {
  413 + app_id: this.$utils.myVarAppid,
  414 + deviceInfo: this.$utils.myDeviceInfo,
  415 + salt: salt,
  416 + sign_type: "md5",
  417 + payType: this.$utils.clientBrowsePayType(),
  418 + // appId: this.$utils.myVxAppId,
  419 + terminalSource: '7',
  420 + orderIds: JSON.stringify(this.orderIds)
  421 + }
  422 + jsondata.sign = this.$utils.signObject(jsondata)
  423 + console.log(jsondata)
  424 + doOrderCreate(jsondata).then(response => {
  425 +
400 426 })
401 427 }
402 428 },
... ...
src/components/plateNumber.vue
... ... @@ -28,30 +28,30 @@
28 28 </div>
29 29  
30 30  
31   - <div class="radio-box">
32   - <label class="flex-items-center">
33   - <img v-if="formData.commonCard == 1"
34   - src="../assets/images/icon_chose_s@2x.png"
35   - alt="">
36   - <img v-else
37   - src="../assets/images/icon_chose_n@2x.png"
38   - alt="">
39   - <input type="radio"
40   - v-model="formData.commonCard"
41   - value="1" />普通车牌
42   - </label>
43   - <label class="flex-items-center">
44   - <img v-if="formData.commonCard == 2"
45   - src="../assets/images/icon_chose_s@2x.png"
46   - alt="">
47   - <img v-else
48   - src="../assets/images/icon_chose_n@2x.png"
49   - alt="">
50   - <input type="radio"
51   - v-model="formData.commonCard"
52   - value="2" />新能源车牌
53   - </label>
54   - </div>
  31 + <!--<div class="radio-box">-->
  32 + <!--<label class="flex-items-center">-->
  33 + <!--<img v-if="formData.commonCard == 1"-->
  34 + <!--src="../assets/images/icon_chose_s@2x.png"-->
  35 + <!--alt="">-->
  36 + <!--<img v-else-->
  37 + <!--src="../assets/images/icon_chose_n@2x.png"-->
  38 + <!--alt="">-->
  39 + <!--<input type="radio"-->
  40 + <!--v-model="formData.commonCard"-->
  41 + <!--value="1" />普通车牌-->
  42 + <!--</label>-->
  43 + <!--<label class="flex-items-center">-->
  44 + <!--<img v-if="formData.commonCard == 2"-->
  45 + <!--src="../assets/images/icon_chose_s@2x.png"-->
  46 + <!--alt="">-->
  47 + <!--<img v-else-->
  48 + <!--src="../assets/images/icon_chose_n@2x.png"-->
  49 + <!--alt="">-->
  50 + <!--<input type="radio"-->
  51 + <!--v-model="formData.commonCard"-->
  52 + <!--value="2" />新能源车牌-->
  53 + <!--</label>-->
  54 + <!--</div>-->
55 55  
56 56  
57 57 <div class="submit-box" @click="submitFn()">
... ... @@ -327,17 +327,17 @@ export default {
327 327 }
328 328 },
329 329 mounted () {
330   -
331   - if (this.$utils.clientBrowser() == "微信") {
332   - var appID = this.$utils.myVxAppId;
333   - var code = this.getUrlParam('code');
334   - var local = window.location.href;
335   - if (code == null || code === '') {
336   - 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,0#wechat_redirect'
337   - } else {
338   - return code;
339   - }
340   - }
  330 + //
  331 + // if (this.$utils.clientBrowser() == "微信") {
  332 + // var appID = this.$utils.myVxAppId;
  333 + // var code = this.getUrlParam('code');
  334 + // var local = window.location.href;
  335 + // if (code == null || code === '') {
  336 + // 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,0#wechat_redirect'
  337 + // } else {
  338 + // return code;
  339 + // }
  340 + // }
341 341  
342 342 },
343 343 methods: {
... ... @@ -349,6 +349,14 @@ export default {
349 349 },
350 350 chooseColor (index){ // 颜色选择
351 351 this.currentColor = index
  352 + // formData.commonCard
  353 +
  354 + if(this.currentColor==4){
  355 + this.formData.commonCard=2
  356 + }else{
  357 + this.formData.commonCard=1
  358 + }
  359 +
352 360 switch (this.currentColor) {
353 361 case 0 :
354 362 return this.activeBG = '#0054C0'
... ... @@ -419,7 +427,7 @@ export default {
419 427 },
420 428 submitFn () {
421 429 let plateLicense
422   - if (this.formData.commonCard === '1') {
  430 + if (this.formData.commonCard == '1') {
423 431 plateLicense = this.plate_license_1
424 432 plateLicense = this.palindrome(plateLicense)
425 433 if (plateLicense.length < 7) {
... ... @@ -427,7 +435,7 @@ export default {
427 435 return
428 436 }
429 437 }
430   - if (this.formData.commonCard === '2') {
  438 + if (this.formData.commonCard == '2') {
431 439 plateLicense = this.plate_license_2
432 440 plateLicense = this.palindrome(plateLicense)
433 441 if (plateLicense.length < 8) {
... ...
src/utils/request.js
... ... @@ -13,7 +13,7 @@ const service = axios.create({
13 13  
14 14 // https://dev.renniting.cn/pay/ 赤峰农行测试环境
15 15  
16   - baseURL: 'https://pay.ccccitd.cc', // url = base url + request url
  16 + baseURL: 'http://wxzhifu.natapp1.cc', // url = base url + request url
17 17 // withCredentials: true, // send cookies when cross-domain requests
18 18 timeout: 10000 // request timeout
19 19 })
... ...
src/utils/utils.js
... ... @@ -74,6 +74,40 @@ export default {
74 74 return this.myGetSign(sort)
75 75 },
76 76  
  77 + signObjectNew: function (inputData){ //签名字段
  78 + // let sort = []
  79 + // for(let k in jsonObj){
  80 + // sort.push({
  81 + // keyname: k,
  82 + // value: jsonObj[k]
  83 + // })
  84 + // }
  85 + // return this.myGetSign(sort)
  86 +
  87 +
  88 + var jsonList = inputData;
  89 + jsonList.sign_type = "md5";
  90 + jsonList.app_id = "lrpo55tmveqe07w3gpovzgx34pdez7eh";
  91 + jsonList.deviceInfo = "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E";
  92 + jsonList.salt = this.myCommonSalt(32);
  93 + jsonList.terminalSource= '7'
  94 + // jsonList.token= "e3b5417a987641219efb8dc1f8b5fbce"
  95 + // jsonList.token = '84b5a8edb5974f7989e7888b9f48a765';
  96 + var arrData = [];
  97 + for (var key in jsonList) {
  98 + var obj = {};
  99 + // console.log("key = "+key);
  100 + // // obj[key] =jsonList[key];
  101 + obj.keyname = key;
  102 + obj.value = jsonList[key];
  103 + // console.log(obj);
  104 + arrData.push(obj);
  105 + }
  106 + var sign = this.myGetSign(arrData);
  107 + jsonList.sign = sign;
  108 + return jsonList;
  109 + },
  110 +
77 111 clientBrowser: function () { // 判断客户端
78 112 if (/MicroMessenger/.test(window.navigator.userAgent)) {
79 113 console.log("微信客户端");
... ... @@ -119,7 +153,7 @@ export default {
119 153 // ud8yq5tv0inxupc05xfeau39jywlqoj2 新的id
120 154 // ny1u72b6k374sg379z0kqjgfxe2ycnpw 新的签名
121 155  
122   - myVarAppid:'ud8yq5tv0inxupc05xfeau39jywlqoj2',// 公共请求Appid
  156 + myVarAppid:'lrpo55tmveqe07w3gpovzgx34pdez7eh',// 公共请求Appid
123 157  
124 158 myDeviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E', // 公共请求设备信息
125 159  
... ... @@ -129,8 +163,12 @@ export default {
129 163 // 黄石 appid wxa1a66cc7d263afe6
130 164 // 天水 appid wx776e81ec7494232e
131 165  
  166 + xuanhuaAppid:'00276515',
  167 +
132 168 myOrgId: sessionStorage.getItem('orgId'), // 归属地 赤峰id 10003 黄石 10079
133 169  
  170 + myOrgId: '10120', // 归属地 赤峰id 10003 黄石 10079
  171 +
134 172 myGetSign: function (objb) { // 获取签名
135 173 var compare = function (obj1, obj2) {
136 174 var val1 = obj1.keyname;
... ... @@ -144,13 +182,13 @@ export default {
144 182 }
145 183 }
146 184 objb.sort(compare);
147   - var strmd5 = 'ny1u72b6k374sg379z0kqjgfxe2ycnpw';
  185 + var strmd5 = 'gz8wfwd0gn1etamjjhzey1ggcz78pfvd';
148 186 for(var i=0;i<objb.length;i++){
149 187 if(objb[i].value != null&&objb[i].value != ''){
150 188 strmd5 += objb[i].keyname+objb[i].value;
151 189 }
152 190 }
153   - strmd5 += 'ny1u72b6k374sg379z0kqjgfxe2ycnpw';
  191 + strmd5 += 'gz8wfwd0gn1etamjjhzey1ggcz78pfvd';
154 192 // console.log('strmd5-------->'+strmd5);
155 193 strmd5 = md5(strmd5);
156 194 strmd5=strmd5.toUpperCase();
... ...