zhengkaixin 3 年之前
父節點
當前提交
58959d576d

+ 23 - 12
pages/searchPile/apointment/apointmentRecharge.vue

@@ -60,14 +60,22 @@
 			</p>
 			
 		</view>
-		
-		<view class="bottom">
+		<u-modal v-model="show">
+			<view style="padding: 10px;">
+				因您近期存在预约超时未前往充电的违约行为,平台为保证每位车主的合理权益,
+				对您作出停用预约充电功能1天的处罚。
+				您可于<span style="color: #00b962;">{{lockTime}}</span>后使用此功能。
+			</view>
 			
-		:class="{
-			buttonlockStatus:lockStatus
-				button:!lockStatus
-		}"
-				
+		</u-modal>
+
+		<view class="bottom">
+			<u-button
+			:class="{
+				button:!lockStatus,
+					buttonlockStatus:lockStatus
+			}"
+		
 			@click="submit()"
 			shape="square">提交预约</u-button>
 		</view>
@@ -95,7 +103,7 @@
 				apointment:"",
 				selectTime:15,
 				selectNum:60,
-				
+				show:false,
 			}
 		},
 		onLoad(op) {
@@ -150,7 +158,9 @@
 					uni.hideLoading()
 					this.lockStatus=res.data.lockStatus
 					this.lockTime=res.data.lockTime
-					
+					if(this.lockStatus){
+						this.show=true;
+					}
 					this.detail= {
 						stationName:res.data.gun.stationName,
 						deviceName:res.data.gun.deviceName,
@@ -163,6 +173,7 @@
 						if(this.timeList.indexOf("30")>-1){
 							this.selectTime='30'
 						}
+						//this.timeList=[2]
 					}
 					
 				}).catch(error => {
@@ -347,10 +358,10 @@
 			}
 			.buttonlockStatus{
 				border-radius: 50px;
-				background-color: rgba(0, 185, 98, 100);
-				    background-color: #e7edea;
-				    color: #141212;
+			
+				 background-color: #c1c5c3;
 				color: rgba(255, 255, 255, 100);
+				
 				font-size: 16px;
 			}
 		

+ 32 - 7
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -105,7 +105,12 @@
 </template>
 <script>
 	import * as API from "@/apis/chargeProcess.js"
-
+	
+	import {
+		hourDistanceArr,
+		currentTimeStamp,
+		parseUnixTime
+	} from '@/utils'
 	export default {
 		data() {
 			return {
@@ -189,11 +194,12 @@
 			},
 			role() {
 				uni.hideToast();
-				console.log(1)
+			
 				var id = this.id;
 				var info = this.carhelp.getPersonInfo();
-				if (info) {
-				
+				if (info) {
+					  uni.hideLoading();
+					this.isReady=true;
 				} else {
 					
 					uni.showModal({
@@ -224,9 +230,28 @@
 					this.car = res.data.car
 					this.role()
 					if(res.data.chargingAppointment){
-						uni.reLaunch({
-							url:"/pages/user/myReservation/reservationListDetails?id="+res.data.chargingAppointment.id+"&qr=1&stationId="+this.detail.stationId+"&deviceNo="+this.detail.deviceNo+"&gun="+this.gun.channelNo+"&carNumber="+(this.car?this.car.carNum:"")
-						})
+						
+						if(res.data.isMeAppoint){
+							uni.reLaunch({
+								url:"/pages/user/myReservation/reservationListDetails?id="+res.data.chargingAppointment.id+"&qr=1&stationId="+this.detail.stationId+"&deviceNo="+this.detail.deviceNo+"&gun="+this.gun.channelNo+"&carNumber="+(this.car?this.car.carNum:"")
+							})
+						}else{
+							var chargingAppointment =res.data.chargingAppointment
+							var data=new Date(chargingAppointment.createTime).getTime()
+							var c=hourDistanceArr(new Date(),new Date(data+chargingAppointment.reserveMinutes*60*1000))
+							
+							var description= '当前充电枪已被其他车主预约,'+c[1]+'分'+c[2]+"秒后预约自动失效。";
+							this.isReady=false;				
+												
+							uni.showModal({
+								content: description,
+								showCancel: false,
+								success: () => {
+									
+								}
+							})
+						}
+						
 					}
 					
 					uni.hideLoading()

+ 46 - 11
pages/user/myReservation/reservationListDetails.vue

@@ -3,26 +3,27 @@
 		<u-navbar title="预约单详情" :custom-back="customback" >
 		
 		</u-navbar>
-		<view class="iconfont tittle-font">
+	<!-- 	<view class="iconfont tittle-font">
 			&#xe616;
-		</view>
+		</view> -->
 		<u-alert-tips type="warning" v-if="detail.status==0"  :description="description"></u-alert-tips>
 		
  		<view class="reverse-time">
-			<view class="time">
+			<view class="time refused" v-if="detail.status==4||detail.status==5||detail.status==6">
+					{{detail.statusText}}
+				</view> 
+			<view class="time" v-else >
 				预留{{detail.reserveMinutes}}分钟
-				<view class="img-box" v-if="detail.status==1">
-					<img src="@/assets/img/finished.png" alt="">
+				<view class="img-box" >
+					<img src="@/assets/img/finished.png" v-if="detail.status==1" alt="">
 					<!-- 已取消 -->
-					<!-- <img src="../../../static/img/canc.png" alt=""> -->
+					  <img src="../../../static/img/canc.png" v-if="detail.status==3" alt=""> - 
 					<!-- 已完成-->
-					<!-- <img src="../../../static/img/f.png" alt=""> -->
+					 <img src="../../../static/img/f.png" v-if="detail.status==2" alt=""> 
 				</view>
 			</view>
 			<!-- 已取消/已拒绝 -->
-			<!-- 	<view class="time refused">
-					已取消
-				</view> -->
+			<!-- 	-->
 			<view class="details-item">
 				<view class="item">
 					<view class="item-name">
@@ -55,7 +56,7 @@
 		</view>
 		<!-- 充电桩详情 -->
 		<view class="charge-pile">
-		<view class="box" @click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=3865b3a3-13fd-461a-8145-ee9711df35a2')">
+		<view class="box" @click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id='+chargingDevice.stationId)">
 		
 			<view class="name ellipsis">
 				{{chargingDevice.stationName}}/{{chargingDevice.name}}
@@ -98,6 +99,40 @@
 						{{price.servicePrice}}元/度
 					</view>
 				</view>
+				
+				<view class="item"  v-if="detail.status==3" >
+					<view class="item-name" >
+							
+						取消时间 
+					</view>
+					<view class="item-content">
+						{{detail.updateTime}}
+					</view>
+				</view>
+				
+				<template v-if="detail.status==5||detail.status==6" >
+					<view class="item"   >
+						<view class="item-name" >
+								
+							过期时间 
+						</view>
+						<view class="item-content">
+							{{detail.updateTime}}
+						</view>
+					</view>
+					<view class="item"   >
+						<view class="item-name" >
+								
+							过期原因 
+						</view>
+						<view class="item-content">
+							{{detail.remark}}
+						</view>
+					</view>
+				</template>
+				
+				
+				
 			</view>
 		</view>
 		<!-- 底部按钮 -->