uni-app判断是否到底部

//获取某DIV高度
uni.createSelectorQuery().select('.lists').boundingClientRect((res) => {
	uni.pageScrollTo({
		scrollTop: res.height,
		duration: 200
	})
}).exec()
//在onPageScroll函数中判断 is_scroll_view 为true就是到底部
let to_scroll_top = e.scrollTop+20

uni.createSelectorQuery().select('.lists').boundingClientRect((res) => {
	let a = uni.getSystemInfoSync()
	let t_height = res.height-a.screenHeight
	
	if(t_height<=to_scroll_top){
		this.is_scroll_view = true
	}else{
		this.is_scroll_view = false
	}
}).exec()

你可能感兴趣的:(uni-app)