Commit 04d41f2ee16e995b56fdfa6bfa256b44b3d06de3
1 parent
c5c786b3
领取优惠券
Showing
3 changed files
with
85 additions
and
5 deletions
index.html
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> |
| 9 | 9 | <meta http-equiv="Pragma" content="no-cache" /> |
| 10 | 10 | <meta http-equiv="Expires" content="0" /> |
| 11 | - <title>扫描领券</title> | |
| 11 | + <title>扫码领券</title> | |
| 12 | 12 | </head> |
| 13 | 13 | <body> |
| 14 | 14 | <div id="app"></div> | ... | ... |
src/views/parkPay/coupon.vue
| 1 | 1 | <template> |
| 2 | - <div> | |
| 2 | + <div v-show="loadFlag"> | |
| 3 | 3 | <img :src="imgurl" alt="" style="margin: 10px auto;width: 64px;height: 64px;"> |
| 4 | 4 | <div style="padding: 10px 30px 50px"> |
| 5 | 5 | <p>尊敬的车主您好:{{ tipText }}</p> |
| 6 | 6 | </div> |
| 7 | 7 | <div style="padding: 0 20px"> |
| 8 | - <mt-button size="large" type="primary" @click="toPay" style="margin-bottom: 20px;" v-show="payFlag">去支付停车费用 | |
| 8 | + <mt-button size="large" type="primary" @click="toPay" style="margin-bottom: 20px;" v-show="payFlag">去查询停车费用 | |
| 9 | 9 | </mt-button> |
| 10 | 10 | <mt-button size="large" type="danger" @click="toBackPage">返回</mt-button> |
| 11 | 11 | </div> |
| ... | ... | @@ -27,7 +27,7 @@ export default { |
| 27 | 27 | name: "coupon", |
| 28 | 28 | data() { |
| 29 | 29 | return { |
| 30 | - imgurl: '', | |
| 30 | + imgurl: require('../../assets/images/successIcon.png'), | |
| 31 | 31 | successiconUrl: require('../../assets/images/successIcon.png'), |
| 32 | 32 | loseiconUrl: require('../../assets/images/loseIcon.png'), |
| 33 | 33 | carNum: '', |
| ... | ... | @@ -38,6 +38,8 @@ export default { |
| 38 | 38 | tipText: '', |
| 39 | 39 | payFlag: true, |
| 40 | 40 | couponsType:1,// 1:按次优惠,2:按时优惠,3:折扣优惠(打折),4:满减优惠' |
| 41 | + cardRuleName:'', | |
| 42 | + loadFlag:false, | |
| 41 | 43 | } |
| 42 | 44 | }, |
| 43 | 45 | created() { |
| ... | ... | @@ -82,6 +84,7 @@ export default { |
| 82 | 84 | this.payFlag = true |
| 83 | 85 | this.imgurl = this.successiconUrl |
| 84 | 86 | this.tipText = '领取优惠券成功' |
| 87 | + this.cardRuleName = response.data.cardRuleName | |
| 85 | 88 | this.couponsType = response.data.cardType |
| 86 | 89 | console.log(this.couponsType) |
| 87 | 90 | } else { |
| ... | ... | @@ -89,6 +92,9 @@ export default { |
| 89 | 92 | this.imgurl = this.loseiconUrl |
| 90 | 93 | this.tipText = response.message |
| 91 | 94 | } |
| 95 | + setTimeout(() => { | |
| 96 | + this.loadFlag = true | |
| 97 | + }, 300); | |
| 92 | 98 | |
| 93 | 99 | // this.tipText = |
| 94 | 100 | }) |
| ... | ... | @@ -194,7 +200,7 @@ export default { |
| 194 | 200 | |
| 195 | 201 | } else { |
| 196 | 202 | //$('.dialog-out').show() |
| 197 | - this.$msgbox('提示', '现在您无需缴费,请在15分钟内离场') | |
| 203 | + this.$msgbox('提示', '成功领取'+this.cardRuleName+',离场时自动抵扣') | |
| 198 | 204 | } |
| 199 | 205 | |
| 200 | 206 | }) | ... | ... |
src/views/parkPay/plateNumber.vue
| ... | ... | @@ -58,6 +58,15 @@ |
| 58 | 58 | <!--</label>--> |
| 59 | 59 | <!--</div>--> |
| 60 | 60 | |
| 61 | + <div v-if="historyList.length>0"> | |
| 62 | + <p style="margin-bottom: 18px;margin-top: 18px;"></p> | |
| 63 | + <p style="margin-bottom: 18px;margin-top: 18px;">历史输入车牌号码</p> | |
| 64 | + | |
| 65 | + <mt-cell :title="i.carNumberColor | filterCarNumberColor" is-link v-for="(i, index) in historyList" :key="index" @click.native="toNext(i)"> | |
| 66 | + <span style="color: green">{{i.carNumber}}</span> | |
| 67 | + </mt-cell> | |
| 68 | + | |
| 69 | + </div> | |
| 61 | 70 | |
| 62 | 71 | <div class="submit-box" @click="submitFn()"> |
| 63 | 72 | 领取 |
| ... | ... | @@ -329,9 +338,12 @@ export default { |
| 329 | 338 | submitConfirmText: '', |
| 330 | 339 | carType: '', |
| 331 | 340 | codeType: '', |
| 341 | + historyList:[], | |
| 332 | 342 | } |
| 333 | 343 | }, |
| 334 | 344 | created() { |
| 345 | + this.historyList = localStorage.getItem('historyArr')?JSON.parse(localStorage.getItem('historyArr')):[] | |
| 346 | + console.log(this.historyList ) | |
| 335 | 347 | this.carType = this.$route.query.carType |
| 336 | 348 | this.codeType = this.$route.query.codeType |
| 337 | 349 | console.log(this.codeType) |
| ... | ... | @@ -448,6 +460,26 @@ export default { |
| 448 | 460 | this.$emit('getPlateLicense', plateLicense) |
| 449 | 461 | console.log(plateLicense); |
| 450 | 462 | |
| 463 | + // historyArr 0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色 | |
| 464 | + // indexOf | |
| 465 | + if(JSON.stringify(this.historyList).includes(JSON.stringify({ | |
| 466 | + carNumber:plateLicense, | |
| 467 | + carNumberColor:this.currentColor, | |
| 468 | + })) ){ | |
| 469 | + console.log('122') | |
| 470 | + | |
| 471 | + }else{ | |
| 472 | + if(this.historyList.length==3){ | |
| 473 | + this.historyList.splice(0,1) | |
| 474 | + } | |
| 475 | + this.historyList.push({ | |
| 476 | + carNumber:plateLicense, | |
| 477 | + carNumberColor:this.currentColor, | |
| 478 | + }) | |
| 479 | + | |
| 480 | + localStorage.setItem('historyArr',JSON.stringify(this.historyList)) | |
| 481 | + } | |
| 482 | + | |
| 451 | 483 | |
| 452 | 484 | this.$router.push({ |
| 453 | 485 | path: 'coupon', |
| ... | ... | @@ -461,6 +493,21 @@ export default { |
| 461 | 493 | } |
| 462 | 494 | }) |
| 463 | 495 | }, |
| 496 | + toNext(i){ | |
| 497 | + console.log(i) | |
| 498 | + | |
| 499 | + this.$router.push({ | |
| 500 | + path: 'coupon', | |
| 501 | + query: { | |
| 502 | + carNumber: i.carNumber, | |
| 503 | + carNumberColor: i.currentColor, | |
| 504 | + carType: 2, | |
| 505 | + codeType: this.codeType, | |
| 506 | + cardRelParkNo: this.$route.query.cardRelParkNo, | |
| 507 | + key: this.$route.query.key | |
| 508 | + } | |
| 509 | + }) | |
| 510 | + }, | |
| 464 | 511 | palindrome(str) { |
| 465 | 512 | var arr = str.split('') |
| 466 | 513 | arr = arr.filter(function (val) { |
| ... | ... | @@ -550,6 +597,26 @@ export default { |
| 550 | 597 | this.formData.num7 |
| 551 | 598 | ) |
| 552 | 599 | } |
| 600 | + }, | |
| 601 | + filters:{ | |
| 602 | + filterCarNumberColor(val){ | |
| 603 | + // 0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色 | |
| 604 | + if(val==0){ | |
| 605 | + return '蓝牌' | |
| 606 | + } | |
| 607 | + if(val==1){ | |
| 608 | + return '黄牌' | |
| 609 | + } | |
| 610 | + if(val==2){ | |
| 611 | + return '白牌' | |
| 612 | + } | |
| 613 | + if(val==3){ | |
| 614 | + return '黑牌' | |
| 615 | + } | |
| 616 | + if(val==4){ | |
| 617 | + return '绿色' | |
| 618 | + } | |
| 619 | + } | |
| 553 | 620 | } |
| 554 | 621 | } |
| 555 | 622 | </script> |
| ... | ... | @@ -865,4 +932,11 @@ export default { |
| 865 | 932 | cursor: pointer; |
| 866 | 933 | } |
| 867 | 934 | } |
| 935 | + | |
| 936 | +>>> .mint-cell-wrapper{ | |
| 937 | + background-image:none; | |
| 938 | +} | |
| 939 | + >>> .mint-cell:last-child{ | |
| 940 | + background-image:none; | |
| 941 | + } | |
| 868 | 942 | </style> | ... | ... |