1.转动加载
function onScroll() {
if (this.curPage > this.totalPage) return;
var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
if (scrollTop + windowHeight > scrollHeight - 100) {
// flagData避免触发屡次
if (!this.flagData) return;
this.flagData = false;
this.getSingerList();//要求数据胜利后 page+1, this.flagData = true;
}
} function onScroll