wy hai 1 ano
pai
achega
1008cb2f84

+ 21 - 15
pages/power-changer/index.vue

@@ -24,9 +24,9 @@
 							<view class="shinning"></view>
 						</view>
 					</view>
-					<PannelItem show="true" words="急停状态" :status="robotInfoVo.emergencyMode==1 ? '急停' : robotInfoVo.emergencyMode==0? '未急停':'—'"
+					<PannelItem show="true" words="急停状态" :status="robotInfoVo.emergencyMode == 1 ? '急停' : robotInfoVo.emergencyMode == 0 ?'未急停' :'—'"
 						:flag="robotInfoVo.emergencyMode == 0" />
-					<PannelItem show="true" words="暂停状态" :status="robotInfoVo.pause ==1 ? '暂停' : robotInfoVo.pause ==0?'未暂停':'—'" handle="true"
+					<PannelItem show="true" words="暂停状态" :status="robotInfoVo.pause == 1 ? '暂停' : robotInfoVo.pause == 0?'未暂停':'—' " handle="true"
 						@ExchangeMessage='ExchangeMessage' :flag="robotInfoVo.pause == 0" />
 				</view>
 			</view>
@@ -51,7 +51,7 @@
 						</view>
 						<view class="carRight">
 							<PannelTitle words="车牌识别" :value="vehicleInfo.plateState ? '成功' : '未识别'"
-								:flag="vehicleInfo.plateComState" />
+								:flag="vehicleInfo.plateComState == 1" />
 						</view>
 
 					</view>
@@ -61,8 +61,8 @@
 								:flag="vehicleInfo.sensorState" />
 						</view>
 						<view class="carRight">
-							<PannelTitle words="连接状态" :value="vehicleInfo.conState ? '已连接' : '未连接'"
-								:flag="vehicleInfo.conState" />
+							<PannelTitle words="连接状态" :value="vehicleInfo.conState == 1 ? '已连接' : vehicleInfo.conState == 0 ?'未连接':'—'"
+								:flag="vehicleInfo.conState == 1" />
 						</view>
 
 					</view>
@@ -74,7 +74,7 @@
 						<view class="carRight">
 							<PannelTitle circle="false" words="解锁状态"
 								:value="vehicleInfo.lockState==null ? '—': vehicleInfo.lockState?'已上锁' : '已解锁'"
-								@ExchangeMessage="ExchangeMessage" :flag="vehicleInfo.lockState == 1" />
+								@ExchangeMessage="ExchangeMessage" :flag="vehicleInfo.lockState == 0" />
 						</view>
 					</view>
 
@@ -322,14 +322,7 @@
 		},
 		mounted() {
 			this.InitWs()
-			//检查断开重连
-			this.timer = setInterval(() => {
-				if (this.ws.readyState != 1) {
-					this.ws.close()
-					console.log('检查断开重连')
-					this.InitWs()
-				}
-			}, 2000)
+			
 		},
 		onUnload() {
 			console.log('onUnload')
@@ -741,7 +734,7 @@
 					this.ws = null
 				}
 				if (this.timer != null) {
-					// clearInterval(this.timer)
+					clearInterval(this.timer)
 					this.timer = null
 				}
 				let token = this.$storage.getJson('token');
@@ -782,6 +775,7 @@
 				})
 				this.ws.onMessage((res) => {
 					let d = JSON.parse(res.data)
+					console.log(d)
 					// uni.hideLoading()
 					//电池仓位列表
 					if (d.storeInfoList) {
@@ -844,6 +838,18 @@
 				this.ws.onError(() => {
 					console.log("WebSocket连接错误")
 				})
+				if(this.timer == null){
+					//检查断开重连
+					this.timer = setInterval(() => {
+						if (this.ws.readyState != 1) {
+							clearInterval(this.timer)
+							this.timer = null
+							this.ws.close()
+							console.log('检查断开重连')
+							this.InitWs()
+						}
+					}, 2000)
+				}
 			},
 		},
 	}

+ 6 - 6
pages/service-recode/components/change.vue

@@ -5,8 +5,8 @@
 				<uni-forms-item label="车牌号码:" label-width="85px" label-align="right" name="vehiclePlate">
 					<uni-easyinput type="text" v-model="changeData.vehiclePlate" placeholder="请输入" />
 				</uni-forms-item>
-				<uni-forms-item label="换电结果:" name="state" label-width="85px" label-align="right" >
-					<uni-data-select v-model="changeData.state" :localdata="range" @change="changeId"></uni-data-select>
+				<uni-forms-item label="换电结果:" name="swapState" label-width="85px" label-align="right" >
+					<uni-data-select v-model="changeData.swapState" :localdata="range" @change="changeId"></uni-data-select>
 				</uni-forms-item>
 				<uni-forms-item label="换电日期:" name="time" label-width="85px" label-align="right" class="last_box">
 					<uni-datetime-picker v-model="time" type="daterange" rangeSeparator="至"/>
@@ -66,7 +66,7 @@
 			return {
 				changeData: {
 					 vehiclePlate: undefined, // 车牌号
-					state: undefined, //换电结果
+					swapState: undefined, //换电结果
 					// 每页数据量
 					pageSize: 10,
 					// 当前页
@@ -183,7 +183,7 @@
 				if(e == 4){
 					e = ''
 				}
-				this.changeData.state = e
+				this.changeData.swapState = e
 				console.log(e, 'e')
 			},
 			//请求数据列表
@@ -213,7 +213,7 @@
 			//重置
 			reset(){
 				this.changeData.page = 1;
-				this.changeData.state = undefined;
+				this.changeData.swapState = undefined;
 				this.changeData.swapBeginTime = undefined;
 				this.changeData.swapEndTime = undefined;
 				this.changeData.vehiclePlate = undefined;
@@ -223,7 +223,7 @@
 			},
 			//查询
 			search(){
-				if(this.time){
+				if(this.time.length>0){
 					this.changeData.swapBeginTime = this.time[0] +' ' +'00:00:00';
 					this.changeData.swapEndTime = this.time[1]+' ' +"23:59:59";
 				}

+ 1 - 1
pages/service-recode/components/recharge.vue

@@ -172,7 +172,7 @@
 			},
 			//查询
 			search() {
-				if (this.time) {
+				if (this.time.length>0) {
 					this.rechargeData.chgBeginTime = this.time[0]+' ' +'00:00:00';
 					this.rechargeData.chgEndTime = this.time[1]+' ' +'23:59:59';
 					// this.rechargeData.time = undefined;