dedsudiyu 2 anos atrás
pai
commit
f7c704cf66

+ 13 - 0
pages/emergencyEvacuationBig.vue

@@ -1364,10 +1364,23 @@ export default {
         if (data) {
           if (topic == (this.evacuationTopic + this.floorId)) {
             console.log('疏散通知', data)
+			let pages = getCurrentPages();
+			let currPage = pages[pages.length - 1]
+			
+			console.log('pages',pages)
+			// let currPage = pages[pages.length - 1] //当前页面
+			// let prePage = pages[pages.length - 2] //上一个页面
+			// prePage.$vm.aaa()
             //疏散消息
             if (data.data == 'FLOOR_EXITLINE') {
               this.getRedisEvacuation();
+			  if(currPage.route == 'pages/emergencyEvacuationBigFullScreen'){
+			  	currPage.$vm.mqttPageFunction('FLOOR_EXITLINE')
+			  }
             } else if (data.data == 'FLOOR_OVER_EXITLINE') {
+			  if(currPage.route == 'pages/emergencyEvacuationBigFullScreen'){
+			  	currPage.$vm.mqttPageFunction('FLOOR_OVER_EXITLINE')
+			  }
               uni.showToast({
                 title: '疏散已结束',
                 icon: "none",

+ 18 - 1
pages/emergencyEvacuationBigFullScreen.vue

@@ -97,10 +97,27 @@
 			}
 		},
 		onShow() {
-			this.offMQTT('on');
+			// this.offMQTT('on');
 			this.getBuildingData();
 		},
 		methods: {
+			mqttPageFunction(type){
+				// console.log('页面方法被上级路由页面调用-type=',type);
+				let self = this;
+				if (type == 'FLOOR_EXITLINE') {
+					this.getRedisEvacuation();
+				} else if (type == 'FLOOR_OVER_EXITLINE') {
+					uni.showToast({
+						title: '疏散已结束',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					setTimeout(function() {
+						self.getBuildingData();
+					}, 2000);
+				}
+			},
 			checkRoom(item){
 				console.log('item',item)
 				if(this.buttonType){