uniapp上拉加载数据思路


onReachBottom()
{
	let timer=null//加载更多
	if (this.jiazai){
		uni.hideLoading();
		return;
	}
	//阻止重复加载
	if(timer !== null){
		clearTimeout(timer)
	}
	timer=setTimeout(()=>this.get_ajax(),500)
	uni.showLoading({
		title: '加载中...',
	});
},
// 加载数据
get_ajax() {
	uni.request({
		url:'www.mixinnet.cn',
		data: {
			code: 'code',
		},
		method: 'POST',
		success: (res) => {
			uni.hideLoading();//关闭提示
			
		}
	});
}


评论