'use strict' var limit = 20; var typenid = $("#typenid").val(); var newstypeid = $("#newstypeid").val(); var parentnewstypeid = $("#parentnewstypeid").val(); var newstypeids = "6,7,8,9,22,23,24,25,26,"; var parentnewstypeids = "00f22d4c-7558-463d-9d88-86a81fbe0300"; var content = $("#btnsearch").val(); var flagnewstypeid = false; if(parentnewstypeid == parentnewstypeids ){ flagnewstypeid = true; } if(newstypeid != "" && newstypeids.indexof(newstypeid+",") >-1){ flagnewstypeid = true; } pagenewslist(1); function pagenewslist(currentpage){ var offset = (currentpage-1)*limit; $.ajax({ url:'/webfrontnews/pagelist', data:{parentnewstypeid:parentnewstypeid,newstypeid:newstypeid,offset:offset,limit:limit,typenid:typenid, content: content}, type:"post", datatype:"json", success:function(data){ var newslist = data.data; var length = newslist.length; var total = data.total; var nowdate = data.nowdate; var typenid = data.typenid; $("#news tr").remove(); var $tr=""; for(var i=0;i" // + "
"+cdate1+""+cyear+"
" + "
"+cdate+"
" //+ "" if(i == length-1){ $tr+="" }else{ $tr+="" } $tr+="" + "" + "" // + "" // + "" // + "" // if(isimag){ // $tr+="" // }else{ // $tr+="" // } $tr+= "" $tr+="" + "" if(!flagnewstypeid){ $tr+= " "+organization+"/"+title }else{ $tr+= " "+title } //if(isimag){ $tr +=" [图]"} if(isimag){ $tr +=""} $tr += "" +"" +"" } $("#news").append($tr); var datacount=data.total; var currentpage= data.currentpage; var prepage = currentpage-1; if(prepage<1){prepage=1} var totalpage= data.totalpage; var nextpage = currentpage+1; if(nextpage>totalpage){nextpage=totalpage} // var cc=""; // cc=cc+"
  • 共"+datacount+"条
  • "; // cc=cc+"
  • 首页
  • "; // cc=cc+"
  • «
  • "; // cc=cc+"
  • "+currentpage+"
  • "; //// for (i = 0; i "+j+""; //// } // cc=cc+"
  • »
  • "; // cc=cc+"
  • 末页
  • "; // cc=cc+"
  • 共"+totalpage+"页
  • "; // $("#footerdiv").html(""); // $("#footerdiv").append(cc); //分页 $("#footerdiv").bootstrappaginator({ currentpage: currentpage, totalpages: totalpage, numberofpages: 6, bootstrapmajorversion: 3, size: "small", itemtexts: function(type, page, current) { //修改显示文字 switch (type) { case "first": return "第一页"; case "prev": return "上一页"; case "next": return "下一页"; case "last": return "最后一页"; case "page": return page; } }, onpageclicked: function(e,originalevent,type,page){ pagenewslist(page); } }); }, error:function(){} }) }