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