zhengkaixin il y a 3 ans
Parent
commit
07bfd83617

+ 9 - 6
pages/searchPile/apointment/apointmentRecharge.vue

@@ -38,7 +38,7 @@
 		</view>
 		<!-- 预计充电时长 -->
 		<view class="reserved-time box">
-			<p>充电桩预留时长</p>
+			<p>预计充电时长</p>
 			<template v-for="(item,i) in  numList">
 				<view :key="i" @click="selectNum=item" :class="{
 					time1:selectNum==item,
@@ -49,7 +49,7 @@
 			</template>
 		
 			<view class="end-time">
-				预留截止时间:{{endtime2}}
+				预留充满时间:{{endtime2}}
 			</view>
 		</view>
 		<!-- 预约需知 -->
@@ -194,9 +194,12 @@
 					var Hour = parseInt(Math.floor(ms / 60 ));
 					var Fen = parseInt(Math.floor(ms % 60 ));
 					if(Hour>0){
-						value=Hour + "小时" 
+						value+=Hour + "小时" 
+					}
+					if(Fen>0){
+						value+=Fen + "分钟" 
 					}
-					value +=   Fen+"分钟"
+					
 				}
 			
 				return value;
@@ -209,8 +212,8 @@
 					return 	parseUnixTime(new Date(date))
 			},
 			endtime2(){
-					var date=new Date().getTime()+this.selectNum*60*1000
-						return 	parseUnixTime(new Date(date))
+					var date=new Date().getTime()+this.selectNum*60*1000+this.selectTime*60*1000
+					return 	parseUnixTime(new Date(date))
 			},
 		}
 		

+ 27 - 6
pages/user/myReservation/reservationListDetails.vue

@@ -48,7 +48,7 @@
 						预计充电时长
 					</view>
 					<view class="item-content">
-						{{detail.estimateMinutes}}分钟
+						{{getPercent(detail.estimateMinutes)}}
 					</view>
 				</view>
 			</view>
@@ -185,16 +185,30 @@
 				//扫码进入的
 			}
 			if (op.deviceNo) {
-				this.stationId= op.stationId;
-				this.deviceNo = op.deviceNo;
-				this.channelNo = op.gun;
-				this.carNumber = op.carNumber;
-			
+				
 			}
 			this.id= op.id;
 			this.getInfo()
 		},
 		methods:{
+			getPercent(estimateMinute) {
+				var value="";
+				 
+				var ms =estimateMinute
+				if (ms > 0) {
+					var Hour = parseInt(Math.floor(ms / 60 ));
+					var Fen = parseInt(Math.floor(ms % 60 ));
+					if(Hour>0){
+						value+=Hour + "小时" 
+					}
+					if(Fen>0){
+						value+=Fen + "分钟" 
+					}
+					
+				}
+			
+				return value;
+			},
 			charge(){
 				uni.navigateTo({
 					url:'/pages/searchPile/chargeProcess/charge?stationId='+this.stationId+'&deviceNo='+this.deviceNo+"&gun="+this.channelNo+"&carNumber="+(this.carNumber?this.carNumber:'')
@@ -256,6 +270,13 @@
 					this.chargingDevice=res.data.chargingDevice;
 					this.price=res.data.price;
 					
+					
+					this.stationId= this.chargingDevice.stationId;
+					this.deviceNo = this.chargingDevice.deviceNo;
+					this.channelNo = res.data.channelNo;
+					this.carNumber = res.data.carNumber;
+								
+								
 					if(this.detail.status=="0"){
 						//this.description= '等待桩主确认预约单,剩余时间'
 						var data=new Date(this.detail.createTime).getTime()