瀏覽代碼

增加状态判断,细节调整

zhengkaixin 1 月之前
父節點
當前提交
0455aea9dc
共有 4 個文件被更改,包括 73 次插入15 次删除
  1. 48 12
      pages/business/as-components/componentLockInfo.vue
  2. 3 0
      pages/business/index.vue
  3. 20 2
      pages/business/main.vue
  4. 2 1
      pages/mylock/myLock.vue

+ 48 - 12
pages/business/as-components/componentLockInfo.vue

@@ -82,9 +82,9 @@
 								<view class="name">
 									{{floorlockInfo.parkingName}}
 								</view>
-								<view class="text">
+								<view class="text" v-if="floorlockInfo.locationAddress">
 									<u-icon name="map-fill" size="24" color="#999999" ></u-icon>
-									{{floorlockInfo.locationAddress}}
+									{{floorlockInfo.locationAddress?floorlockInfo.locationAddress:''}}
 								</view>
 							</view>
 							
@@ -137,13 +137,20 @@
 						</view>
 
 					</template>
-					<view class=" value" style="color:red;text-align: center;font-size: 28rpx;"
+					<view class=" value" style="text-align: center;font-size: 40rpx;color: rgba(51,51,51,1);font-weight: bold;">
+						{{floorlockInfo.lockStatusN}}
+					
+					</view>
+					<view class=" value" style="color: rgba(255,61,0,1);;text-align: center;font-size: 24rpx;margin:10rpx"
 						v-if="floorlockInfo.lockStatus==2&&floorlockInfo.parkingStatus==0">
-						3分钟后自动抬锁,请尽快驶入车位
+						{{showsecondsDistance()}}后自动抬锁<br>
+						
+						请尽快驶入地锁
+
 
 					</view>
 					
-					<view class="valuebutton" @click="operateBtn">
+					<view class="valuebutton" @click="operateBtn"  >
 
 						<template v-if="floorlockInfo.status==0">
 							<view class="jpbutton jpbutton5">
@@ -199,9 +206,7 @@
 						</view>
 					</view>
 					<view class="page  "  >
-					<u-collapse   :itemStyle="{
-								'border':'1px solid rgba(187, 187, 187, 0.43);'
-							}">
+					<u-collapse  >
 							<u-collapse-item :title="item.head" v-for="(item, index) in itemList" :open="item.open" :key="index">
 								{{item.body}}
 							</u-collapse-item>
@@ -228,7 +233,10 @@
 	import componentLogin from '@/components/componentLogin.vue';
 	 
 	import * as API from '@/apis/pagejs/pagesIndex.js'
-
+	import {
+		secondsDistance,newDate,
+	
+	} from '@/apis/utils'
 	export default {
 		components: {
 			componentLogin,
@@ -261,7 +269,7 @@
 									disabled: true
 								},{
 									head: "温馨提示",
-									body: "1、成功降锁后请于三分钟内将车辆驶入指定车位;超时地锁会自动升起,需重新扫码降锁;2、请按降锁流程说明停车,严禁使用外力降锁;3、地锁服务热线 400-8899-619。",
+									body: "1、成功降锁后请于三分钟内将车辆驶入指定车位;超时地锁会自动升起,需重新扫码降锁;\n\t2、请按降锁流程说明停车,严禁使用外力降锁;\n\t3、地锁服务热线 400-8899-619。",
 									open: false,
 								}],
 				content: "400-8899-619",
@@ -332,6 +340,32 @@
 			}
 		},
 		methods: {
+			showsecondsDistance(){
+				if((this.floorlockInfo.id&&this.floorlockInfo.lastOperationTime)){
+					var time1=new Date()
+					
+					var time2=newDate(this.floorlockInfo.lastOperationTime)
+					var time3=secondsDistance(time2,time1)
+					var k=3*60-time3
+					
+					var fen=parseInt(k/60)
+					var miao=parseInt(k%60)
+					if(k>0){
+						if(fen>0){
+							return `${fen}分${miao}秒`
+						}else{
+							return `${miao}秒`
+						}
+					}else{
+						return "3分钟"
+					}
+					
+					
+				}else{
+					return "3分钟"
+				}
+				
+			},
 			initRef(id,ref){
 				if(ref==1){
 					this.isOnLoad=1
@@ -760,10 +794,12 @@
 	
 	}
 	
-	
+	.valuebutton{
+		  margin-bottom: 30rpx;
+	}
 	.jpbutton {
 		   margin-top: 30rpx;
-		   margin-bottom: 30rpx;
+		 
 		border-radius: 100rpx;
 		width: 400rpx;
 		height: 84rpx;

+ 3 - 0
pages/business/index.vue

@@ -355,6 +355,9 @@
 						.lockStatus2{
 							color: #ff9800;
 						}
+						.lockStatus0{
+							color: red;
+						}
 						.lockStatus4{
 							color: red;
 						}

+ 20 - 2
pages/business/main.vue

@@ -26,7 +26,7 @@
 
 					</view>
 					<view class="valuebutton" >
-						<view class="jpbutton jpbutton1" @click="gotoUrl('pages/mylock/bindLock')">
+						<view class="jpbutton jpbutton1" @click="gotobindLock()">
 							<u-icon name="scan" label="绑定新地锁" color="#fff" label-color="#fff"
 								label-size="36"></u-icon>
 						</view>
@@ -36,7 +36,9 @@
 
 
 		</view>
-	
+		<u-modal v-model="loginBl" @confirm="loginconfirm"  :show-cancel-button="true"
+			ref="uModal" title="提示" content="当前用户未登录,是否前往登录" confirm-text="登录"></u-modal>
+		
 		<tabbar   ></tabbar>
 	</view>
 </template>
@@ -101,6 +103,7 @@
 				closeLockBl:false,
 				openModalBl: false,
 				formX:0,
+				loginBl: false,
 				
 			}
 		},
@@ -139,6 +142,21 @@
 			}
 		},
 		methods: {
+			loginconfirm(){
+				this.$refs.refLogin.ashow()
+			},
+			gotobindLock(){
+				if(!this.jphelp.getPersonInfo().id){
+					this.loginBl=true;
+					return
+					
+				}
+				uni.navigateTo({
+					url:'/pages/mylock/bindLock'
+				})
+				
+			},
+			
 			findByOpenIdErr(){
 				
 				this.isReady=1

+ 2 - 1
pages/mylock/myLock.vue

@@ -26,7 +26,7 @@
 								<span v-if="item.parkingName">{{item.parkingName}}</span>
 
 								<span v-if="item.typeN">{{item.typeN}}</span>
-								<span v-if="item.addWhiteUserName">来自 <span style="color:#00b962 ;">{{item.addWhiteUserName}}</span>的授权</span>
+								<span v-if="item.addWhiteUserName">授权人:<span class="aspan" style="color:#00b962 ;">{{item.addWhiteUserName}}</span></span>
 								
 
 								<span v-if="item.whitePhoneNum">授权名单:{{item.whitePhoneNum}}</span>
@@ -362,6 +362,7 @@
 						span {
 							margin-right: 16rpx;
 						}
+						
 					}
 
 				}