zhengkaixin 3 роки тому
батько
коміт
259734f5b1

+ 2 - 1
src/components/Common.vue

@@ -82,7 +82,8 @@
 						const step1 = API_WeiXin.getDataByCode(code).then(response => {
 							//console.log(response)
 							this.set_openid(response.openid);
-
+							window.localStorage.setItem("xpgj_wx_user_info", JSON.stringify(response))
+							
 							//角色判定调用不同的信息获取详情
 							this.getDataByOpenId();
 

+ 17 - 4
src/projects/parking/apis/car.js

@@ -51,21 +51,34 @@ export function parkingTradeWebPay(params) {
 
 
 //获取停车场信息
-export function userGetCarDetail(code,companyId) {
+export function userGetCarDetail(code,companyId,qrCode) {
 	return request({
-		url: '/mobile/parkingInfoApi/userGetCarDetail?carNumber='+code+'&merchantId='+companyId,
+		url: '/mobile/parkingInfoApi/userGetCarDetail?carNumber='+code+'&merchantId='+companyId+"&qrCode="+qrCode,
 		
 		method: 'get',
 	})
 }
 
 //获取停车场信息
-export function userGetCarMember(carNumber,companyId) {
+export function userGetCarMember(carNumber,companyId,qrCode) {
 	return request({
 		url: '/mobile/parkingInfoApi/userGetCarMember',
 		data: Qs.stringify({
 			carNumber:carNumber,
-			 merchantId:companyId
+			 merchantId:companyId,
+			 qrCode:qrCode,
+		}),
+		method: 'post',
+	})
+}
+
+export function validQrCode(companyId,qrCode) {
+	return request({
+		url: '/mobile/parkingInfoApi/validQrCode',
+		data: Qs.stringify({
+		 
+			 merchantId:companyId,
+			 qrCode:qrCode,
 		}),
 		method: 'post',
 	})

+ 45 - 9
src/projects/parking/views/Car/Input.vue

@@ -1,9 +1,29 @@
 <template>
 	<div>
 		<common-car ref="common" @asynCallBack="asynCallBack"></common-car>
-		<top-header :pageTitle="pageTitle"></top-header>
+		<top-header :leftShow='false' :pageTitle="pageTitle"></top-header>
 
-		<div class="mui-content vongi-car-index">
+
+		<div class="mui-content" v-if="!qrCode">
+			<div class="vongi-car-over">
+				<img src="~$project/assets/img/car_fail.png" />
+				
+				<h2>链接已失效</h2>
+				<!-- <div class="colorfe616c">请在30分钟内离开停车场,<br>超出时间段将可能产生新的费用</div>
+				<div class="vongi-car-over-line"></div>
+				<p>停车时长:1小时20分钟</p>
+				<p>入场时间:07-12 13:51</p>
+				<p>离场时间:07-12 16:30</p> -->
+			</div>
+			<!--缴费失败-->
+			<!-- <div class="vongi-car-over">
+				<img src="~$project/assets/img/car_fail.png" />
+				<h2>缴费失败!</h2>
+				<div>请重新扫码再试一次,如无法登记车牌,<br>请联系车场管理员。</div>
+			</div>	 -->
+		</div>
+		
+		<div class="mui-content vongi-car-index"  v-if="qrCode">
 			<div class="vongi-car-banner">
 <!-- 				<h5 class="mui-ellipsis">停车位置:{{detail.parkingName}}</h5>
  -->				<div class="flew">
@@ -41,7 +61,8 @@
 	 
 		
 		
-		<div class="vongi-car-footer" style="
+		<div class="vongi-car-footer"
+		 v-if="qrCode" style="
     bottom: 80px;
 ">
 			<div class="mui-media-body">
@@ -78,7 +99,7 @@
 		data() {
 			return {
 				isLoading: false,
-
+				qrCode:'#',
 				pageTitle: '车牌查询',
 
 				searchForm: {
@@ -105,15 +126,18 @@
 					mui.alert('参数错误');
 				}
 			}
+			if(this.$route.query.qrCode){
+				this.qrCode=this.$route.query.qrCode;
+				
+			}
 
-			
 
 		},
 		methods: {
 			//获取停车场信息
 			 submit(){
 				 	this.isLoading = true;
-				 API_Car.userGetCarMember(this.channelForm.carNumber,this.channelForm.companyId).then(response => {
+				 API_Car.userGetCarMember(this.channelForm.carNumber,this.channelForm.companyId,this.qrCode).then(response => {
 					
 				 	this.isLoading = false;
 				 	this.kongResult = false;
@@ -140,7 +164,7 @@
 				if (this.checkForm()) {
 					this.isLoading = true;
 					
-					API_Car.userGetCarDetail(this.searchForm.carNumber,this.parking_company_id).then(response => {
+					API_Car.userGetCarDetail(this.searchForm.carNumber,this.parking_company_id,this.qrCode).then(response => {
 						this.detail=response;
 						this.channelForm={
 							carNumber:this.searchForm.carNumber,
@@ -157,14 +181,26 @@
 					})
 				}
 			},
-			
+			validQrCode(){
+				this.isLoading = true;
+				
+				API_Car.validQrCode(this.parking_company_id,this.qrCode).then(response => {
+					this.isLoading = false;
+					 
+				}).catch(error => {
+					this.isLoading = false;
+					this.qrCode="";
+					mui.toast(error);
+					
+				})
+			},
 			asynCallBack() {},
 			...mapMutations({
 				set_parking_company_id: types.SET_PARKING_COMPANY_ID,
 			})
 		},
 		mounted() {
-			
+			this.validQrCode()
 		
 		},
 		destroyed() {