diff --git a/app.js b/app.js index f602501..6ce2201 100644 --- a/app.js +++ b/app.js @@ -67,6 +67,7 @@ App({ this.globalData.fragmentHeight = windowHeight - statusBarHeight this.globalData.safeFragmentHeight = windowHeight - statusBarHeight - this.globalData.safeBottom this.globalData.windowWidth = e.windowWidth + this.resumeIndex() } }) }, @@ -78,5 +79,15 @@ App({ return true } return false + }, + resumeIndex: function(){ + wx.onAppRoute(function (res) { + let pages = getCurrentPages() + let page = pages[pages.length - 1] + if(page && page.onResume && !page.data.inited ){ + page.onResume() + } + }) + } }) \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 45caf00..753e99d 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -220,9 +220,9 @@ Page({ } }, onEvent: function (message) { - if(message.what == 250){ - this.setData({ pageIndex: 0 }) - } + // if(message.what == 250){ + // this.setData({ pageIndex: 0 }) + // } }, stopTouchMove: function (e) { return false