Commit 6e7e87858bdb39e783fbc1767bf7c28f314751a9

Authored by 刘淇
1 parent 04d41f2e

江阴领券

src/api/couponPay/couponPay.js
1 import request from '@/utils/request' 1 import request from '@/utils/request'
2 2
  3 +
  4 +export function getEncryptTime(base,params) {
  5 + console.log('1111ase')
  6 + console.log(base)
  7 + return request({
  8 + // requestBase:'VUE_APP_URL',
  9 + // headers: {
  10 + // 'Content-Type': 'application/x-www-form-urlencoded'
  11 + // },
  12 + url: base+'/business/h5/qr/getEncryptTime',
  13 + method: 'post',
  14 + data: params
  15 + })
  16 +}
  17 +
3 export function scanCouponQR(base,params) { 18 export function scanCouponQR(base,params) {
4 console.log('1111ase') 19 console.log('1111ase')
5 console.log(base) 20 console.log(base)
src/views/parkPay/coupon.vue
@@ -69,6 +69,7 @@ export default { @@ -69,6 +69,7 @@ export default {
69 codeType: this.codeType, 69 codeType: this.codeType,
70 cardRelParkNo: this.cardRelParkNo, 70 cardRelParkNo: this.cardRelParkNo,
71 key: this.$route.query.key, 71 key: this.$route.query.key,
  72 + encryptTime: this.$route.query.encryptTime,
72 carNum: this.carNum, 73 carNum: this.carNum,
73 // carNumberColor: this.carNumberColor, 74 // carNumberColor: this.carNumberColor,
74 orgId: this.$utils.myOrgId, 75 orgId: this.$utils.myOrgId,
src/views/parkPay/plateNumber.vue
@@ -276,8 +276,9 @@ @@ -276,8 +276,9 @@
276 </template> 276 </template>
277 <script> 277 <script>
278 278
279 -import Swiper from 'swiper' // 应入swiper  
280 -import {swiperQuery} from '../../api/plateNumber/plateNumber' 279 +import {
  280 + getEncryptTime
  281 +} from '@/api/couponPay/couponPay.js'
281 282
282 export default { 283 export default {
283 data() { 284 data() {
@@ -339,6 +340,7 @@ export default { @@ -339,6 +340,7 @@ export default {
339 carType: '', 340 carType: '',
340 codeType: '', 341 codeType: '',
341 historyList:[], 342 historyList:[],
  343 + encryptTime:'', // 加密后的时间
342 } 344 }
343 }, 345 },
344 created() { 346 created() {
@@ -480,17 +482,50 @@ export default { @@ -480,17 +482,50 @@ export default {
480 localStorage.setItem('historyArr',JSON.stringify(this.historyList)) 482 localStorage.setItem('historyArr',JSON.stringify(this.historyList))
481 } 483 }
482 484
483 -  
484 - this.$router.push({  
485 - path: 'coupon',  
486 - query: {  
487 - carNumber: plateLicense,  
488 - carNumberColor: this.currentColor,  
489 - carType: 2,  
490 - codeType: this.codeType,  
491 - cardRelParkNo: this.$route.query.cardRelParkNo,  
492 - key: this.$route.query.key 485 + this.getEncryptTime()
  486 + },
  487 + getEncryptTime() {
  488 + let url = process.env.VUE_APP_API;
  489 + console.log(url)
  490 + var salt = this.$utils.myCommonSalt(32);
  491 + var jsondata = {
  492 + app_id: this.$utils.myVarAppid,
  493 + deviceInfo: this.$utils.myDeviceInfo,
  494 + salt: salt,
  495 + sign_type: "md5",
  496 +
  497 + codeType: this.codeType,
  498 + cardRelParkNo: this.$route.query.cardRelParkNo,
  499 + key: this.$route.query.key,
  500 +
  501 + // carNumberColor: this.carNumberColor,
  502 + orgId: this.$utils.myOrgId,
  503 + terminalSource: '7',
  504 + // token:'e2c1e43722dd43a5b7e268001b39e6f0'
  505 + }
  506 + jsondata.sign = this.$utils.signObject(jsondata)
  507 + console.log(jsondata)
  508 + getEncryptTime(url,jsondata).then(response => {
  509 + console.log(response)
  510 +
  511 + if (response.code == 0) {
  512 + this.encryptTime = response.data.encryptTime
  513 + this.$router.push({
  514 + path: 'coupon',
  515 + query: {
  516 + carNumber: plateLicense,
  517 + carNumberColor: this.currentColor,
  518 + carType: 2,
  519 + codeType: this.codeType,
  520 + cardRelParkNo: this.$route.query.cardRelParkNo,
  521 + key: this.$route.query.key,
  522 + encryptTime: this.encryptTime
  523 + }
  524 + })
  525 + } else {
  526 + alert(response.message)
493 } 527 }
  528 +
494 }) 529 })
495 }, 530 },
496 toNext(i){ 531 toNext(i){