var page = 1 var last = false var toloading = false function loading(id){ if(!last && !toloading){ page+=1 toloading = true $('#uploading').text('加载中...') api.get('/content/page',{ "contentid": "", "channelids": id, "tagids": "", "channelpaths": "", "siteids": "", "typeids": "", "title": "", "isnew": "", "istop": "", "timebegin": "", "timeend": "", "excludeid": "", "orderby": "", channeloption:1, "page": page, "size": 2, "releasetarget": "" },function(res){ if(res.code===200){ last=res.data.last var data = res.data.content for(var i=0;i') div.html($('.video-item').html()) div.children("a").attr('href',data[i].url) div.children("a").children("img").attr('src', data[i].iconurl) div.children('.video-title').children('a').attr('href',data[i].url) div.children('.video-title').children('a').text(data[i].title) div.children('.small').children('.small-left').text(data[i].releasetime) div.children('.small').children('.small-right').children('.icon-item').eq(1).children('span').text(data[i].views) div.children('.small').children('.small-right').children('.icon-item').eq(1).children('span').text(data[i].ups) div.children('.small').children('.small-right').children('.icon-item').eq(1).children('span').text(data[i].comments) div.children('.player-time').children('span').text(data[i].resduration) $('.loading').before(div) } toloading = false if(last){ $('#uploading').text('没有更多内容了'); $('#uploading').css('background-color','#fff'); $('#uploading').removeclass('loading').addclass('none-loading'); }else{ $('#uploading').text('加载更多'); } }else{ mymessage.add(result.message, 'error'); } }) }else if(last){ mymessage.add('没有更多内容了', 'warning'); } } function getcontentpage(){ }