小程序上下滑显示隐藏
上滑隐藏,下滑显示
lastPos:0,
onPageScroll(e) {
let currentPos = e.scrollTop;
if (currentPos - this.lastPos > 50) {
this.setData({
menuShow: false
})
} else if (this.lastPos - currentPos > 50) {
this.setData({
menuShow: true
})
}
this.lastPos = currentPos;
},
监听300次后不再增长
301VM2068 WAService.js:2 Invoke event onPageScroll in page: pages/post/index