Commit df8f58a4967529cc578b2dc211712393225cd51f

Authored by 刘淇
1 parent 620e6ed9

货车30分钟免费

Showing 1 changed file with 99 additions and 112 deletions
src/views/parkPay/parkRecord.vue
... ... @@ -10,11 +10,12 @@
10 10 </li>
11 11 </ul>
12 12  
  13 +
13 14 <!--本次缴费-->
14 15 <div v-show="currentTabActive==0">
15 16  
16 17 <div v-if="parkingData.length>0">
17   - <p class="free-tip" v-if="parkingData[0].parkDuration<=2100">停车15分钟内无需缴费,请申请离场。</p>
  18 + <p class="free-tip" v-if="parkingData[0].parkDuration<=900">停车15分钟内(货车30分钟内)无需缴费!</p>
18 19  
19 20 <div class="cost-main" v-for="i in parkingData">
20 21 <ul class="cost-header">
... ... @@ -23,7 +24,7 @@
23 24 </ul>
24 25  
25 26 <div class="cost-body">
26   - <p>车辆类型:临停车</p>
  27 + <!--<p>车辆类型:临停车</p>-->
27 28 <p>车场名称:{{i.parkName}}
28 29 </p>
29 30 <p> 进场时间:{{i.parkInTime}}
... ... @@ -33,23 +34,25 @@
33 34 <p>停车时长:{{ $utils.dateFormat(i.parkDuration)}}</p>
34 35 <div class="out-wrap">
35 36 <p class="mon-wrap">¥{{(i.unPayFee/100).toFixed(2)}}</p>
36   - <p class="out-btn" @click="toPayCurrent1(i,parkingData[0].parkDuration)" v-if="parkingData[0].parkDuration<=900">申请离场</p>
  37 + <p class="out-btn" @click="toPayCurrent(i,parkingData[0].parkDuration)" v-if="parkingData[0].parkDuration<=900">申请离场</p>
  38 + <p class="out-btn" @click="toPayCurrent(i,parkingData[0].parkDuration)" v-else-if="parkingData[0].parkDuration<=1800&parkingData[0].carType==7">申请离场</p>
  39 + <p class="out-btn" @click="toPayCurrent(i,parkingData[0].parkDuration)" v-else-if="parkingData[0].parkDuration<=1800&parkingData[0].carType==8">申请离场</p>
37 40 <p class="out-btn" @click="toPayCurrent(i,parkingData[0].parkDuration)" v-else>出场缴费</p>
38 41 </div>
39 42 </div>
40 43 </div>
41 44 </div>
42 45 <!--没有在停费用-->
43   - <div class="noRecord" v-else> 本次停车暂未产生费用,请及时离场</div>
  46 + <div class="noRecord" v-else>暂无记录</div>
44 47  
45 48  
46 49 </div>
47 50  
48 51  
49 52 <!--历史缴费-->
50   - <div v-show="currentTabActive==1" class="history-con" >
  53 + <div v-show="currentTabActive==1" class="history-con">
51 54 <div v-if="historyList.length>0" style="height: 100%;">
52   - <div class="history-body" >
  55 + <div class="history-body">
53 56 <p class="money-all">总欠费金额:
54 57 <span>¥{{(allMoney/100).toFixed(2)}}</span>
55 58 </p>
... ... @@ -66,7 +69,7 @@
66 69 </ul>
67 70  
68 71 <div class="cost-body">
69   - <!--<p>车辆颜色:临停车</p>-->
  72 + <!--<p>车辆类型:临停车</p>-->
70 73  
71 74 <p>车场名称:{{i.parkName}}
72 75 </p>
... ... @@ -100,8 +103,8 @@
100 103 </div>
101 104  
102 105  
103   - <!--没有历史费用-->
104   - <div class="noRecord" v-else> 暂无历史费用</div>
  106 + <!--没有在停费用-->
  107 + <div class="noRecord" v-else>暂无记录</div>
105 108  
106 109 </div>
107 110  
... ... @@ -109,17 +112,35 @@
109 112  
110 113  
111 114 <div v-else class="noRecord">
112   - 本次停车暂未产生费用,请及时离场
  115 + 暂无记录
113 116 </div>
114 117  
  118 + <!--<modal-alert ref="alert">-->
  119 + <!--<div class="trave-tip-content txt-l" slot="content">-->
  120 + <!--<div class="confirm-text">-->
  121 + <!--<p>请至少选择一笔记录</p>-->
  122 + <!--</div>-->
  123 + <!--</div>-->
  124 + <!--<span slot="button">知道了</span>-->
  125 + <!--</modal-alert>-->
  126 +
  127 +
  128 + <!--<modal-alert ref="zeroAlert">-->
  129 + <!--<div class="trave-tip-content txt-l" slot="content">-->
  130 + <!--<div class="confirm-text">-->
  131 + <!--<p>停车15分钟内无需缴费,申请成功。</p>-->
  132 + <!--</div>-->
  133 + <!--</div>-->
  134 + <!--<span slot="button">知道了</span>-->
  135 + <!--</modal-alert>-->
  136 +
115 137  
116 138 </div>
117 139 </template>
118 140  
119 141 <script>
120   -
121   -import { parkRecordList, historyQuery, parkingQuery, appApplyParkOut } from '@/api/parkRecord/parkRecord.js'
122   -
  142 +import {parkRecordList, historyQuery, parkingQuery, appApplyParkOut} from '@/api/parkRecord/parkRecord.js'
  143 +import axios from 'axios'
123 144  
124 145 export default {
125 146 name: 'parkRecord',
... ... @@ -127,40 +148,40 @@ export default {
127 148 return {
128 149 tabList: [ // 切换数据
129 150 { text: '在停缴费', id: 1 },
130   - { text: '欠费待缴', id: 2 },
  151 + { text: '离场待缴', id: 2 },
131 152 ],
132 153 carColor: 1,// 车牌颜色
133 154 currentTabActive: 0, // 显示当前哪个
134 155 carNumber: '', // 车牌号码
135   - parkingData:[], // 在停数据
  156 + parkingData: [], // 在停数据
136 157 parkList: [], // 停车记录数据
137   - historyList:[ // 历史欠费数据
138   - {money:100,checked:false, id: 1},
139   - ] ,
140   - allChecked:false, // 全部选择事件
141   - allMoney:0, // 欠费所有的费用
142   - historyCheckedLen:0, //选中了几笔交易
  158 + historyList: [ // 历史欠费数据
  159 + { money: 100, checked: false, id: 1 },
  160 + ],
  161 + allChecked: false, // 全部选择事件
  162 + allMoney: 0, // 欠费所有的费用
  163 + historyCheckedLen: 0, //选中了几笔交易
143 164 historyCheckedMon: 0, //选中了待缴纳的金额
144 165 orderIds: [] // 选中数据的订单 数组
145 166 }
146 167 },
147   - mounted(){
148   -
  168 + mounted() {
149 169  
150 170 },
151 171 created() {
  172 + // this.$Indicator.open({
  173 + // text: '加载中...',
  174 + // spinnerType: 'fading-circle'
  175 + // })
152 176 this.carNumber = this.$route.query.carNumber // 获取车牌号
153 177 this.carColor = this.$route.query.carNumberColor // 获取颜色 0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色
154   - this.currentTabActive = this.$route.query.parkFlag ? this.$route.query.parkFlag : 0 // 0在停 1历史
  178 + this.currentTabActive = this.$route.query.parkFlag ? this.$route.query.parkFlag : 0
  179 + console.log(this.currentTabActive)
155 180 console.log(this.carNumber)
156 181 this.parkRecordList(this.carNumber)
157   -
158   -
159   - //
160   -
161 182 },
162 183 methods: {
163   - parkRecordList(){ // 获取停车记录数据
  184 + parkRecordList() { // 获取停车记录数据
164 185 var salt = this.$utils.myCommonSalt(32);
165 186 var jsondata = {
166 187 app_id: this.$utils.myVarAppid,
... ... @@ -173,8 +194,8 @@ export default {
173 194 terminalSource: 7,
174 195 carNumber: this.carNumber,
175 196 carNumberColor: this.carColor,
176   - // sign: md5sign,
177   - orgId: this.$utils.myOrgId
  197 + orgId: this.$utils.myOrgId,
  198 +
178 199 }
179 200 jsondata.sign = this.$utils.signObject(jsondata)
180 201  
... ... @@ -187,14 +208,13 @@ export default {
187 208 this.parkingData = this.parkList.filter(item => {
188 209 return item.parkState == '10'
189 210 })
190   - // if(this.parkingData.length>0){
  211 + // if (this.parkingData.length > 0) {
191 212 // this.currentTabActive = 0
192 213 // }
193 214 console.log(this.parkingData)
194 215 this.historyList = this.parkList.filter(item => {
195 216 return item.parkState == '20'
196 217 })
197   -
198 218 this.historyList.forEach( i => {
199 219 this.allMoney += Number(i.unPayFee)
200 220 })
... ... @@ -208,6 +228,9 @@ export default {
208 228 this.checkedAll()
209 229 }
210 230 console.log(this.historyList)
  231 +
  232 + this.$Indicator.close()
  233 +
211 234 })
212 235 },
213 236  
... ... @@ -217,37 +240,36 @@ export default {
217 240 chooseHandle(i, index) { // 历史欠费单个选择事件
218 241 i.checked = !i.checked
219 242 let me = this
220   - if(i.checked ){ //单个选中
221   - me.historyCheckedLen ++
222   - if(me.historyCheckedLen == this.historyList.length){
  243 + if (i.checked) { //单个选中
  244 + me.historyCheckedLen++
  245 + if (me.historyCheckedLen == this.historyList.length) {
223 246 this.allChecked = true
224 247  
225 248 }
226 249 me.orderIds.push(i.orderId)
227 250 me.historyCheckedMon += Number(i.unPayFee)
228   - }else{ //单个不选中
  251 + } else { //单个不选中
229 252 let _i = me.orderIds.indexOf(i.orderId)
230   - me.orderIds.splice(_i,1)
  253 + me.orderIds.splice(_i, 1)
231 254 this.allChecked = false
232   - me.historyCheckedLen --
  255 + me.historyCheckedLen--
233 256 me.historyCheckedMon -= Number(i.unPayFee)
234 257 }
235 258  
236   -
237 259 },
238 260 checkedAll() { // 全选选择事件
239 261 this.allChecked = !this.allChecked
240   - if(this.allChecked){ //全选
241   - let me = this
242   - this.historyList.forEach(function(item){
  262 + if (this.allChecked) { //全选
  263 + let me = this
  264 + this.historyList.forEach(function (item) {
243 265 item.checked = true;
244 266 me.orderIds.push(item.orderId)
245 267 });
246 268 this.historyCheckedMon = this.allMoney
247 269 this.historyCheckedLen = this.historyList.length
248 270  
249   - }else{ //反选
250   - this.historyList.forEach(function(item){
  271 + } else { //反选
  272 + this.historyList.forEach(function (item) {
251 273 item.checked = false;
252 274  
253 275 });
... ... @@ -258,45 +280,6 @@ export default {
258 280 },
259 281 toPayCurrent(i, num) { // 缴纳本次在停费用
260 282 var salt = this.$utils.myCommonSalt(32);
261   - var jsondata = {
262   - app_id: this.$utils.myVarAppid,
263   - deviceInfo: this.$utils.myDeviceInfo,
264   - salt: salt,
265   - sign_type: "md5",
266   - payType: this.$utils.clientBrowsePayType(),
267   - appId: this.$utils.myVxAppId,
268   - orderId: i.orderId,
269   - terminalSource: '7',
270   - parkCode: i.parkCode,
271   - carNumber: this.carNumber,
272   - }
273   - jsondata.sign = this.$utils.signObject(jsondata)
274   - parkingQuery(jsondata).then(result => {
275   - console.log(result)
276   - let res = result.data
277   - let _dis = res.discountFee
278   - let discountFee = _dis.slice(1, _dis.length - 1)
279   -
280   - this.$router.push(
281   - {
282   - path: 'orderPay',
283   - query: {
284   - carColor: this.carColor,// 车牌颜色
285   - arrearageTotalFee: res.orderTotalFee,// 应收
286   - arrearageDiscFee: discountFee * 100,// 优惠
287   - arrearageActFee: res.orderFee,// 实收
288   - carNumber: this.carNumber, // 车牌
289   - paySrcType: 101, //支付的类型 101 是本次 103是历史欠费
290   - ordeID: i.orderId, //支付的订单号
291   - appOrderTimeout: res.appOrderTimeout, // 超时描述
292   - }
293   - }
294   - )
295   - })
296   -
297   - },
298   - toPayCurrent1(i, num) { // 缴纳本次在停费用
299   - var salt = this.$utils.myCommonSalt(32);
300 283 var params = {
301 284 app_id: this.$utils.myVarAppid,
302 285 deviceInfo: this.$utils.myDeviceInfo,
... ... @@ -310,7 +293,7 @@ export default {
310 293 appApplyParkOut(params).then(response => {
311 294 console.log(response)
312 295  
313   - if (response.code == '0') {
  296 + if (response.code == '5005') {
314 297 var salt = this.$utils.myCommonSalt(32);
315 298 var jsondata = {
316 299 app_id: this.$utils.myVarAppid,
... ... @@ -350,14 +333,14 @@ export default {
350 333  
351 334 } else {
352 335 //$('.dialog-out').show()
353   - this.$msgbox('提示', response.message)
  336 + this.$msgbox('提示', '您已成功申请离场!')
354 337 }
355 338  
356 339 })
357 340  
358 341 },
359 342 toPayHisroryPage() { // 缴纳历史费用
360   - if(this.historyCheckedLen==0){
  343 + if (this.historyCheckedLen == 0) {
361 344 this.$msgbox('提示', '请至少选择一条记录')
362 345  
363 346 return
... ... @@ -375,37 +358,39 @@ export default {
375 358 appId: this.$utils.myVxAppId,
376 359 orderIds: list,
377 360 terminalSource: '7',
378   - payType: 4,
  361 + payType: this.$utils.clientBrowsePayType(),
379 362 orgId: this.$utils.myOrgId,
  363 + backDeveloperCode: this.$route.query.backDeveloperCode
380 364 }
381 365 jsondata.sign = this.$utils.signObject(jsondata)
382   -
  366 + console.log(jsondata)
383 367 historyQuery(jsondata).then(response => {
384 368 console.log(response)
385 369 let res = response.data.carArrearages[0]
386 370 console.log(res)
  371 +
387 372 this.orderIds = JSON.stringify(this.orderIds)
  373 + console.log(this.orderIds)
388 374 this.$router.push(
389 375 {
390   - path:'orderPay',
391   - query:{
392   - carColor:this.carColor,// 车牌颜色
  376 + path: 'orderPay',
  377 + query: {
  378 + carColor: this.carColor,// 车牌颜色
393 379 arrearageTotalFee: res.arrearageTotalFee,// 应收
394 380 arrearageDiscFee: res.arrearageDiscFee,// 优惠
395 381 arrearageActFee: res.arrearageActFee,// 实收
396 382 carNumber: this.carNumber, // 车牌
397 383 paySrcType: 103, //支付的类型 101 是本次 103是历史欠费
398 384 ordeID: this.orderIds, //支付的订单号
399   - appOrderTimeout: ''
  385 + appOrderTimeout: '',
  386 + backDeveloperCode: response.data.inChargerCode
400 387 }
401 388 }
402 389 )
403 390 })
404 391 }
405 392 },
406   - filters: {
407   -
408   - }
  393 + filters: {}
409 394 }
410 395 </script>
411 396  
... ... @@ -507,70 +492,72 @@ export default {
507 492 }
508 493 }
509 494  
510   - .history-con{
  495 + .history-con {
511 496 height: calc(100% - 38px);
512 497 overflow: hidden;
513 498 }
514   - .history-body{
  499 +
  500 + .history-body {
515 501 height: calc(100% - 81px);
516 502 overflow-y: scroll;
517 503 }
518   - .history-footer{
  504 +
  505 + .history-footer {
519 506 height: 81px;
520 507 background: #F8F8F8;
521 508 }
522 509  
523   - .cost-main-history{
  510 + .cost-main-history {
524 511 margin-bottom: 10px;
525   - background:#fff url("../../assets/images/parkPay/choose.png") no-repeat 10px center;
  512 + background: #fff url("../../assets/images/parkPay/choose.png") no-repeat 10px center;
526 513 background-size: 20px 20px;
527 514 cursor: pointer;
528 515 }
529 516  
530   -
531   - .isChecked{
532   - background:#fff url("../../assets/images/parkPay/choosed.png") no-repeat 10px center;
  517 + .isChecked {
  518 + background: #fff url("../../assets/images/parkPay/choosed.png") no-repeat 10px center;
533 519 background-size: 20px 20px;
534 520 }
535 521  
536   - .money-all{
  522 + .money-all {
537 523 padding-left: 18px;
538 524 height: 25px;
539 525 line-height: 25px;
540 526 font-weight: 500;
541 527 background: #FEF8DB;
542   - span{
  528 + span {
543 529 color: #BC0202;
544 530 }
545 531 }
546 532  
547   - .statistical-data{
  533 + .statistical-data {
548 534 padding-left: 18px;
549 535 height: 32px;
550 536 line-height: 32px;
551 537 background: #E6FAFA;
552   - span{
  538 + span {
553 539 color: #D20000;
554 540 }
555 541 }
556   - .opration-wrap{
  542 +
  543 + .opration-wrap {
557 544 padding-left: 18px;
558 545 height: 49px;
559 546 line-height: 49px;
560 547 background: #f8f8f8;
561 548 display: flex;
562 549 justify-content: space-between;
563   - .check-btn{
  550 + .check-btn {
564 551 padding-left: 30px;
565 552 background: url("../../assets/images/parkPay/choose.png") no-repeat 0 center;
566 553 background-size: 20px 20px;
567 554 cursor: pointer;
568 555 }
569   - .isAllChecked{
  556 + .isAllChecked {
570 557 background: url("../../assets/images/parkPay/choosed.png") no-repeat 0 center;
571 558 background-size: 20px 20px;
572 559 }
573   - .settle-btn{
  560 + .settle-btn {
574 561 width: 106px;
575 562 height: 49px;
576 563 background: linear-gradient(145deg, #2783E9 0%, #227ADC 100%);
... ...