diff --git a/pages/home/employee/index.js b/pages/home/employee/index.js index 05e3c48..ccf3901 100644 --- a/pages/home/employee/index.js +++ b/pages/home/employee/index.js @@ -41,7 +41,10 @@ Scene({ }, onEvent: function(message){ if (message.what == 120) { - this.fetchMemberList() + var that = this + this.timeout = setTimeout(() => { + that.fetchMemberList() + }, 1000) } }, fetchMemberList: function(){ @@ -106,6 +109,10 @@ Scene({ } }, onUnload: function(){ + if(this.timeout){ + clearTimeout(this.timeout) + this.timeout = null + } event.remove('EventMessage', this) } }) \ No newline at end of file