|
|
@ -29,7 +29,7 @@ Scene({ |
|
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
updateManager.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.setData({fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight), safeBottom: app.globalData.safeBottom }) |
|
|
this.data.setInter = setInterval(this.fetchMessage, 10000) |
|
|
this.data.setInter = setInterval(this.fetchMessage, 10000) |
|
|
}, |
|
|
}, |
|
|
@ -48,7 +48,8 @@ Scene({ |
|
|
return false |
|
|
return false |
|
|
}, |
|
|
}, |
|
|
onEvent: function (message) { |
|
|
onEvent: function (message) { |
|
|
if (message.what == 99) { |
|
|
|
|
|
|
|
|
if (message.what == 888) { |
|
|
|
|
|
this.onUnload() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
fetchMessage: function(){ |
|
|
fetchMessage: function(){ |
|
|
@ -67,6 +68,7 @@ Scene({ |
|
|
this.setData({zIndex: detail}) |
|
|
this.setData({zIndex: detail}) |
|
|
}, |
|
|
}, |
|
|
onUnload: function(){ |
|
|
onUnload: function(){ |
|
|
|
|
|
event.remove('EventMessage', this) |
|
|
if(this.data.setInter) { |
|
|
if(this.data.setInter) { |
|
|
clearInterval(this.data.setInter) |
|
|
clearInterval(this.data.setInter) |
|
|
this.data.setInter = null |
|
|
this.data.setInter = null |
|
|
|