var page = 0 var last = false var toloading = false function loading(id){ if(!last && !toloading){ page+=1 toloading = true $('#uploading').text('loading...') api.get('/content/page',{ "channelids":id, "tagids": "", "channelpaths": '', "siteids": "", "typeids": "", "title": "", "isnew": "", "istop": "", "timebegin": "", "timeend": "", "excludeid":'', "orderby": "", channeloption:0, "page": page, "size": 6, "releasetarget": "" },function(res){ if(res.code===200){ last=res.data.last var data = res.data.content for(var i=0;i') //div.children("img").attr('src', data[i].contentattrs[0].resurl); $('.loading').prev().append(div); } else{ var div= $('') //div.children("img").attr('src', data[i].contentattrs[0].resurl); $('.loading').prev().append(div); } } toloading = false if(last){ if(page==1){ $('#uploading').text(''); }else{ $('#uploading').text('没有更多内容了'); } $('#uploading').css('background-color','#fff'); $('#uploading').removeclass('loading').addclass('none-loading'); }else{ $('#uploading').html('点击加载更多 '); } }else{ mymessage.add(result.message, 'error'); } }) }else if(last){ mymessage.add('没有更多内容了', 'warning'); } } function getcontentpage(){ }