| | |
| | | @touchstart="evt=>onTouch(evt)" |
| | | @touchmove="evt=>onTouch(evt)" |
| | | @touchend="evt=>onTouch(evt)" |
| | | @scrollToLower="evt=>onScrollToLower(evt)" |
| | | lowerThreshold="100" |
| | | > |
| | | <view |
| | | class="c-infinite-top" |
| | |
| | | } |
| | | // 往下 |
| | | else { |
| | | if (process.env.TARO_ENV !== 'h5') { |
| | | return; |
| | | } |
| | | const viewHeight = evt.target.offsetHeight; |
| | | const { scrollTop, scrollHeight } = evt.detail; |
| | | // 阀值 100 像素,向下滚动到最后 100 像素,识别为启动加载 |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 小程序中滚动到底部 |
| | | onScrollToLower() { |
| | | if (process.env.TARO_ENV !== 'weapp') { |
| | | return; |
| | | } |
| | | this.hanldeLoadMore(); |
| | | }, |
| | | // 初始加载 |
| | | initScroll() { |
| | | // 已初始化,跳过 |