From 68a65e423b3729475482612db436bed1952269d9 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 7 May 2021 10:45:32 +0800 Subject: [PATCH] no message --- pages/index/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index 633cebd..22e30f5 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -29,7 +29,7 @@ Scene({ // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 updateManager.applyUpdate() }) - // event.on('TabMessage', this, this.onEvent) + event.on('EventMessage', this, this.onEvent) this.setData({fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight), safeBottom: app.globalData.safeBottom }) this.data.setInter = setInterval(this.fetchMessage, 10000) }, @@ -48,7 +48,8 @@ Scene({ return false }, onEvent: function (message) { - if (message.what == 99) { + if (message.what == 888) { + this.onUnload() } }, fetchMessage: function(){ @@ -67,6 +68,7 @@ Scene({ this.setData({zIndex: detail}) }, onUnload: function(){ + event.remove('EventMessage', this) if(this.data.setInter) { clearInterval(this.data.setInter) this.data.setInter = null