From ff387b16690bdb08a0d4a8a000b8310ce7afaa34 Mon Sep 17 00:00:00 2001 From: whychdw <49690745@qq.com> Date: 星期二, 03 十二月 2019 16:09:24 +0800 Subject: [PATCH] 内容修改 --- platforms/android/app/src/main/assets/www/pages/main/main.js | 63 +++++++++++++++++-------------- 1 files changed, 35 insertions(+), 28 deletions(-) diff --git a/platforms/android/app/src/main/assets/www/pages/main/main.js b/platforms/android/app/src/main/assets/www/pages/main/main.js index 13316da..425587e 100644 --- a/platforms/android/app/src/main/assets/www/pages/main/main.js +++ b/platforms/android/app/src/main/assets/www/pages/main/main.js @@ -58,6 +58,9 @@ }, { path: '/history-data', url: '../history-data/history-data.html' + }, { + path: '/warning', + url: '../warning/warning.html' }] }, methods: { @@ -96,7 +99,7 @@ } }, setBattDiscInfo: function setBattDiscInfo(res) { - console.log(res); + //console.log(res); // 瀵规暟鎹繘琛屽鐞� this.tbls.discharge.data = this.formaterTestData(res); // 缁熻涓暟 @@ -147,7 +150,7 @@ } }, setBattCharInfo: function setBattCharInfo(res) { - console.log(res); + //console.log(res); // 瀵规暟鎹繘琛屽鐞� this.tbls.charge.data = this.formaterTestData(res); // 缁熻涓暟 @@ -188,7 +191,7 @@ alm_cleared_type: 0, page: page }; - console.log(searchParams); + //console.log(searchParams); // 鍒ゆ柇鏄惁涓烘墜鏈虹 if (typeof Battalram_dataService != "undefined") { Battalram_dataService.serchByCondition(JSON.stringify(searchParams)); @@ -215,7 +218,7 @@ }, setAlarmInfo: function setAlarmInfo(res) { // 璁剧疆瀹炴椂鍛婅淇℃伅 - console.info(res); + // console.info(res); if (res.code == 1) { var page = this.tbls.warning.page; // 璁剧疆鏁版嵁 @@ -299,41 +302,45 @@ mounted: function mounted() { var self = this; this.setTblsHt(); - - // 鍚庡彴瑙﹀彂浜嬩欢鏌ヨ鎵�鏈夌殑鐢垫睜缁勬斁鐢典俊鎭� - window['DeviceServicereadBattDiscInfocalljs'] = function (res) { - // 璁剧疆鐢垫睜淇℃伅 - self.setBattDiscInfo(res); - // 寮�鍚鏃跺櫒 - self.tbls.discharge.timer.open(); - }; - - // 鍚庡彴瑙﹀彂浜嬩欢鏌ヨ鎵�鏈夌殑鐢垫睜缁勫厖鐢典俊鎭� - window['DeviceServicereadBattCharInfocalljs'] = function (res) { - // 璁剧疆鐢垫睜淇℃伅 - self.setBattCharInfo(res); - // 寮�鍚鏃跺櫒 - self.tbls.charge.timer.open(); - }; - - // 鏌ヨ鍛婅淇℃伅 - window['Battalram_dataServiceserchByConditioncalljs'] = function (res) { - self.setAlarmInfo(res); - // 寮�鍚鏃跺櫒 - self.tbls.warning.timer.open(); - }; }, destroyed: function destroyed() {} }); }, show: function show() { + var self = this.vm; // 寮�鍚鏃跺櫒 this.vm.startTimers(); - //bui.alert('show'); + // 鍚庡彴瑙﹀彂浜嬩欢鏌ヨ鎵�鏈夌殑鐢垫睜缁勬斁鐢典俊鎭� + window['DeviceServicereadBattDiscInfocalljs'] = function (res) { + // 璁剧疆鐢垫睜淇℃伅 + self.setBattDiscInfo(res); + // 寮�鍚鏃跺櫒 + self.tbls.discharge.timer.open(); + }; + + // 鍚庡彴瑙﹀彂浜嬩欢鏌ヨ鎵�鏈夌殑鐢垫睜缁勫厖鐢典俊鎭� + window['DeviceServicereadBattCharInfocalljs'] = function (res) { + // 璁剧疆鐢垫睜淇℃伅 + self.setBattCharInfo(res); + // 寮�鍚鏃跺櫒 + self.tbls.charge.timer.open(); + }; + + // 鏌ヨ鍛婅淇℃伅 + window['Battalram_dataServiceserchByConditioncalljs'] = function (res) { + self.setAlarmInfo(res); + // 寮�鍚鏃跺櫒 + self.tbls.warning.timer.open(); + }; }, hide: function hide() { + var self = this.vm; // 鍏抽棴璁℃椂鍣� this.vm.stopTimers(); + // 娓呴櫎鍏ㄥ眬鏂规硶 + window.DeviceServicereadBattDiscInfocalljs = null; + window.DeviceServicereadBattCharInfocalljs = null; + window.Battalram_dataServiceserchByConditioncalljs = null; }, destroyed: function destroyed() { this.vm.$destroy(); -- Gitblit v1.9.1