var content = ""; comps.resouceactivtylist = function(config){ this.compid = config.compid; this.config = config; } //异步情况下渲染数据 comps.resouceactivtylist.prototype.init=function(){ var ts = this; var needasyncinit = ts.config.needasyncinit; var contentcategoryuuid = ts.config.contentcategoryuuid; if(needasyncinit){ ts.ajaxloaddata(); }else{ ts.bindevent(); utils.ajaxloadcomplate(ts); } } comps.resouceactivtylist.prototype.ajaxloaddata = function (option) { var ts = this; var compid = this.compid $.ajax({ "url": contextpath+"/resouceactivtylist/ajaxloaddata.json", "data" : option, "success": function (data) { ts._renderprodcutlist(data); } }) } comps.resouceactivtylist.prototype.bindevent = function () { var ts = this; //删除加载的 download-layout样式 $(".download-layout").eq(0).remove(); var totalpage = $("#totalpage").val(); var categoryuuid = ts.config.contentcategoryuuid; var compid = ts.config.compid; var pageshow = ts.config.pageshow; var thispage = $("#"+compid+"_page"); /*首页按钮*/ $("#"+compid+" .first_btn").click(function(){ //当前页对象 var nowpageobj = $(this).siblings('.y_cur'); nowpageobj.removeclass("y_cur"); //当前页置灰 thispage.find('.page_turn').eq(0).addclass("y_cur"); //第一页码选中 thispage.find(".y_num").text(1); //到m页 thispage.find('.last_btn').addclass("disabled");//上一页置灰 if (totalpage != 1) { thispage.find('.next_btn').removeclass("disabled");//下一页亮起 }; var option ={"nowpage":"1","categoryuuid":categoryuuid,"showpage":pageshow}; ts.ajaxloaddata(option); }); /*上一页按钮*/ $("#"+compid+" .last_btn").click(function(){ //当前页对象 var nowpageobj = $(this).siblings('.y_cur'); //上一页 var nowpage = nowpageobj.text(); var page = parseint(nowpage) - 1; if(page == 1){ thispage.find(".last_btn").addclass("disabled"); } nowpageobj.removeclass("y_cur"); //当前页置灰 thispage.find('.page_turn').eq(page-1).addclass("y_cur"); //页码选中 thispage.find(".y_num").text(page); //到m页 thispage.find('.next_btn').removeclass("disabled");//下一页亮起 //加载数据 var option ={"nowpage":page,"categoryuuid":categoryuuid,"showpage":pageshow}; ts.ajaxloaddata(option); }); /*页数按钮*/ $("#"+compid+" .page_turn").click(function(){ //其他页置灰 $(this).siblings().removeclass("y_cur"); //当前页 var nowpage = parseint($(this).text()); thispage.find('.page_turn').eq(nowpage - 1).addclass("y_cur"); //页码选中 thispage.find(".y_num").text(nowpage); //到m页 if(nowpage != 1){ thispage.find(".last_btn").removeclass("disabled"); //上一页亮起 } if(nowpage == 1){ thispage.find(".last_btn").addclass("disabled"); //上一页置灰 } if(nowpage != totalpage){ thispage.find(".next_btn").removeclass("disabled");// 下一页亮起 } if(nowpage == totalpage){ thispage.find(".next_btn").addclass("disabled");// 下一页置灰 } var option ={"nowpage":nowpage,"categoryuuid":categoryuuid,"showpage":pageshow}; ts.ajaxloaddata(option); }); /*下一页按钮*/ $("#"+compid+" .next_btn").click(function(){ //当前页对象 var nowpageobj = $(this).siblings('.y_cur'); //上一页 var nowpage = nowpageobj.text(); var page = parseint(nowpage) + 1; if(page == totalpage){ thispage.find(".next_btn").addclass("disabled"); } nowpageobj.removeclass("y_cur"); //当前页置灰 thispage.find('.page_turn').eq(page-1).addclass("y_cur"); //页码选中 thispage.find(".y_num").text(page); //到m页 thispage.find('.last_btn').removeclass("disabled");//上一页亮起 //加载数据 var option ={"nowpage":page,"categoryuuid":categoryuuid,"showpage":pageshow}; ts.ajaxloaddata(option); }); /*尾页按钮*/ $("#"+compid+" .end_btn").click(function(){ //当前页对象 var nowpageobj = $(this).siblings('.y_cur'); nowpageobj.removeclass("y_cur"); //当前页置灰 thispage.find('.page_turn').eq(totalpage-1).addclass("y_cur"); //最后页码选中 thispage.find(".y_num").text(totalpage); //到m页 thispage.find('.next_btn').addclass("disabled");//下一页置灰 if (totalpage != 1) { thispage.find('.last_btn').removeclass("disabled");//上一页亮起 }; var option ={"nowpage":totalpage,"categoryuuid":categoryuuid,"showpage":pageshow}; ts.ajaxloaddata(option); }); $(".y_pagenumber").mouseover(function(){ $(this).addclass("active"); }); $(".y_pagenumber").mouseout(function(){ $(this).removeclass("active"); }); $("#"+compid+" ul#page_btn").on("click","li",function(){ //当前页 var nowpage = parseint($(this).text()); //其他页置灰 thispage.find('.page_turn').removeclass("y_cur").eq(nowpage - 1).addclass("y_cur"); //页码选中 thispage.find(".y_num").text(nowpage); //到m页 if(nowpage != 1){ thispage.find(".last_btn").removeclass("disabled"); //上一页亮起 } if(nowpage == 1){ thispage.find(".last_btn").addclass("disabled"); //上一页置灰 } if(nowpage != totalpage){ thispage.find(".next_btn").removeclass("disabled");// 下一页亮起 } if(nowpage == totalpage){ thispage.find(".next_btn").addclass("disabled");// 下一页置灰 } var option ={"nowpage":nowpage,"categoryuuid":categoryuuid,"showpage":pageshow}; ts.ajaxloaddata(option); }); } //渲染活动风采列表 comps.resouceactivtylist.prototype._renderprodcutlist = function(data){ var compid = this.config.compid; var productsele = $("#"+compid+"_main"); var productloopele = $("#"+compid+"_a"); productsele.find(".j_a").remove(); var productlist = data; //循环渲染活动风采 if(productlist.length>0){ //noresultele.remove(); for(var i=0;i"); var productlist = data.contentlist; var contentcategorylist = data.list; $("#"+compid+"_crumbs").html(""); var html = "首页/"; for(var i=0;i"; break; }else{ html += ""+taxonpaths1[i]+"/"; } } $("#"+compid+"_crumbs").html(html); $("#"+compid+"_title").html(taxonpaths1[taxonpaths1.length-2]); $("#"+compid+"_tab").html(""); if(contentcategorylist.length > 0){ var html1 = ""; for(var i=0; i"+contentcategorylist[i].categoryname+""; }else{ html1 += "
" + contentcategorylist[i].categoryname + "
"; } } $("#"+compid+"_tab").html(html1); } $("#j_content").html(""); if(productlist.length>0){ var html2 = ""; for(var i=0;i"; html2 += "
"; html2 += "
"; html2 += "
"+productlist[i].introduction+"
"; } }else{//若无产品保养,提示无产品保养 html2 += "无产品保养"; } $("#j_content").html(html2); this.bindevent(); } comps.productmaintain.prototype.bindevent = function(){ var ts = this; var compid = ts.config.compid; $(".m_itme").click(function (){ $(".active").removeclass("active"); $(this).addclass("active"); var contentcategoryuuid = $(this).attr("id"); $.ajax({ "url":contextpath+"/productmaintaincomp/loaddata.json", data: {"contentcategoryuuid":contentcategoryuuid}, "success":function(data){ ts.loaddata(data); } }) }); } comps.productmaintain.prototype.loaddata = function(data){ var productlist = data.contentlist; $("#j_content").html(""); var html2 = ""; if(productlist.length>0){ for(var i=0;i"; html2 += "
"; html2 += "
"; html2 += "
"+productlist[i].introduction+"
"; } }else{//若无产品保养,提示无产品保养 html2 += "无产品保养"; } $("#j_content").html(html2); this.bindevent(); } //########### 校园招聘宣讲行程##########9 comps.resourcecourses = function(config){ this.compid = config.compid; this.config = config; } //异步情况下渲染数据 comps.resourcecourses.prototype.init=function(){ var ts = this; var needasyncinit = ts.config.needasyncinit; if(needasyncinit){ ts.ajaxloaddata(); }else{ utils.ajaxloadcomplate(ts); } } //异步获取 comps.resourcecourses.prototype._renderprodcutlist = function(data){ var compid = this.config.compid; var productsele = $("#"+compid+"_main"); var productloopele = $("#"+compid+"_list"); var productele = $("#"+compid + "_var"); productsele.find(".j_pdtain_var").remove(); var productlist = data; //循环渲染产品保养信息 if(productlist.length>0){ //noresultele.remove(); for(var i=0;i0){ for(var i=0;i 0){ $("#humanresourcenavigation").html(""); var html = "" ; for(var i=0; i"; html += "

"+data[i].channelname+"

"; html += ""; } $("#humanresourcenavigation").html(html); } }; //###########人力资源首页底部组件##########9 comps.resoursebottom = function(option) { this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.imgsrc = option.imgsrc; this.defineurl = option.defineurl; this.title = option.title; this.note = option.note; this.thirdimg = option.thirdimg; this.fourthimg = option.fourthimg; this.weixinshow = option.weixinshow; } comps.resoursebottom.prototype.getquerystring = function(name) { var reg = new regexp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } comps.resoursebottom.prototype.init = function() { var that =this; if (that.needasyncinit) { $("#"+that.compid+"_title").html(that.title); $("#"+that.compid+"_note").html(that.note); if(that.weixinshow){ $("#"+that.compid+"_img").attr("src",that.thirdimg); var html = "
" ; html += "" ; html += "" ; html += "微信公众号"; $("#"+that.compid+"_addclass").addclass("world-f-weixin").append(html); }else{ $("#"+that.compid+"_img").attr("src",that.imgsrc); } } that.bindsomeevent(); utils.ajaxloadcomplate(that); } comps.resoursebottom.prototype.bindsomeevent=function(){ var that=this; $("#"+that.compid+"_a").click(function(){ window.open(contextpath+that.defineurl); }) } //###########人力资源首页底部组件########## //###########九牧之家组件##########9 comps.resourcehome = function (config) { this.compid = config.compid; this.config = config; }; comps.resourcehome.prototype.init = function () { var that = this; that.bindsomeevent(); utils.ajaxloadcomplate(that); }; comps.resourcehome.prototype.bindsomeevent=function(){ var that=this; $("#"+that.compid+"_a").click(function(){ window.open(contextpath+that.config.url); }) $(".home-jomoo").mouseover(function(){ $(this).children('.home-jomoo-slck').children('i').css("opacity","0"); $(this).children('.home-jomoo-slck').children('p').addclass('home-jomoo-blue'); }) $(".home-jomoo").mouseout(function(){ $(this).children('.home-jomoo-slck').children('i').css("opacity","1"); $(this).children('.home-jomoo-slck').children('p').removeclass('home-jomoo-blue'); }) } //###########九牧之家组件end##########9 //###########九牧之家员工风采组件##########9 comps.resourceemplee = function (config) { this.compid = config.compid; this.config = config; }; comps.resourceemplee.prototype.init = function () { var that = this; utils.ajaxloadcomplate(that); that.bindsomeevent(); }; comps.resourceemplee.prototype.bindsomeevent=function(){ var that=this; //banner切换 $('.home-style.flexslider').flexslider({ animation:"slide", //让滑块成为旋转木马切换必须设置animation属性为"slide",同时设置元素宽度itemwidth itemwidth:340, //让滑块成为旋转木马切换必须设置animation属性为"slide",同时设置元素宽度itemwidth itemmargin:15 //该参数设置后,还需要在css中设置旋转木马元素margin-right值为该参数的值 }); } //###########九牧之家员工风采组件##########9 //########### 九牧之家内刊组件 ##########9 /** * resourcemagazine 九牧之家内刊组件 * created by xc on 2017/6/6 */ comps.resourcemagazine = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.imgsrc = option.imgsrc; this.url = option.url; this.title = option.title; this.content = option.content; this.magazineuuid = option.magazineuuid; } //异步情况下渲染数据 comps.resourcemagazine.prototype.init=function(){ var that =this; if (this.needasyncinit) { $("#"+that.compid+"_img").attr("src",that.imgsrc); $("#"+that.compid+"_a").attr("href",that.url); $("#"+that.compid+"_note").html(that.content); $("#"+that.compid+"_title").html(that.title); } that.bindevent(); utils.ajaxloadcomplate(that); } //解决方案组件初始化事件 comps.resourcemagazine.prototype.bindevent = function(){ var that = this; $('.home-life.flexslider').flexslider({ selector:".slides > .m-components-wrap", animation:"slide", //让滑块成为旋转木马切换必须设置animation属性为"slide",同时设置元素宽度itemwidth itemwidth:210, //让滑块成为旋转木马切换必须设置animation属性为"slide",同时设置元素宽度itemwidth itemmargin:70 //该参数设置后,还需要在css中设置旋转木马元素margin-right值为该参数的值 }); } //########### 九牧之家内刊组件end ##########9 //########### 人力资源-薪资福利右侧组件 ##########9 /** * resourcemagazine 九牧之家内刊组件 * created by xc on 2017/6/6 */ comps.resourceright = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.imgsrc = option.imgsrc; this.url = option.url; this.title = option.title; this.content = option.content; this.magazineuuid = option.magazineuuid; } //异步情况下渲染数据 comps.resourceright.prototype.init=function(){ var that =this; if (this.needasyncinit) { $("#"+that.compid+"_img").attr("src",that.imgsrc); $("#"+that.compid+"_a").attr("href",that.url); $("#"+that.compid+"_note").html(that.content); $("#"+that.compid+"_title").html(that.title); } that.bindevent(); utils.ajaxloadcomplate(that); } //解决方案组件初始化事件 comps.resourceright.prototype.bindevent = function(){ var that = this; } //########### 人力资源-薪资福利右侧组件 end ##########9 //########### 人力资源-薪资福利左侧组件 ##########9 /** * resourcemagazine 人力资源-薪资福利左侧组件 * created by xc on 2017/6/6 */ comps.resourceleft = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.title = option.title; this.imgsrc = option.imgsrc; this.definewidth = option.definewidth; this.defineheight = option.defineheight; } //异步情况下渲染数据 comps.resourceleft.prototype.init=function(){ var that =this; that.bindevent(); utils.ajaxloadcomplate(that); } //解决方案组件初始化事件 comps.resourceleft.prototype.bindevent = function(){ $(".pay-list-l div a:first").addclass('mouseover-l01'); var that = this; $(".pay-list-l div a").mouseover(function(){ var listli = $(this).parent("div").index(); if( listli == 0 ){ $(this).addclass('mouseover-l01').parent().parent().parent().parent().siblings('div').children('div').children('div').children('div').children('a').removeclass('mouseover-l01'); } if( listli == 1 ){ $(this).addclass('mouseover-l01').parent().parent().parent().parent().siblings('div').children('div').children('div').children('div').children('a').removeclass('mouseover-l01'); } if( listli == 2 ){ $(this).addclass('mouseover-l01').parent().parent().parent().parent().siblings('div').children('div').children('div').children('div').children('a').removeclass('mouseover-l01'); } $(".campus-list-r").hide().eq($(".pay-list-l div a").index(this)).show(); }) $(".campus-list-r").hide().eq($(".pay-list-l div a").index(0)).show(); } //########### 人力资源-薪资福利左侧组件 end ##########9 //########### 人力资源-九牧商学院简介组件 ##########9 /** * resourcemagazine 人力资源-九牧商学院简介组件 * created by xc on 2017/6/12 */ comps.resourceintroduction = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.imgsrc = option.imgsrc; this.url = option.url; this.title = option.title; this.content = option.content; } //异步情况下渲染数据 comps.resourceintroduction.prototype.init=function(){ var that =this; that.bindevent(); utils.ajaxloadcomplate(that); } //解决方案组件初始化事件 comps.resourceintroduction.prototype.bindevent = function(){ var that = this; } //########### 人力资源-九牧商学院简介组件 end ##########9 //########### 人力资源-九牧商学院简介组件 ##########9 /** * resourcemagazine 人力资源-九牧商学院讲师组件 * created by xc on 2017/6/12 */ comps.resourceteacher = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.imgsrc = option.imgsrc; this.url = option.url; this.title = option.title; this.content = option.content; this.description = option.description; } //异步情况下渲染数据 comps.resourceteacher.prototype.init=function(){ var that =this; that.bindevent(); utils.ajaxloadcomplate(that); } //解决方案组件初始化事件 comps.resourceteacher.prototype.bindevent = function(){ var that = this; } //########### 人力资源-九牧商学院简介组件 end ##########9 //########### 人力资源-九牧商学院简介组件 ##########9 /** * resourcemagazine 人力资源-九牧商学院讲师组件 * created by xc on 2017/6/12 */ comps.resourceteach = function(option){ this.compid = option.compid; this.needasyncinit = option.needasyncinit; this.imgsrc = option.imgsrc; this.url = option.url; this.title = option.title; this.content = option.content; this.description = option.description; } //异步情况下渲染数据 comps.resourceteach.prototype.init=function(){ var that =this; that.bindevent(); utils.ajaxloadcomplate(that); } //解决方案组件初始化事件 comps.resourceteach.prototype.bindevent = function(){ var that = this; //详情页自由搭配商品切换 if($('.trade-style-js.owl-carousel').length && $.fn.owlcarousel){ $('.trade-style-js.owl-carousel').owlcarousel({ items:1, itemsdesktop:false, itemsdesktopsmall:false, itemstablet:false, navigation: true, navigationtext: false, pagination: false, slidespeed: 500 }); }; } //########### 人力资源-九牧商学院简介组件 end ##########9 comps.resouceactivtylist1 = function(config){ this.compid = config.compid; this.config = config; } //异步情况下渲染数据 comps.resouceactivtylist1.prototype.init=function(){ var querydata; var ts = this; var needasyncinit = ts.config.needasyncinit; var contentcategoryuuid = ts.config.contentcategoryuuid; if(needasyncinit){ ts.ajaxloaddata(querydata,ts.config.pageshow); }else{ ts.bindevent(); utils.ajaxloadcomplate(ts); } } //ajax请求数据 comps.resouceactivtylist1.prototype.ajaxloaddata =function(querydata,nowpage,showpage){ var ts = this; var contentcategoryuuid = ts.config.contentcategoryuuid; var defaultdata = { "contentcategoryuuid":contentcategoryuuid,"nowpage":nowpage,"showpage":showpage } $.extend(defaultdata,querydata); $.ajax({ "url":contextpath+"/resouceactivtylist/ajaxloaddata.json", data: defaultdata, "success":function(data){ ts._renderprodcutlist(data); utils.ajaxloadcomplate(ts); } }) } //渲染产品保养列表 comps.resouceactivtylist1.prototype._renderprodcutlist = function(data){ var compid = this.config.compid; var productsele = $("#"+compid+"_main"); var productloopele = $("#"+compid+"_list"); productsele.find(".j_pdtain_list").remove(); var productlist = data; //循环渲染产品保养信息 if(productlist.length>0){ //noresultele.remove(); for(var i=0;i