Bladeren bron

访问调整

zhengkaixin 4 jaren geleden
bovenliggende
commit
3d1e608adb
2 gewijzigde bestanden met toevoegingen van 51 en 32 verwijderingen
  1. 38 6
      src/projects/parking/views/Car/Pay.vue
  2. 13 26
      src/projects/parking/views/Car/Search.vue

+ 38 - 6
src/projects/parking/views/Car/Pay.vue

@@ -6,7 +6,9 @@
 		<div class="mui-content vongi-car-pay">
 			<div class="vongi-car-pay-top">
 				<h4>停车费</h4>
-				<div class="mui-h1" v-text="'¥'+detail.total"></div>
+				<div class="mui-h1"  v-if="!kongResult" v-text="'¥'+detail.total"></div>
+				<div class="mui-h1"  v-if="kongResult"></div>
+				
 			</div>
 			<div class="vongi-qingjiadt">
 				<form class="mui-input-group vongi-cd-payli">
@@ -35,7 +37,9 @@
 		<div class="vongi-cashier-btn-row">
 			<div class="vongi-cashier-btn-white">
 				<span>应缴金额:¥{{detail.price}}</span>
-				<div @click="pay" class="vongi-cashier-btn">支付离场</div>
+				<div @click="pay" v-if="!kongResult" class="vongi-cashier-btn">支付离场</div>
+				<div @click="searchByChannel" v-if="kongResult" class="vongi-cashier-btn">刷新</div>
+				
 			</div>
 		</div>
 
@@ -70,12 +74,18 @@
 				isLoading: false,
 
 				pageTitle: '停车缴费',
-
-				detail: {}
+				kongResult: false,
+				detail: {
+					total:""
+				}
 			}
 		},
 		created() {
-			if (this.$route.params.detail) {
+			
+			
+			if(this.$route.query.channelId){
+				
+			}else  if (this.$route.params.detail) {
 				this.detail = this.$route.params.detail;
 			} else {
 				this.$router.push({
@@ -133,11 +143,33 @@
 					mui.toast(error);
 				})
 			},
+			//查询闸口信息
+			searchByChannel() {
+				this.isLoading = true;
+				var  channelForm={}
+				channelForm.channelId = this.$route.query.channelId;
+				channelForm.companyId = this.parking_company_id;
+				API_Car.channelPayDetail(channelForm).then(response => {
+			
+					this.isLoading = false;
+					this.detail =response;
+					this.kongResult = false;
+			
+				}).catch(error => {
+					this.isLoading = false;
+					mui.toast(error);
+					this.kongResult = true;
+				})
+			},
 			asynCallBack() {
 
 			}
 		},
-		mounted() {},
+		mounted() {
+			if(this.$route.query.channelId){
+				this.searchByChannel()
+			}
+		},
 		destroyed() {
 
 		},

+ 13 - 26
src/projects/parking/views/Car/Search.vue

@@ -75,10 +75,7 @@
 				}
 			}
 
-			if (this.$route.query.channelId) {
-				this.channelForm.channelId = this.$route.query.channelId;
-				this.searchByChannel();
-			}
+			
 
 		},
 		methods: {
@@ -127,34 +124,24 @@
 					})
 				}
 			},
-			//查询闸口信息
-			searchByChannel() {
-				this.isLoading = true;
-				this.channelForm.companyId = this.parking_company_id;
-				API_Car.channelPayDetail(this.channelForm).then(response => {
-
-					this.isLoading = false;
-
-					this.$router.push({
-						name: 'CarPay',
-						params: {
-							detail: response
-						}
-					})
-
-				}).catch(error => {
-					this.isLoading = false;
-					mui.toast(error);
-					this.kongResult = true;
-				})
-			},
+			
 			asynCallBack() {},
 			...mapMutations({
 				set_parking_company_id: types.SET_PARKING_COMPANY_ID,
 			})
 		},
 		mounted() {
-			if (this.parking_company_id) {
+			
+			if (this.$route.query.channelId) {
+			
+				this.$router.push({
+					name: 'CarPay',
+					query: {
+						channelId: this.$route.query.channelId
+					}
+				})
+				
+			}else if (this.parking_company_id) {
 				this.getInfo();
 			}
 		},