Browse Source

已确认效果

zhengkaixin 3 years ago
parent
commit
22fcc4eb91
1 changed files with 30 additions and 2 deletions
  1. 30 2
      pages/user/myReservation/reservationListDetails.vue

+ 30 - 2
pages/user/myReservation/reservationListDetails.vue

@@ -54,6 +54,8 @@
 			</view>
 			
 		</view>
+		<u-alert-tips type="warning" v-if="detail.status==1"  :description="description"></u-alert-tips>
+		
 		<!-- 充电桩详情 -->
 		<view class="charge-pile">
 		<view class="box" @click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id='+chargingDevice.stationId)">
@@ -253,7 +255,7 @@
 				
 				
 			},
-			getInfo(bl){
+			getInfo(bl,bl2){
 				console.log(bl)
 				if(!bl){
 					uni.showLoading({
@@ -287,11 +289,17 @@
 					
 						this.description= '等待桩主确认预约单,剩余时间'+c[1]+'分'+c[2]+"秒";		
 						
-						
 						setTimeout(()=>{
 							this.getInfo(true);
 						},2000)
 					}
+					if(this.detail.status=="1"){
+						if(!bl2){
+							this.indexstep()
+						}
+						
+					}
+					
 					
 				}).catch(error => {
 					uni.showToast({
@@ -299,6 +307,26 @@
 					})
 				})
 				
+			},
+			indexstep(){
+				//this.description= '等待桩主确认预约单,剩余时间'
+				var data=new Date(this.detail.createTime).getTime()
+				var c=hourDistanceArr(new Date(),new Date(data+this.detail.reserveMinutes*60*1000))
+									
+				this.description= c[1]+'分'+c[2]+"秒后预约授权将超时,如超时授权自动取消。";		
+				if( c[1]!=0||c[2]!=0){
+					setTimeout(()=>{
+						this.indexstep()
+					},1000)
+				
+				}else{
+					 
+					setTimeout(()=>{
+						this.getInfo(true,true)
+					},5000)
+				
+				}
+				
 			},
 			customback(){
 				if(this.isback){