filesbox/web/dist/design/designstatic/front/js/recruitment.js
2024-07-26 14:10:54 +08:00

2 lines
8.5 KiB
JavaScript

var wapurl=window.location.origin+"/pages/wap/newslist.html";if(/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)&&(window.location.href=wapurl+"?busType=2"),!cdnPath)var cdnPath="";var employWagemap=["\u9762\u8BAE","2\u5343\u4EE5\u4E0B","2-3\u5343","3-4.5\u5343","4.5-6\u5343","6-8\u5343","0.8-1\u4E07","1-1.5\u4E07","1.5-2\u4E07","2-3\u4E07","3-4\u4E07","5\u4E07\u4EE5\u4E0A"],employExpmap=["\u4E0D\u9650","1-2\u5E74","2-3\u5E74","3-5\u5E74","5\u5E74\u4EE5\u4E0A"],employDegreemap=["\u4E0D\u9650","\u5C0F\u5B66","\u521D\u4E2D","\u9AD8\u4E2D","\u4E2D\u4E13","\u5927\u4E13","\u672C\u79D1","\u7855\u58EB","\u535A\u58EB","\u5176\u4ED6"],employFrommap=["\u4E0D\u9650","\u793E\u62DB","\u6821\u62DB"],employNaturemap=["\u4E0D\u9650","\u5168\u804C","\u517C\u804C"],peIde=getPar("typeId")?getPar("typeId"):"",infoValue=getPar("infoValue")?getPar("infoValue"):"1",infoValuePeIde=getPar("typeId")?getPar("typeId"):"",peId,peId2,peId3,peId4,peId5,item,item2,item3,item4,item5;function resetImgSrc(r){var t=r.replace(/([^.]*).([^.]*)$/g,"$1!medium.$2");return t}function coverError(r){var t=event.target;parseInt(t.dataset.errorcount)==0?(t.setAttribute("data-errorcount",1),t.src=r):parseInt(t.dataset.errorcount)==1&&(t.setAttribute("data-errorcount",2),t.src="/static/common/image/information/defult.jpg")}function list(r,t,o){$.ajax({type:"GET",headers:{token:getCookie("token")},url:"/api/common/getHomepageList?projectid=41",contentType:"application/json",dataType:"json",data:{infoTypeId:r,currentPage:t,pageSize:20,keywords:o,infoType:"2",employFrom:window.employFrom||void 0,employNature:window.employNature||void 0,cityCode:window.cityCode||void 0},async:!0,success:function(e){for(var s=e.data.list,a="",n=0,i=s.length;n<i;n++){var l=s[n].commonHomepageInfoId,p=s[n],v=getTimeZhCN(s[n].gmtModified),f=s[n].infoType=="1",c=location.port=="81"?"/pages/information.html?aid="+l:"/information/"+l+".shtml",y=s[n].introduce.replace(/<[^>]+>/g,"");a+="<li>",a+=' <a href="'+c+'" target="_blank">',a+=' <div class="detail" >',a+=" <h2>",a+=s[n].title,a+=" </h2>",a+=" <p>",a+="<span>"+employWagemap[parseInt(p.employWage)]+"/\u6708</span>",a+="<span>"+employDegreemap[parseInt(p.employDegree)]+"</span>",a+="<span>"+employExpmap[parseInt(p.employExp)]+"\u5DE5\u4F5C\u7ECF\u9A8C</span>",a+="<span>"+employFrommap[parseInt(p.employFrom)]+"</span>",a+="<span>"+employNaturemap[parseInt(p.employNature)]+"</span>",a+="<span>"+v+"</span>",a+=" </p>",a+=" </div>",a+=" </a>",a+="</li>"}$("#pagination2").pagination({currentPage:t,totalPage:Math.ceil(e.data.total/20),isShow:!1,count:20,prevPageText:"<",nextPageText:">",callback:function(d){list(r,d)}}),s.length==0?$(".plate-navcm").html("<div class='nodata'></div>"):$(".plate-navcm").html(a)}})}list(peIde,1),function(r,t){var o={init:function(){this.getListHomepageSetting(),this.getrecruitmentlb(),this.getrecruitmentxz(),this.getrecruitmentgzdd()},getrecruitmentlb:function(){var e="";e+='<div class="nav_label">\u62DB\u8058\u7C7B\u522B</div>',e+='<div class="plate-nav2"> <a class="pid curs employFrom" employFrom="" href="javascript:void(0);">\u5168\u90E8</a> <a class="pid employFrom" employFrom="0" href="javascript:void(0);">\u4E0D\u9650</a> <a class="pid employFrom" employFrom="2" href="javascript:void(0);">\u6821\u56ED\u62DB\u8058</a><a class="pid employFrom" employFrom="1" href="javascript:void(0);">\u793E\u4F1A\u62DB\u8058</a></div>',r(".filterrig .plate-nav2").html(e)},getrecruitmentxz:function(){var e="";e+='<div class="nav_label">\u5DE5\u4F5C\u6027\u8D28</div>',e+='<div class="plate-nav3"> <a class="pid curs employNature" employNature="" href="javascript:void(0);">\u5168\u90E8</a> <a class="pid employNature" employNature="0" href="javascript:void(0);">\u4E0D\u9650</a> <a class="pid employNature" employNature="2" href="javascript:void(0);">\u517C\u804C</a> <a class="pid employNature" employNature="1" href="javascript:void(0);">\u5168\u804C</a></div>',r(".filterrig .plate-nav3").html(e)},getrecruitmentgzdd:function(){var e=this;r.ajax({type:"GET",url:"/api/common/getRecruitmentCityList",contentType:"application/json",dataType:"json",data:{},async:!0,success:function(s){if(s.success){var a=s.data||[];if(a.length>0){var n="";n+='<div class="nav_label">\u5DE5\u4F5C\u5730\u70B9</div>',n+='<div class="plate-nav4">';for(var i=0;i<a.length;i++){var l=a[i];n+='<a class="pid cityCode" cityCode="'+l.areaCode+'" href="javascript:void(0);">'+l.areaName+"</a>"}n+="</div>",r(".filterrig .plate-nav4").html(n)}}}})},getListHomepageSetting:function(){var e=this;r.ajax({type:"GET",url:"/api/common/listHomepageSetting",contentType:"application/json",dataType:"json",data:{busType:"2"},async:!0,success:function(s){window.classifyData=s.data;var a=s.data,n=a;parseInt(infoValue)==0&&(n=e.getParentObj(a,peIde,!0)),e.renderNav(n,peIde),e.filterrigEvent(n)}})},renderNav:function(e,s){for(var a=this,n="",i=e,l=e,p=1,v=a.getParentObj(e,s),f=parseInt(p)==1,c=0,y=v.length;c<y;c++){var d=v[c-1]||0,g=v[c];if(i=l,parseInt(p)==0&&v[c]==infoValuePeIde&&(f=!0),c==0&&(n+='<div class="nav_label">\u5C97\u4F4D\u5206\u7C7B</div>'),i&&f){g?n+='<div class="plate-nav"> <a class="pid" tabs="'+d+'" href="javascript:void(0);">\u5168\u90E8</a>':n+='<div class="plate-nav"> <a class="pid curs" tabs="0" href="javascript:void(0);">\u5168\u90E8</a>';for(var m=0,h=i.length;m<h;m++){var u=i[m];parseInt(g)==parseInt(u.commonHomepageInfoTypeId)?(l=u.children,n+='<a class="pid curs" tabs="'+u.commonHomepageInfoTypeId+'" href="javascript:void(0);">'+u.typeName+"</a>"):n+='<a class="pid" tabs="'+u.commonHomepageInfoTypeId+'" href="javascript:void(0);">'+u.typeName+"</a>"}n+="</div>"}else if(i)for(var m=0,h=i.length;m<h;m++){var u=i[m];parseInt(g)==parseInt(u.commonHomepageInfoTypeId)&&(l=u.children)}}r(".filterrig .plate-nav").html(n)},getParentObj:function(e,s,a){var n="",i=e;function l(p,v,f){for(var c=0,y=p.length;c<y;c++){var d=p[c];if(parseInt(d.commonHomepageInfoTypeId)==parseInt(v))i=p,n=f+d.commonHomepageInfoTypeId+",";else if(d.children){var g=f+d.commonHomepageInfoTypeId+",";l(d.children,v,g)}}}return l(e,s,[]),a?i:n.split(",")},filterrigEvent:function(e){var s=this;r(".searchtxt").on("keypress",function(a){a.keyCode==13&&(t.keyWord=r(this).val(),list(t.peIde,1,t.keyWord))}),r(".filterrig").on("click","a",function(){var a=r(this);if(a.hasClass("searchbtn"))t.keyWord=r(".searchtxt").val(),list(t.peIde,1,t.keyWord);else if(a.hasClass("employFrom")){var n=a.attr("employFrom")||void 0;r(".employFrom").removeClass("curs"),a.addClass("curs"),t.employFrom=n,list(t.peIde)}else if(a.hasClass("employNature")){var i=a.attr("employNature")||void 0;r(".employNature").removeClass("curs"),a.addClass("curs"),t.employNature=i,list(t.peIde)}else if(a.hasClass("cityCode")){a.toggleClass("curs");var l=[];r(".plate-nav4 .curs").each(function(v,f){l.push(r(this).attr("cityCode"))}),t.cityCode=l.join(),list(t.peIde)}else{var p=a.attr("tabs");t.peIde=p,s.peId=p,s.renderNav(e,p),list(t.peIde)}})}};o.init()}(jQuery,window),Date.prototype.format=function(r){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(r)&&(r=r.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in t)new RegExp("("+o+")").test(r)&&(r=r.replace(RegExp.$1,RegExp.$1.length==1?t[o]:("00"+t[o]).substr((""+t[o]).length)));return r};function getTimeZhCN(r,t){if(new Date(parseInt(r))=="Invalid Date"&&new Date(parseInt(r)*1e3)=="Invalid Date")return"--";new Date(parseInt(t))=="Invalid Date"&&new Date(parseInt(t)*1e3)=="Invalid Date"&&(t=Date.parse(new Date));var o=t-r;if(o<0)return"\u521A\u521A";if(o<6e4)return parseInt(o/1e3,10)+"\u79D2\u524D";if(o<3600*1e3)return parseInt(o/1e3/60,10)+"\u5206\u949F\u524D";if(o<24*3600*1e3)return parseInt(o/1e3/3600,10)+"\u5C0F\u65F6\u524D";if(o<7*24*3600*1e3)return parseInt(o/1e3/3600/24,10)+"\u5929\u524D";if(o<30*24*3600*1e3)return parseInt(o/1e3/3600/24/7,10)+"\u5468\u524D";if(o<365*24*3600*1e3)return parseInt(o/1e3/3600/24/30,10)+"\u4E2A\u6708\u524D";var e=new Date(parseInt(r)),s=parseInt(e.getMonth()+1)<10?"0"+(e.getMonth()+1):e.getMonth()+1,a=parseInt(e.getDate())<10?"0"+e.getDate():e.getDate(),n=parseInt(e.getHours())<10?"0"+e.getHours():e.getHours(),i=parseInt(e.getMinutes())<10?"0"+e.getMinutes():e.getMinutes();return e.getFullYear()+"-"+s+"-"+a+" "+n+":"+i}function getPar(r){var t=document.location.href,o=t.indexOf(r+"=");if(o==-1)return!1;var e=t.slice(r.length+o+1),s=e.indexOf("&");return s!=-1&&(e=e.slice(0,s)),e}function getCookie(r){for(var t=document.cookie,o=t.split("; "),e=0;e<o.length;e++){var s=o[e].split("=");if(s[0]==r)return s[1]}return""}