// var nid = GetQueryString('ntype'); // $("div.newstab >a").removeClass("sel"); // $("div.newstab >a.ntab"+nid).addClass("sel"); $(function(){ // $("div.newstab >a").click(function(){ // $(this).addClass("sel").siblings().removeClass("sel"); // }); }) // 璇锋眰鏁版嵁 // 鏁版嵁鍒嗙被杩囨护 if (typeof Array.prototype.filter != "function") { Array.prototype.filter = function (fn,context) { var arr = []; if (typeof fn === "function") { for (var k = 0, length = this.length; k < length; k++) { fn.call(context, this[k], k, this) && arr.push(this[k]); } } return arr; }; } //鏂伴椈鍒楄〃 function getNewsList() { var url='data/news/list.json'; $.ajax({ url : url, type : "GET", dataType : "JSON", success : function(result) { if (result!= null) { if (result.errcode == 0) { if (result.newslists!= null) { // console.log(result.herolist); // console.log(666); var alllist=result.newslists.filter(function(a){ return a.type=="yh"; }); //鍏徃鏂伴椈 var yhnews = result.newslists.filter(function(a) { return a.type == "yh"; }); //濯掍綋鎶ラ亾 var mtnews = result.newslists.filter(function(a) { return a.type == "mt"; }); var needlists; var newslisthtml=''; needlists=alllist; // console.log(news); function crateListDom(){ if(needlists.length>0){ for(var i=0;i'+needlists[i].typename+'

'+needlists[i].title+''+needlists[i].description+'鍙戝竷鏃堕棿:'+needlists[i].pub_time+'

'; newslisthtml+=''+needlists[i].title+''+needlists[i].pub_time+'

'+needlists[i].description+'

'; } $("div.newslistsnoimg").html(newslisthtml); }else{ $("div.newslistsnoimg").html("鍗冲皢鏇存柊锛屾暚璇锋湡寰?); } } crateListDom(); $(".newstab a").click(function(){ var idx=$(this).index()+1; // console.log(idx); $(this).addClass('sel').siblings().removeClass('sel'); needlists=[]; newslisthtml=''; if(idx==1){ needlists=yhnews; }else if(idx==2){ needlists=mtnews; // console.log(needlists); }else{ console.log('娌℃湁杩欎釜鍒嗙被'); } crateListDom(); }); } else { console.log("鎵句笉鍒板垪琛?); } } else if (result.errcode == 41002) { // console.log("娌℃湁鍒楄〃"); } else { console.log(result.errcode + ":" + result.errmsg); } } else { console.log("鍑洪敊"); } }, error : function() { console.log("鍑洪敊锛岃妫€鏌?); } }); } //缃《鏂伴椈鍒楄〃 function getTopNewsList() { var url='data/news/list.json'; $.ajax({ url : url, type : "GET", dataType : "JSON", success : function(result) { if (result!= null) { if (result.errcode == 0) { if (result.newslists!= null) { // console.log(result.herolist); // console.log(666); var alllist=result.newslists.filter(function(a){ return a.istop && a.type=="yh"; }); //鍏徃鏂伴椈 var yhnews = result.newslists.filter(function(a) { return a.istop && a.type=="yh"; }); //濯掍綋鎶ラ亾 var mtnews = result.newslists.filter(function(a) { return a.istop && a.type=="mt"; }); var needlists; var newslisthtml=''; needlists=alllist; // console.log(news); function crateListDom(){ if(needlists.length>0){ for(var i=0;i

'+needlists[i].title+'

'+needlists[i].description+'

'+needlists[i].pub_time+'

'; } $("div.newslists").html(newslisthtml+'
'); }else{ $("div.newslists").html("鍗冲皢鏇存柊锛屾暚璇锋湡寰?); } //鏂伴椈鎻忚堪闄愬埗瀛楁暟 $('span.ns1').each(function(){ var len=$(this).text().length; // console.log(len); if(len>18){ var str=''; str=$(this).text().substring(0,18)+'...'; $(this).html(str); } }); $('span.ns2').each(function(){ var len=$(this).text().length; // console.log(len); if(len>68){ var str=''; str=$(this).text().substring(0,68)+'...'; $(this).html(str); } }); } crateListDom(); $(".newstab a").click(function(){ var idx=$(this).index()+1; // console.log(idx); $(this).addClass('sel').siblings().removeClass('sel'); needlists=[]; newslisthtml=''; if(idx==1){ needlists=yhnews; }else if(idx==2){ needlists=mtnews; // console.log(needlists); }else{ console.log('娌℃湁杩欎釜鍒嗙被'); } crateListDom(); }); } else { console.log("鎵句笉鍒板垪琛?); } } else if (result.errcode == 41002) { // console.log("娌℃湁鍒楄〃"); } else { console.log(result.errcode + ":" + result.errmsg); } } else { console.log("鍑洪敊"); } }, error : function() { console.log("鍑洪敊锛岃妫€鏌?); } }); } //鏂伴椈璇︽儏 function getNewsInfo(newsid) { var url='data/news/'+newsid+'/content.json'; $.ajax({ url : url, type : "GET", dataType : "JSON", success : function(result) { if (result != null) { if (result.errcode == 0) { if (result.newsDetail != null) { $('div.newstitle >h2').html(result.newsDetail.title); $('div.newstitle >span').html(result.newsDetail.pub_time); // var timearr=result.newsDetail.pub_time.split('-'); // $('span.year').html(timearr[0]); // $('span.month').html(timearr[1]); // $('span.day').html("/"+timearr[2]); $('div.newscontent').html(result.newsDetail.content); } else { console.log("nonewsdetail"); } } else if (result.errcode == 41002) { // 鑾峰彇鏁版嵁鍑洪敊 console.log("nonews"); } else { console.log(result.errcode + ":" + result.errmsg); } } else { console.log("鍑洪敊"); } }, error : function() { console.log("鍑洪敊锛岃妫€鏌?); } }); } // 鑽h獕鍒楄〃 function getHonorList() { var url='data/honor/list.json'; $.ajax({ url : url, type : "GET", dataType : "JSON", success : function(result) { if (result!= null) { if (result.errcode == 0) { if (result.honorlists!= null) { // console.log(result.herolist); // console.log(666); var alllist=result.honorlists; var needlists; var honoryearshtml=''; needlists=alllist; // console.log(news); function crateListDom(){ if(needlists.length>0){ for(var i=0;i'+needlists[i].typename+'

'+needlists[i].title+''+needlists[i].description+'鍙戝竷鏃堕棿:'+needlists[i].pub_time+'

'; honoryearshtml+='
'+needlists[i].year+'
'; } $("div.yearlist").html(honoryearshtml); }else{ $("div.yearlist").html("鍗冲皢鏇存柊锛屾暚璇锋湡寰?); } } crateListDom(); function createHonorDom(id){ var honorlisthtml="鑾峰鏃堕棿濂栭」鍚嶇О鑾峰瀵硅薄棰佸彂鏈烘瀯"; var honordetails=needlists[id].honors; for(var i=0;i'+honordetails[i].hname+''+honordetails[i].hwinner+''+honordetails[i].hbase+'' } $("div.honorlist >table").html(honorlisthtml); } $("div.yearlist >div:eq(0)").addClass("sel"); $("div.yearlist >div").click(function(){ $(this).addClass("sel").siblings().removeClass("sel"); var idx=$(this).index(); createHonorDom(idx); }); createHonorDom(0); // $(".newstab a").click(function(){ // var idx=$(this).index()+1; // // console.log(idx); // $(this).addClass('sel').siblings().removeClass('sel'); // needlists=[]; // newslisthtml=''; // if(idx==1){ // needlists=yhnews; // }else if(idx==2){ // needlists=mtnews; // // console.log(needlists); // }else{ // console.log('娌℃湁杩欎釜鍒嗙被'); // } // crateListDom(); // }); } else { console.log("鎵句笉鍒板垪琛?); } } else if (result.errcode == 41002) { // console.log("娌℃湁鍒楄〃"); } else { console.log(result.errcode + ":" + result.errmsg); } } else { console.log("鍑洪敊"); } }, error : function() { console.log("鍑洪敊锛岃妫€鏌?); } }); } // 鍘嗙▼鍒楄〃 function getHistoryList() { var url='data/history/list.json?v=1219'; $.ajax({ url : url, type : "GET", dataType : "JSON", success : function(result) { if (result!= null) { if (result.errcode == 0) { if (result.historylists!= null) { // console.log(result.herolist); // console.log(666); var alllist=result.historylists; var needlists; var lefthistoryhtml=''; var righthistoryhtml=''; needlists=alllist; // console.log(news); function crateListDom(){ if(needlists.length>0){ for(var i=0;i0){ for(var i=0;i鏇村
'; } $("div.jobsmain").html(jobsitemhtml); for(var i=0;i'+joblists[i].jname+'骞垮窞'; } } $("div.jobitem:eq("+id+") .itemlist").html(joblisthtml); } } else { console.log("鎵句笉鍒板垪琛?); } } else if (result.errcode == 41002) { // console.log("娌℃湁鍒楄〃"); } else { console.log(result.errcode + ":" + result.errmsg); } } else { console.log("鍑洪敊"); } }, error : function() { console.log("鍑洪敊锛岃妫€鏌?); } }); } // 鎷涜仒璇︽儏椤靛垪琛 function getJobDetailList() { var url='data/jobs/list.json?v=316'; $.ajax({ url : url, type : "GET", dataType : "JSON", success : function(result) { if (result!= null) { if (result.errcode == 0) { if (result.jobstypes!= null) { // console.log(result.herolist); // console.log(666); var alllist=result.jobstypes; var needlists; var jobsitemhtml=''; needlists=alllist; // 閫変腑鐘舵€佹帶鍒 var type = GetQueryString('type'); var jid = GetQueryString('jid'); var jtype=type-1; // console.log(news); function crateItemDom(){ if(needlists.length>0){ for(var i=0;i'+needlists[i].typename+'
'; } $("div.joblistleft").html(jobsitemhtml); // for(var i=0;ia").addClass("sel"); function createJoblistDom(id){ var joblisthtml=''; var joblists=needlists[id].jlist; for(var i=0;i'+joblists[i].jname+'' } $("div.leftitem:eq("+id+") >div").html(joblisthtml); } } else { console.log("鎵句笉鍒板垪琛?); } } else if (result.errcode == 41002) { // console.log("娌℃湁鍒楄〃"); } else { console.log(result.errcode + ":" + result.errmsg); } } else { console.log("鍑洪敊"); } }, error : function() { console.log("鍑洪敊锛岃妫€鏌?); } }); } // 鎷涜仒璇︽儏淇℃伅 function getJobDetail(jobtype,jobid) { var url='data/jobs/jdetail'+jobtype+'.json'; $.ajax({ url : url, type : "GET", dataType : "JSON", success : function(result) { if (result!= null) { if (result.errcode == 0) { if (result.jobdetails!= null) { // console.log(result.herolist); // console.log(666); var alllist=result.jobdetails; var needlists; // var jzzhtml=""; // var jyqhtml=""; needlists=alllist; var jobdetailid=jobid; // console.log(news); function crateItemDom(){ if(needlists.length>0){ $("span.jtitle").html(needlists[jobdetailid].jname); $("p.jzz").html(needlists[jobdetailid].jzz); $("p.jyq").html(needlists[jobdetailid].jyq); }else{ $("p.jzz").html("鏆傛棤璇ュ矖浣嶈亴璐d俊鎭?); $("p.jyq").html("鏆傛棤璇ュ矖浣嶈亴浣嶈姹備俊鎭?); } } crateItemDom(); $("div.leftitem >div >a:eq("+jobdetailid+")").addClass("sel"); } else { console.log("鎵句笉鍒板垪琛?); } } else if (result.errcode == 41002) { // console.log("娌℃湁鍒楄〃"); } else { console.log(result.errcode + ":" + result.errmsg); } } else { console.log("鍑洪敊"); } }, error : function() { console.log("鍑洪敊锛岃妫€鏌?); } }); }