12 |
- (()=>{$(".secondary-menu").on("click","a",function(){$(".secondary-menu ul li").removeClass("active"),$(this).parent().addClass("active"),"全部"==$(this).html()?window.sessionStorage.setItem("newType",void 0):"科德新闻"==$(this).html()?window.sessionStorage.setItem("newType",0):"行业资讯"==$(this).html()&&window.sessionStorage.setItem("newType",1);var e=window.sessionStorage.getItem("newType");if("undefined"!=e)var t={type:e,releaseStatus:1};else t={releaseStatus:1};$.ajax({method:"get",url:api+"/open/listNews",data:t,success:function(e){if(e.error&&e.error.length)alert("数据加载失败,请刷新页面");else{var t="";if(e.data.list.length){for(var a=0;a<e.data.list.length;a++){var i=e.data.list[a],s=i.content.replace(/<.*?>/gi,"");t+="<li><a target='_blank' href="+newUrl+"?id="+i.id+"><div class=news-item><div><img src="+avatarUploadHost+i.pictureUrl+" / ></div><div><h6>"+i.title+"</h6><span>"+i.releaseTimeConvert+"</span><div>"+s+"</div></div></div></a></li>"}window.sessionStorage.setItem("total",e.data.totalCount),function(){var e={obj_box:".page_1",total_item:+window.sessionStorage.getItem("total"),type:+window.sessionStorage.getItem("newType"),per_num:10,current_page:1,change_content:function(e,t){e=e||10,t=t||1;var a=window.sessionStorage.getItem("newType");if("undefined"==a)var i={pageNo:t};else i={type:a,pageNo:t};$.ajax({url:api+"/open/listNews",data:i,type:"GET",dataType:"json",success:function(e){if(e.error&&e.error.length)alert("数据加载失败,请刷新页面");else{var t="";if(e.data.list.length){for(var a=0;a<e.data.list.length;a++){var i=e.data.list[a],s=i.content.replace(/<.*?>/gi,"");t+="<li><a target='_blank' href="+newUrl+"?id="+i.id+"><div class=news-item><div><img src="+avatarUploadHost+i.pictureUrl+" / ></div><div><h6>"+i.title+"</h6><span>"+i.releaseTimeConvert+"</span><div>"+s+"</div></div></div></a></li>"}window.sessionStorage.setItem("total",e.data.totalCount)}else t="<h4 style='text-align:center;margin-top:90px;color:#666' >暂无新闻动态</h4>",$(".page_ctrl").css({display:"none"});$(".newslist").html(t)}}})}};page_ctrl(e)}()}else t="<h4 style='text-align:center;margin-top:90px;color:#666' >暂无新闻动态</h4>",$(".page_ctrl").css({display:"none"});$(".newslist").html(t)}}})}),$(".secondary-menu > div > ul > li > a").eq(0).click()})();
|