Commit 2c31a41c8b44ce2dd2eb57a7e0a10b23c506eff3

Authored by liuqimichale
1 parent c9972cc9

赤峰静态码测试完成

src/components/dynCodePay.vue
... ... @@ -25,9 +25,12 @@
25 25 <span>停车时长</span>
26 26 <span>{{ $utils.dateFormat(staytime) }}</span>
27 27 </li>
  28 +
  29 +
  30 +
28 31 <li>
29 32 <span>待缴金额</span>
30   - <span>{{(orderFee/100).toFixed(2)}}</span>
  33 + <span>{{(orderFee/100).toFixed(2)}}</span>
31 34 </li>
32 35  
33 36 </ul>
... ... @@ -66,6 +69,7 @@ export default {
66 69 outtime: '', // 出场时间
67 70 staytime: '', // 停车时长
68 71 orderFee: '', // 需要支付的费用
  72 +
69 73 arrearageActFee: 0,
70 74 arrearageDiscFee: 0,
71 75 arrearageActFee: 0,
... ...
src/components/plateNumber.vue
1 1 <template>
2 2 <div id="page">
3 3 <div class="wrap">
4   - <p style="margin-bottom: 18px;margin-top: 18px;">请选择车牌颜色</p>
  4 + <!--<p style="margin-bottom: 18px;margin-top: 18px;">请选择车牌颜色</p>-->
5 5  
6   - <ul class="color-choose">
7   - <li v-for="(i,index) in colorList" :key="i.name" @click="chooseColor(index)"
8   - :style="{color:currentColor==index?'#FFF':'',background: currentColor==index?activeBG:'' }"
9   - >
10   - {{i.name}}
11   - </li>
  6 + <!--<ul class="color-choose">-->
  7 + <!--<li v-for="(i,index) in colorList" :key="i.name" @click="chooseColor(index)"-->
  8 + <!--:style="{color:currentColor==index?'#FFF':'',background: currentColor==index?activeBG:'' }"-->
  9 + <!--&gt;-->
  10 + <!--{{i.name}}-->
  11 + <!--</li>-->
12 12  
13   - </ul>
  13 + <!--</ul>-->
14 14  
15   - <p style="margin-bottom: 18px;margin-top: 18px;">请输入车牌号码</p>
16   - <div class="num-box">
  15 + <p style="margin-bottom: 18px;margin-top: 18px;">
  16 + {{formData.commonCard == '3'?'请输入手机号码':'请输入车牌号码'}}
  17 + </p>
  18 +
  19 +
  20 + <div v-if="formData.commonCard == '3'">
  21 + <input type="text" class="iphone-box" v-model="carNum" maxlength="11" oninput="value=value.replace(/[^\d]/g,'')">
  22 + </div>
  23 +
  24 + <div class="num-box" v-else>
17 25 <div class="num0" @click="clickFirstWrap()">
18 26 <span>{{formData.num0}}</span>
19 27 </div>
... ... @@ -24,12 +32,15 @@
24 32 <div class="num1" @click="clickKeyWordWrap(4)"><span>{{formData.num4}}</span></div>
25 33 <div class="num1" @click="clickKeyWordWrap(5)"><span>{{formData.num5}}</span></div>
26 34 <div class="num1" @click="clickKeyWordWrap(6)"><span>{{formData.num6}}</span></div>
27   - <div v-if="formData.commonCard == '2'" class="num1" @click="clickKeyWordWrap(7)"><span>{{formData.num7}}</span></div>
  35 + <div v-if="formData.commonCard == '2'" class="num1" @click="clickKeyWordWrap(7)"><span>{{formData.num7}}</span>
  36 + </div>
28 37 </div>
29 38  
30 39  
  40 +
  41 +
31 42 <div class="radio-box">
32   - <label class="flex-items-center">
  43 + <label class="flex-items-center" @click="keyBoardStatus = true">
33 44 <img v-if="formData.commonCard == 1"
34 45 src="../assets/images/icon_chose_s@2x.png"
35 46 alt="">
... ... @@ -38,9 +49,9 @@
38 49 alt="">
39 50 <input type="radio"
40 51 v-model="formData.commonCard"
41   - value="1" />普通车牌
  52 + value="1"/>普通车牌
42 53 </label>
43   - <label class="flex-items-center">
  54 + <label class="flex-items-center" @click="keyBoardStatus = true">
44 55 <img v-if="formData.commonCard == 2"
45 56 src="../assets/images/icon_chose_s@2x.png"
46 57 alt="">
... ... @@ -49,7 +60,18 @@
49 60 alt="">
50 61 <input type="radio"
51 62 v-model="formData.commonCard"
52   - value="2" />新能源车牌
  63 + value="2"/>新能源车牌
  64 + </label>
  65 + <label class="flex-items-center" @click.self="changeTab">
  66 + <img v-if="formData.commonCard == 3"
  67 + src="../assets/images/icon_chose_s@2x.png"
  68 + alt="">
  69 + <img v-else
  70 + src="../assets/images/icon_chose_n@2x.png"
  71 + alt="">
  72 + <input type="radio"
  73 + v-model="formData.commonCard"
  74 + value="3"/>无牌车
53 75 </label>
54 76 </div>
55 77  
... ... @@ -169,7 +191,7 @@
169 191 </div>
170 192 </div>
171 193 </div>
172   - <div class="keyboard-wrap" v-if="keyBoardStatus === true">
  194 + <div class="keyboard-wrap" v-show="keyBoardStatus == true">
173 195 <!-- <div class="number-wrap"></div>
174 196 <div class="letter-wrap"></div>
175 197 <div class="cn-wrap"></div> -->
... ... @@ -229,7 +251,7 @@
229 251 <modal-alert ref="alert">
230 252 <div class="trave-tip-content txt-l" slot="content">
231 253 <div class="confirm-text">
232   - <p>请输入正确的车牌号</p>
  254 + <p>请输入正确的{{tip}}</p>
233 255 </div>
234 256 </div>
235 257 <span slot="button">知道了</span>
... ... @@ -237,33 +259,35 @@
237 259 </div>
238 260 </template>
239 261 <script>
  262 +import {noCarQRcodeInOutPark} from '@/api/plateNumber/plateNumber'
  263 +
240 264 export default {
241   - data () {
  265 + data() {
242 266 return {
243   - colorList:[
  267 + colorList: [
244 268 {
245   - name:'蓝牌',
246   - id:'1'
  269 + name: '蓝牌',
  270 + id: '1'
247 271 },
248 272 {
249   - name:'黄牌',
250   - id:'2'
  273 + name: '黄牌',
  274 + id: '2'
251 275 },
252 276 {
253   - name:'白牌',
254   - id:'3'
  277 + name: '绿牌',
  278 + id: '3'
255 279 },
256 280 {
257   - name:'黑牌',
258   - id:'4'
  281 + name: '白牌',
  282 + id: '4'
259 283 },
260 284 {
261   - name:'绿牌',
262   - id:'5'
  285 + name: '黑牌',
  286 + id: '5'
263 287 },
264 288 ],
265   - currentColor:0,
266   - activeBG:'#0054C0',
  289 + currentColor: 0,
  290 + activeBG: '#0054C0',
267 291 formData: {
268 292 commonCard: '1',
269 293 num0: '',
... ... @@ -290,40 +314,107 @@ export default {
290 314 confirmTitle: '',
291 315 submitConfirm: false,
292 316 submitConfirmFalse: false,
293   - submitConfirmText: ''
  317 + submitConfirmText: '',
  318 + carNum:'',
  319 + tip:'车牌号',
294 320 }
295 321 },
296   - mounted () {
  322 + mounted() {
  323 + console.log(window.location)
  324 + console.log(this.$route.query)
  325 + let params = this.$route.query
  326 + if (Object.keys(params).length == 0) {
  327 + alert('1')
  328 + } else {
  329 + this.noCarQRcodeInOutPark()
  330 + }
297 331 },
298 332 methods: {
299   - chooseColor (index){ // 颜色选择
300   - this.currentColor = index
301   - switch (this.currentColor) {
302   - case 0 :
303   - return this.activeBG = '#0054C0'
304   - break;
305   - case 1 :
306   - return this.activeBG = '#FEBE00'
307   - break;
308   - case 2 :
309   - return this.activeBG = '#E4E5E7'
310   - break;
311   - case 3 :
312   - return this.activeBG = '#333333'
313   - break;
314   - case 4 :
315   - return this.activeBG = '#97DEA1'
316   - break;
317   - }
  333 + // chooseColor (index){ // 颜色选择
  334 + // this.currentColor = index
  335 + // switch (this.currentColor) {
  336 + // case 0 :
  337 + // return this.activeBG = '#0054C0'
  338 + // break;
  339 + // case 1 :
  340 + // return this.activeBG = '#FEBE00'
  341 + // break;
  342 + // case 2 :
  343 + // return this.activeBG = '#97DEA1'
  344 + // break;
  345 + // case 3 :
  346 + // return this.activeBG = '#E4E5E7'
  347 + // break;
  348 + // case 4 :
  349 + // return this.activeBG = '#333333'
  350 + // break;
  351 + // }
  352 + // },
  353 + noCarQRcodeInOutPark() {
  354 + let params = this.$route.query
  355 + params.payType = this.$utils.IsWeixinOrAlipay()//4:微信 1:支付宝
  356 + params.terminalSource = "7";//1:任你听 3:微信公共号 4:云平台 7:H5
  357 + params.app_id = 1,
  358 + params.salt = 2,
  359 + params.deviceInfo = 3,
  360 + params.sign_type = 'md5',
  361 + params.sign = 4,
  362 + params.token = '666'
  363 + params.carNumber = this.carNum
  364 + noCarQRcodeInOutPark(params).then(res => {
  365 + console.log(res)
  366 + if (res.code == 0) {//进场
  367 + //alertMsg("出场成功");
  368 + if (res.data) {
  369 + var tmpObj = res.data;
  370 + //判断是否需要支付
  371 + if (tmpObj.needPay) {
  372 +
  373 + var queryParams = this.$utils.parseParams(tmpObj);
  374 + console.log(queryParams)
  375 + console.log(tmpObj)
  376 + //
  377 + this.$router.push({
  378 + path: 'pay',
  379 + query: tmpObj
  380 + })
  381 +
  382 + // window.location.href = "../pay.html?" + queryParams;
  383 + } else {
  384 + alert('无需缴费,欢迎下次光临')
  385 +
  386 + }
  387 + //var tel = document.getElementById("inputPhoneNum").value.replace(/\s/g, "");//去除空格
  388 + //var orderFee = keepTwoDecimalFull((tmpObj.orderFee / 100));//本次出场实际应付金额(减去折扣,优惠券等之后的应付金额)
  389 + //var tmpUrl = "orderId=" + tmpObj.orderId + "&outtime=" + tmpObj.outtime + "&tel=" + tel + "&orderFee=" + orderFee;
  390 +
  391 + } else {
  392 + alert("没有找到订单");
  393 + }
  394 + } else {//其他情况如【该卡号场内已存在】
  395 + console.log(res.message);
  396 + alert(res.message);
  397 +
  398 + }
  399 +
  400 + })
318 401 },
319   - clickFirstWrap () {
  402 + changeTab() {
  403 + // this.firstSelectStatus = false
  404 + // this.firstWrapStatus = false
  405 + this.keyBoardStatus = false
  406 + this.firstClickStatus = false
  407 + this.firstWrapStatus = false
  408 +
  409 + },
  410 + clickFirstWrap() {
320 411 // 点击第一个输入框
321 412 this.firstClickStatus = true
322 413 this.firstWrapStatus = true
323 414 this.keyBoardStatus = false
324 415 this.formData.num0 = ''
325 416 },
326   - selectFirstWord (event) {
  417 + selectFirstWord(event) {
327 418 // 选择省份
328 419 if (event.target.localName !== 'span') {
329 420 return
... ... @@ -337,7 +428,7 @@ export default {
337 428 // this.$refs.num1.focus()
338 429 // document.getElementById('num1').focus()
339 430 },
340   - clickKeyBoard (item) { // 点击自定义键盘
  431 + clickKeyBoard(item) { // 点击自定义键盘
341 432 console.log(item)
342 433 this.formData['num' + this.activeKeyWordIndex] = item
343 434  
... ... @@ -353,7 +444,7 @@ export default {
353 444 }
354 445 }
355 446 },
356   - deleteWord () { // 退格
  447 + deleteWord() { // 退格
357 448 // console.log(this.activeKeyWordIndex)
358 449 // console.log(this.formData['num' + (this.activeKeyWordIndex - 1)])
359 450 if (this.activeKeyWordIndex > 1) {
... ... @@ -361,17 +452,18 @@ export default {
361 452 this.activeKeyWordIndex--
362 453 }
363 454 },
364   - clickKeyWordWrap (activeKeyWordIndex) {
  455 + clickKeyWordWrap(activeKeyWordIndex) {
365 456 this.keyBoardStatus = true
366 457 this.activeKeyWordIndex = activeKeyWordIndex
367 458 this.formData['num' + this.activeKeyWordIndex] = ''
368 459 },
369   - submitFn () {
  460 + submitFn() {
370 461 let plateLicense
371 462 if (this.formData.commonCard === '1') {
372 463 plateLicense = this.plate_license_1
373 464 plateLicense = this.palindrome(plateLicense)
374 465 if (plateLicense.length < 7) {
  466 + this.tip = '车牌号'
375 467 this.$refs.alert.open()
376 468 return
377 469 }
... ... @@ -380,21 +472,35 @@ export default {
380 472 plateLicense = this.plate_license_2
381 473 plateLicense = this.palindrome(plateLicense)
382 474 if (plateLicense.length < 8) {
  475 + this.tip = '车牌号'
383 476 this.$refs.alert.open()
384 477 return
385 478 }
386 479 }
387   - this.$emit('getPlateLicense',plateLicense)
388   - console.log(plateLicense);
389   - this.$router.push({
390   - path:'parkRecord',
391   - query:{
392   - carNumber:plateLicense,
393   - carNumberColor: this.currentColor
  480 +
  481 + if (this.formData.commonCard === '3') {
  482 + plateLicense = this.plate_license_2
  483 + plateLicense = this.palindrome(plateLicense)
  484 + if (plateLicense.length < 11) {
  485 + this.tip = '手机号'
  486 + this.$refs.alert.open()
  487 + return
394 488 }
395   - })
  489 + }
  490 + //
  491 + // this.$emit('getPlateLicense', plateLicense)
  492 + console.log(plateLicense);
  493 + this.carNum = plateLicense
  494 + // this.$router.push({
  495 + // path: 'pay',
  496 + // query: {
  497 + // carNumber: plateLicense
  498 + // }
  499 + // })
  500 +
  501 + this.noCarQRcodeInOutPark()
396 502 },
397   - palindrome (str) {
  503 + palindrome(str) {
398 504 var arr = str.split('')
399 505 arr = arr.filter(function (val) {
400 506 return (
... ... @@ -417,7 +523,7 @@ export default {
417 523 })
418 524 return arr.join('')
419 525 },
420   - checkIsHasSpecialStr (str) {
  526 + checkIsHasSpecialStr(str) {
421 527 var flag = false
422 528 var arr = str.split('')
423 529 arr.forEach(val => {
... ... @@ -451,7 +557,7 @@ export default {
451 557 })
452 558 return flag
453 559 },
454   - checkIsHasChineseStr (str) {
  560 + checkIsHasChineseStr(str) {
455 561 var Reg = /.*[\u4e00-\u9fa5]+.*/
456 562 if (Reg.test(str)) {
457 563 return true
... ... @@ -460,7 +566,7 @@ export default {
460 566 }
461 567 },
462 568 computed: {
463   - plate_license_1 () {
  569 + plate_license_1() {
464 570 return (
465 571 this.formData.num0 +
466 572 this.formData.num1 +
... ... @@ -471,7 +577,7 @@ export default {
471 577 this.formData.num6
472 578 )
473 579 },
474   - plate_license_2 () {
  580 + plate_license_2() {
475 581 return (
476 582 this.formData.num0 +
477 583 this.formData.num1 +
... ... @@ -491,8 +597,9 @@ export default {
491 597 display: flex;
492 598 align-items: center;
493 599 }
  600 +
494 601 .wrap {
495   - padding:0 18px;
  602 + padding: 0 18px;
496 603 .radio-box {
497 604 display: flex;
498 605 align-items: center;
... ... @@ -512,14 +619,14 @@ export default {
512 619 }
513 620 }
514 621  
515   - .color-choose{
  622 + .color-choose {
516 623 width: 265px;
517 624 height: 34px;
518 625 margin: 0 auto;
519 626 background: #F3F3F3;
520 627 border-radius: 6px;
521 628 display: flex;
522   - li{
  629 + li {
523 630 flex: 1;
524 631 text-align: center;
525 632 line-height: 34px;
... ... @@ -620,6 +727,7 @@ export default {
620 727 }
621 728 }
622 729 }
  730 +
623 731 .first-word-wrap {
624 732 // height: 9.4rem;
625 733 background-color: #D2D5DB;
... ... @@ -637,12 +745,12 @@ export default {
637 745 width: 1.8rem;
638 746 height: 1.8rem;
639 747 // border: 1px solid #9cbce2;
640   - box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.35);
  748 + box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.35);
641 749 border-radius: 0.16rem;
642 750 text-align: center;
643 751 &.bordernone {
644 752 border: none;
645   - box-shadow:none
  753 + box-shadow: none
646 754 }
647 755 span {
648 756 box-sizing: border-box;
... ... @@ -661,11 +769,12 @@ export default {
661 769 width: 1.6rem;
662 770 }
663 771 }
664   - &:nth-last-of-type(1){
  772 + &:nth-last-of-type(1) {
665 773 margin-bottom: 0rem;
666 774 }
667 775 }
668 776 }
  777 +
669 778 .keyboard-wrap {
670 779 background-color: #D2D5DB;
671 780 position: fixed;
... ... @@ -687,33 +796,33 @@ export default {
687 796 justify-content: center;
688 797 height: 1.8rem;
689 798 margin: 0 0.3rem;
690   - box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.35);
  799 + box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.35);
691 800 background-color: #fff;
692 801 border-radius: 0.125rem;
693 802 &:active {
694 803 background-color: #e4e4e4;
695 804 }
696   - &.bordernone{
  805 + &.bordernone {
697 806 border: none;
698 807 box-shadow: none;
699 808 background-color: #D2D5DB;
700   - &:active{
701   - background-color:#D2D5DB;
  809 + &:active {
  810 + background-color: #D2D5DB;
702 811 }
703 812 }
704   - &.delete{
  813 + &.delete {
705 814 background-color: #465266;
706   - img{
  815 + img {
707 816 width: 1.15rem;
708 817 }
709 818 }
710 819 }
711 820 }
712   - .cancel{
  821 + .cancel {
713 822 display: flex;
714 823 justify-content: flex-end;
715 824 align-items: center;
716   - span{
  825 + span {
717 826 display: flex;
718 827 align-items: center;
719 828 justify-content: center;
... ... @@ -725,4 +834,20 @@ export default {
725 834 }
726 835 }
727 836 }
  837 +
  838 + input[type="text"]:focus {
  839 + border: 0;
  840 + border: 1px solid #e4e4e4 !important;
  841 + }
  842 +
  843 + .iphone-box {
  844 + border: 0;
  845 + width: 100%;
  846 + height: 1.8rem;
  847 + line-height: 1.8rem;
  848 + padding-left: 20px;
  849 + border: 1px solid #e4e4e4;
  850 + font-size: 14px;
  851 + }
  852 +
728 853 </style>
... ...
src/router/index.js
... ... @@ -24,16 +24,16 @@ export default new Router({
24 24 name: 'plateNumber',
25 25 component: plateNumber
26 26 },
27   - {
28   - path: '/parkRecord',
29   - name: 'parkRecord',
30   - component: parkRecord
31   - },
32   - {
33   - path: '/orderPay',
34   - name: 'orderPay',
35   - component: () => import("@/components/orderPay.vue")
36   - },
  27 + // {
  28 + // path: '/parkRecord',
  29 + // name: 'parkRecord',
  30 + // component: parkRecord
  31 + // },
  32 + // {
  33 + // path: '/orderPay',
  34 + // name: 'orderPay',
  35 + // component: () => import("@/components/orderPay.vue")
  36 + // },
37 37  
38 38 {
39 39 path: '/payResult',
... ... @@ -48,6 +48,12 @@ export default new Router({
48 48 component: () => import("@/components/dynCodePay.vue")
49 49 },
50 50  
  51 + {
  52 + path: '/pay',
  53 + name: 'pay',
  54 + component: () => import("@/components/pay.vue")
  55 + },
  56 +
51 57  
52 58  
53 59  
... ...
src/utils/utils.js
... ... @@ -12,6 +12,43 @@ export default {
12 12 return pwd;
13 13 },
14 14  
  15 + parseParams: function (data) {
  16 + try {
  17 + var tempArr = [];
  18 + for (var i in data) {
  19 + var key = (i);
  20 + var value = encodeURIComponent(data[i]);//decodeURIComponent
  21 + tempArr.push(key + '=' + value);
  22 + }
  23 + var urlParamsStr = tempArr.join('&');
  24 + return urlParamsStr;
  25 + } catch (err) {
  26 + return '';
  27 + }
  28 + },
  29 +
  30 +
  31 + IsWeixinOrAlipay: function () {
  32 + if (/MicroMessenger/.test(window.navigator.userAgent)) {
  33 + console.log("微信客户端");
  34 + //this.switchShow("wxPay");
  35 + return 4
  36 + } else if (/AlipayClient/.test(window.navigator.userAgent)) {
  37 + console.log("支付宝客户端");
  38 + //this.switchShow("aliPay");
  39 + return 1
  40 + } else if (/BankabciPhone/.test(window.navigator.userAgent)) {
  41 + console.log("农行客户端");
  42 + return 1
  43 + } else if (/BankabcAndroid/.test(window.navigator.userAgent)) {
  44 + console.log("农行客户端");
  45 + return 1
  46 + } else {
  47 + console.log("其他浏览器");
  48 + return 1
  49 + }
  50 + },
  51 +
15 52  
16 53  
17 54 dateFormat: function (msd) { // 时间转换
... ...