|
@@ -22,6 +22,8 @@ export default {
|
|
|
isPay: false,
|
|
|
popup: false,
|
|
|
msData: {},
|
|
|
+ orderTimeEvent: null,
|
|
|
+ orderTime: null
|
|
|
};
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
@@ -134,6 +136,7 @@ export default {
|
|
|
message: '网络连接失败,请重试',
|
|
|
duration: 3000,
|
|
|
onClose: () => {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.replace({
|
|
|
// path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
|
|
|
path: 'home',
|
|
@@ -240,6 +243,7 @@ export default {
|
|
|
if (res?.paymentType === 'NO_FEE_PAY') {
|
|
|
this.btnLoading = false;
|
|
|
this.isPay = false
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.replace({
|
|
|
path: this.getPagePath(),
|
|
|
});
|
|
@@ -250,6 +254,7 @@ export default {
|
|
|
} catch (err) {
|
|
|
if(err ==='ERR_NETWORK') {
|
|
|
setTimeout(() => {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.replace({
|
|
|
// path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
|
|
|
path: 'home',
|
|
@@ -310,6 +315,7 @@ export default {
|
|
|
if (weixinH5PayRes?.errMsg === 'requestPayment:ok') {
|
|
|
this.btnLoading = false
|
|
|
this.isPay = false
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
|
|
|
name: 'parkingFeeDetail'
|
|
|
});
|
|
@@ -351,6 +357,7 @@ export default {
|
|
|
} else {
|
|
|
this.btnLoading = false;
|
|
|
this.isPay = false
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.replace({
|
|
|
// path: 'parkingFeeSuccess?vehicleNo=' + this.$route.query.vehicleNo,
|
|
|
path: this.getPagePath(),
|
|
@@ -367,6 +374,7 @@ export default {
|
|
|
this.btnLoading = true;
|
|
|
uni.showToast({ title: '网络连接失败,请重试', duration: 3000, icon: 'fail' });
|
|
|
setTimeout(() => {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.replace({
|
|
|
// path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
|
|
|
path: 'home',
|
|
@@ -452,6 +460,7 @@ export default {
|
|
|
}, 700);
|
|
|
// 如果 无牌车扫码出场扫码 无需缴费,直接展示无需缴费页面
|
|
|
if(/unlicensedOut/.test(res.code) && res?.unlicensed) {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.replace({
|
|
|
path: 'parkingFeeMsg?type=pay',
|
|
|
});
|
|
@@ -465,6 +474,7 @@ export default {
|
|
|
message: '当前无需缴费',
|
|
|
confirmButtonColor: '#333',
|
|
|
}).then(() => {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.back()
|
|
|
});
|
|
|
}, 1000)
|
|
@@ -472,6 +482,7 @@ export default {
|
|
|
}
|
|
|
if ( /CAR_NOT_FOUND|INOUT_FAILED/.test(res.code) ) {
|
|
|
setTimeout(() => {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.replace({
|
|
|
path: 'parkingFeeMsg',
|
|
|
query: {
|
|
@@ -483,6 +494,7 @@ export default {
|
|
|
}
|
|
|
if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(res.code)) {
|
|
|
// 当前车辆没有查到账单
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.replace({
|
|
|
path: 'parkingFeePayment',
|
|
|
query: {
|
|
@@ -494,9 +506,28 @@ export default {
|
|
|
}
|
|
|
if (/LOCAL_PARK_ERROR|INTERNAL_SERVER_ERROR|VALIDATION_FAILED|PLEASE_SCAN_QRCODE/g.test(res.code)) {
|
|
|
setTimeout(() => {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.back()
|
|
|
}, 3000)
|
|
|
}
|
|
|
+ },
|
|
|
+ enquiryFarePolling: () => {
|
|
|
+ this.orderTimeEvent = setInterval(() => {
|
|
|
+ if(!this.orderTime) {
|
|
|
+ this.orderTime = new Date().getTime()
|
|
|
+ }
|
|
|
+ const nowTime = new Date().getTime()
|
|
|
+ if(nowTime - this.orderTime >= 2.8 * 60 * 1000) {
|
|
|
+ if(this.$route.name !== 'parkingFeeDetail') {
|
|
|
+ this.$router.back()
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.orderTime = new Date().getTime()
|
|
|
+ this.resetCountDown()
|
|
|
+ }, 250)
|
|
|
+ }
|
|
|
+ // console.log(509, (nowTime - this.orderTime) / 1000);
|
|
|
+ }, 1100);
|
|
|
}
|
|
|
});
|
|
|
setTimeout(() => {
|
|
@@ -506,6 +537,7 @@ export default {
|
|
|
console.log('查询车辆是否在场的报错信息?', err, err.code === "INTERNAL_SERVER_ERROR");
|
|
|
// 如果网络异常(这里是因为订单页面存在空白场景,才需要单独处理报错交互)
|
|
|
if (err.code === "INTERNAL_SERVER_ERROR") {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
this.$router.back()
|
|
|
}
|
|
|
}
|
|
@@ -582,7 +614,8 @@ export default {
|
|
|
resetCountDown() {
|
|
|
this.$refs?.countDown?.reset();
|
|
|
this.btnLoading = false;
|
|
|
- this.isPay = false
|
|
|
+ this.isPay = false;
|
|
|
+ this.popup = false;
|
|
|
this.$store.dispatch('order/orderInit', {
|
|
|
gateId: this.$route.query?.gateId,
|
|
|
vehicleNo: this.$route.query?.vehicleNo,
|
|
@@ -637,6 +670,15 @@ export default {
|
|
|
return this.orderDetail.parkInfo.description.replace(reg, '\r\n').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
|
|
|
}
|
|
|
return ''
|
|
|
+ },
|
|
|
+ clearOrderTimeEvent() {
|
|
|
+ if(this.orderTimeEvent) {
|
|
|
+ clearInterval(this.orderTimeEvent);
|
|
|
+ this.orderTime = null
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ destroyed() {
|
|
|
+ this.clearOrderTimeEvent()
|
|
|
+ }
|
|
|
};
|