diff --git a/src/core/view/bridge/subscribe/scroll.js b/src/core/view/bridge/subscribe/scroll.js index e28aacf1cf1840730f275253779d3a5d2c75998e..2250965d5f2c8d58b55b6729e3e4c5819f32f3e7 100644 --- a/src/core/view/bridge/subscribe/scroll.js +++ b/src/core/view/bridge/subscribe/scroll.js @@ -59,6 +59,8 @@ export function pageScrollTo ({ } let testReachBottomTimer +let lastScrollHeight = 0 + export function createScrollListener (pageId, { enablePageScroll, enablePageReachBottom, @@ -79,7 +81,10 @@ export function createScrollListener (pageId, { const windowHeight = window.innerHeight const scrollY = window.scrollY let isBottom = scrollY > 0 && scrollHeight > windowHeight && (scrollY + windowHeight + onReachBottomDistance) >= scrollHeight - if (isBottom && !hasReachBottom) { + // 兼容部分浏览器滚动时scroll事件不触发 + const heightChanged = Math.abs(scrollHeight - lastScrollHeight) > onReachBottomDistance + if (isBottom && (!hasReachBottom || heightChanged)) { + lastScrollHeight = scrollHeight hasReachBottom = true return true }