(function($){ /* 投递简历 电话联系 对应相应的职位 */ function load_jobs(index,utype) { var _job = $($(".posit_details").get(index)); if(utype=="2") { $(".job_btn_list > .add").attr("jobs_id", _job.attr("jobs_id")); $(".job_btn_list > .add").attr("jobs_name", _job.attr("jobs_name")); $(".job_btn_list > .add").attr("company_id", _job.attr("company_id")); $(".job_btn_list > .add").attr("company_name", _job.attr("company_name")); $(".job_btn_list > .add").attr("company_uid", _job.attr("company_uid")); } else { $(".job_btn_list > .add").attr("href",$('#cmsRoot').val()+'?m=Mobile&c=Members&a=login'); } var isTel = $("#jobs_phone_code").attr('code'); if (isTel > 0) { $(".job_btn_list > .tel").attr("pho", "tel:"+_job.attr("jobs_tel")); }; } /* 滑动 效果 */ function swipe_self() { var winWidth = window.innerWidth; var winHeight = window.innerHeight; var screenFix = function(){ $("#poster_contain").css({ width:winWidth+"px", height:winHeight+"px" }); }; screenFix(); var orientationEvent = ('onorientationchange' in window) ? 'orientationchange' : 'resize'; window.addEventListener(orientationEvent, function() { window.setTimeout(function(){ screenFix(); }, 600); }, false); $(".layer, .wx_layer").on("click", function(){ $(this).hide(); }); var _indexSwipeUp=0; var _indexSwipe=0; // 滑动 $("#poster_contain").swipeUp({ index:_indexSwipeUp, childrenClass:".poster_wrap", init:function() { $(".arrow_con").addClass("show"); setTimeout(function(){ $($("#poster_contain .poster_wrap").get(_indexSwipeUp)).addClass("focus"); }, 300); }, afterSwipe:function(index) { var _pw = $("#poster_contain .poster_wrap"); _pw.removeClass("focus"); $(_pw.get(index)).addClass("focus"); if(index == _pw.length-1){ $(".arrow_con").removeClass("show"); }else{ $(".arrow_con").addClass("show"); } var rewardHomeCon=$('.reward_home_con'), rewardHomeConLength=rewardHomeCon.length; if(rewardHomeConLength>0){ if(rewardHomeCon.hasClass("homt_active")){ rewardHomeCon.removeClass("homt_active"); } var rewardPlus=$('.reward_plus'); if(rewardPlus.hasClass("plus_animate")){ rewardPlus.removeClass("plus_animate"); } } if(index == 2){ welfInterval = setInterval(function(){ var _s = parseInt(Math.random()*6); $(".welf_bg > div").css({"-webkit-animation":"none"}); $($(".welf_bg > div").get(_s)).css({"-webkit-animation":"fuli"+(_s%2)+" 1s ease-out"}); }, 1000); }else{ if(typeof(welfInterval) != "undefined"){ clearInterval(welfInterval); } $(".welf_bg > div").css({"-webkit-animation":"none"}); } } }); // 职位滑动 var _width = winWidth; _width = _width-30*2; $(".posit_details").css({width:_width+"px"}) $(".posit_details img").css({width:_width+"px"}) var _ulWidth = $(".posit_details").length * (_width+15) + 15; $(".posit_list_ul").css({width:_ulWidth+"px"}); $(".posit_list_ul").swipe({ index:_indexSwipe, width:_width + 15, afterSwipe:function(index) { load_jobs(index,utype); } }); // 企业图片 var swipePage = { winWidth: document.documentElement.clientWidth, agent: navigator.userAgent.toLowerCase(), _indexSwipeUp: 0, _indexSwipe: 0, otherPage: false, isOpen: false, init: function() { if (swipePage.versions.iPhone && (swipePage.versions.ucbrowser || swipePage.versions.amqqbrowser)) { $(".arrow_con, .job_btn_con").css({ bottom: "50px" }) } swipePage.swipeUpInit(); swipePage.swipeInit() }, swipeUpInit: function() { var infoidParam = getparam.getUrlParam("infoid"), b = $("#poster_contain .poster_wrap"); if (infoidParam != undefined && infoidParam != "") { b.each(function(c) { if ($(this).hasClass("posit")) { swipePage._indexSwipeUp = c } }) } var isWxBack = pageConfig.isWeixinBack; if (typeof isWxBack != "undefined" && isWxBack == "true") { b.each(function(c) { if ($(this).hasClass("praise")) { swipePage._indexSwipeUp = c; swipePage.isOpen = true } }) } try { if (guideAppWeixilie.isShow()) { swipePage._indexSwipeUp = 1 } swipePage.addBtn() } catch (e) {} if (localStorage) { swipePage.otherPage = window.localStorage.getItem("otherPage") } if (typeof swipePage.otherPage !== "undefined" && swipePage.otherPage === "true") { b.each(function(i) { if ($(this).hasClass("posit")) { swipePage._indexSwipeUp = i } }); window.localStorage.setItem("otherPage", false) } swipePage.addBtn(".focus"); $("#poster_contain").swipeUp({ index: swipePage._indexSwipeUp, childrenClass: ".poster_wrap", init: function() { $(".arrow_con").addClass("show"); setTimeout(function() { $(b.get(swipePage._indexSwipeUp)).addClass("focus") }, 300) }, afterSwipe: function(index) { var _pw = $("#poster_contain .poster_wrap"); _pw.removeClass("focus"); $(_pw.get(index)).addClass("focus"); if (index == _pw.length - 1) { $(".arrow_con").removeClass("show") } else { $(".arrow_con").addClass("show") } if (index == 2) { welfInterval = setInterval(function() { var _s = parseInt(Math.random() * 6); $(".welf_bg div").css({ "-webkit-animation": "none", animation: "none" }); $($(".welf_bg div").get(_s)).css({ "-webkit-animation": "fuli" + _s % 2 + " 1s ease-out", animation: "fuli" + _s % 2 + " 1s ease-out" }) }, 1e3) } else { if (typeof welfInterval != "undefined") { clearInterval(welfInterval) } $(".welf_bg div").css({ "-webkit-animation": "none", animation: "none" }) } if (userid == getparam.getUserInfo().uid) { var isshare = $(".poster_wrap.posit"); var jianli = $(".poster_wrap.jianli"); if (isshare.hasClass("focus") || jianli.hasClass("focus")) { $(".nav_btn_con,.reward_btn_modular").hide() } else { $(".nav_btn_con,.reward_btn_modular").show() } } try { guideAppWeixilie.init({ index: index }) } catch (e) {} } }) }, swipeInit: function() { var infoidParam = getparam.getUrlParam("infoid"); if (infoidParam != "") { $(".posit_list_ul .posit_details").each(function(i) { if ($(this).attr("data-infoid") == infoidParam) { swipePage._indexSwipe = i; return false } }) } var a = swipePage.winWidth; if (swipePage.versions.android && swipePage.versions.micromessenger) { if (window.devicePixelRatio > 1) { if (swipePage.agent.miuibrowser) { a = swipePage.winWidth } else { a = window.screen.width / window.devicePixelRatio } } } a = a - 30 * 2; var b = $(".posit_details").length * (a + 15) + 15; $(".posit_details").css({ width: a + "px" }); $(".posit_list_ul").css({ width: b + "px" }); if ($(".posit").length > 0) { $(".posit_list_ul").attr("data-indexNum", swipePage._indexSwipe); $(".posit_list_ul").swipe({ index: swipePage._indexSwipe, width: a + 15, childrenClass: ".posit_details", afterSwipe: function(index) { var _job = $($(".posit_details").get(index)); if (typeof weizhan !== "undefined" && typeof weizhan.reward !== "undefined" && typeof eval(weizhan.reward.setRewardJobBtn) == "function") { weizhan.reward.setRewardJobBtn(_job) } else { $(".job_btn_list > .add").attr("href", _job.attr("url")); var telNum = _job.attr("tel"); var tel = telNum.replace("-", ""); $(".job_btn_list > .tel").attr("href", "tel:" + _job.attr("tel").replace("-", "")) } } }) } if ($(".imgs").length > 0) { $(".img_bg").css("width", a + "px"); $(".img_bg img").css("width", a - 6 + "px"); var imgWidth = $(".img_bg").length * (a + 15) + 15; $(".img_msg_con").css("width", imgWidth + "px"); $(".imgs .img_msg_con").swipe({ index: 0, width: a + 15, childrenClass: ".img_bg", afterSwipe: function(index) {} }) } }, screenFix: function() { var winWidth = document.documentElement.clientWidth, winHeight = window.innerHeight; $("#poster_contain").css({ width: winWidth + "px", height: winHeight + "px" }) }, openApp: function() { guideApp.init(); }, replaceTel: function(obj) { var telNum = obj.href; var tel = telNum.replace("-", ""); obj.removeAttribute("href"); obj.setAttribute("href", tel) }, addBtn: function(param) { if (typeof param == "undefined") { param = "" } var active_page = $(".poster_wrap" + param); var about_text = $(active_page).find(".about_us_msg"); var about_text_p = $(active_page).find("p"); if (about_text[0]) { var about_text_height = about_text[0].clientHeight; var about_text_width = $(".about_us_msg_p")[0].clientWidth; var i = about_text_p.length - 1; var str_temp = $(".about_us_msg_p p").text().replace(/\s/g, ""); var tatolfontNum = str_temp.length; var a_temp = Math.round(about_text_height / 22); var b_temp = about_text_width / 13; var c_temp = Math.round(tatolfontNum / b_temp); if (a_temp < c_temp) { var more_html = '