heyang 2 年之前
父节点
当前提交
47cd3e5fb0
共有 2 个文件被更改,包括 40 次插入18 次删除
  1. 32 14
      pages/emergencyEvacuationBig.vue
  2. 8 4
      pages_manage/workbench/laboratory/laboratoryInfo.vue

+ 32 - 14
pages/emergencyEvacuationBig.vue

@@ -396,14 +396,14 @@ export default {
 		 //  query.select('#440102004920000000010014')
 		 //  let a = query.select('#440102004920000000010014');
 		 //  console.log('query',query.select('#440102004920000000010014'));
-		  
-		  
+
+
 		 //  console.log('wx.createSelectorQuery',wx.createSelectorQuery('440102004920000000010014'));
-		  
+
 		 //  let videoElement1 = document.getElementById('440102004920000000010014');
 		 //  console.log('videoElement1',videoElement1);
-		  
-		  
+
+
 		 //  let videoElement = document.getElementById(self.urlList[i].id);
 		 //  console.log('videoElement',videoElement);
 		 //  videoElement.pause();
@@ -429,7 +429,7 @@ export default {
       });
     },
     //一键灭火-查询设备状态
-    async firedeviceStatus() {
+    async firedeviceStatus(type) {
       let _this = this;
 
       const {data} = await firedeviceStatus(_this.subId)
@@ -440,21 +440,34 @@ export default {
             _this.outfireData = data.data
             _this.$set(this,'fireListType',data.data.online);
             _this.$set(this,'fireCode',data.data.fireDevice.deviceCode);
-            _this.offMQTT('on');
+
+			 if(type != 'mqtt'){
+				  _this.offMQTT('on');
+			 }
             if(data.data.temperature && data.data.smoke){
               if(!this.fireStartType){
                 this.$set(this,'fireStartType',true);
                 this.sendCode2(data.data.timeDifference);
               }
             }
+			if(data.data.timeDifference != -1){
+			  if(!this.fireStartType){
+			    this.$set(this,'fireStartType',true);
+			    this.sendCode2(data.data.timeDifference);
+			  }
+			}
           }else{
             this.$set(this,'fireListType',false);
             this.$set(this,'fireCode',null);
-            this.offMQTT('on');
+            if(type != 'mqtt'){
+            	_this.offMQTT('on');
+            }
           }
         }else{
           this.$set(this,'fireType',false);
-          this.offMQTT('on');
+		  if(type != 'mqtt'){
+		  	_this.offMQTT('on');
+		  }
         }
       }
     },
@@ -1002,6 +1015,11 @@ export default {
       this.$set(this,'pageType',2);
       this.getDeviceList();
       this.laboratoryInfo();
+	  this.$set(this,'fireStartType',false);
+	  if(this.conductCountdown){
+	   this.clearTimer2()
+	    this.$set(this,'conductCountdown',null);
+	  }
       this.firedeviceStatus();
 
     },
@@ -1363,17 +1381,17 @@ export default {
           }else if(topic == (self.fireTopic + self.fireCode)){
             //传感器状态
             console.log('传感器状态');
-            self.firedeviceStatus();
+            self.firedeviceStatus('mqtt');
           }else if(topic == (self.fireOnlineTopic + self.fireCode)){
             //设备在线状态
             console.log('设备在线状态');
+			self.firedeviceStatus('mqtt');
           }else if(topic == (self.firePerformTopic + self.fireCode)){
             console.log('灭火中'+data.fireStatus)
             //灭火执行操作
             if(data.fireStatus == 1){
               if(!self.fireStartType){
-                self.$set(self,'fireStartType',true);
-                self.sendCode2(data.direTime);
+				self.firedeviceStatus('mqtt');
               }
             }else if(data.fireStatus == 0){
 				uni.showToast({
@@ -1572,11 +1590,11 @@ export default {
       /* 一键灭火 */
       .outfire {
         width: 710rpx;
-        height: 80rpx;
+        height: auto;
         background: #FFFFFF;
         border-radius: 20rpx;
         margin: 20rpx 0;
-        padding: 0 10rpx;
+        padding: 26 10rpx;
         box-sizing: border-box;
         display: flex;
         justify-content: space-between;

+ 8 - 4
pages_manage/workbench/laboratory/laboratoryInfo.vue

@@ -324,6 +324,12 @@ export default {
 	              this.sendCode2(data.data.timeDifference);
 	            }
 	          }
+			  if(data.data.timeDifference != -1){
+			    if(!this.fireStartType){
+			      this.$set(this,'fireStartType',true);
+			      this.sendCode2(data.data.timeDifference);
+			    }
+			  }
 	        }else{
 	          this.$set(this,'fireListType',false);
 	          this.$set(this,'fireCode',null);
@@ -348,7 +354,7 @@ export default {
 	        _this.$set(this,'fireListType',data.data.online);
 	        _this.countdown = data.data.waitTime;//灭火倒计时
 	        _this.sendCode() //倒计时
-	  
+	    
 	      } else {
 	        wx.showToast({
 	          title: '一键灭火启动失败!',
@@ -549,13 +555,11 @@ export default {
 	//一键灭火-是否正在执行灭火操作
 	getMqttPerformData(val){
 		let self = this;
-		debugger
 		if(val){
 			//灭火执行操作
 			if(val.fireStatus == 1){
 			  if(!self.fireStartType){
-			    self.$set(self,'fireStartType',true);
-			    self.sendCode2(val.direTime);
+				self.firedeviceStatus();
 			  }else if(val.fireStatus == 0){
 				uni.showToast({
 				  title: '一键灭火启动失败',