var entType = "企业"; var relation = null; var serviceList = null; //解析服务列表 $(function(){ //右侧最新消息 $.post("/front/webcontent/getLatestNews",null,function(r){ var html = '
'); }); //主要人员 if(typeof(staffinfo) != "undefined" && staffinfo != null && staffinfo.length > 0){ var staffinfos1 = [],staffinfos2 = [],staffinfos3 = [],staffinfos4 = []; for(var i=0;i'; if(verticalFlag){ hm+=''; } } verticalFlag = true; hm+='
' +''+obj[i].Name+''+obj[i].PositionName+'
'; //竖线 if(tmp == maxCout){ hm+=''; } //横线 if(i != obj.length-1){ if(tmp <= maxCout-1){ hm+=''; }else{ tmp = 0; } } if(i==obj.length-1){ hm+=''; } } } appendStaffinfo(staffinfos1,1); appendStaffinfo(staffinfos2,2); appendStaffinfo(staffinfos3,3); appendStaffinfo(staffinfos4,4); hm+=''; $(".ent-mainperson").html(hm); }else{ $(".ent-mainperson .ent-findnull").removeClass("hide"); } //联系地址 if($address){ loadJS("/js/jquery.cxselect.js",function(){ $('#city_china').cxSelect({ selects: ['province', 'city', 'area'], required:0 }); $.cxSelect.setVal(province,city,area); var pt=province?($("#provincesel option[value="+province+"]").text()):""; var ct=city?($("#citysel option[value="+city+"]").text()):""; var at=area?($("#areasel option[value="+area+"]").text()):""; //设置地图上显示的位置 $("#location").attr("value",as1); $("#cityname").attr("value",pt.trim()+ct.trim()+at.trim()); initMap(); $("#city_china").text(pt+ct+at+as1); }); } //隐藏地图 $("#fade").click(closeMap); //分享 $(".entinfo-share").click(function(){ $(".bdsharebuttonbox").show(); }); //切换 $(".ent-tab>li").click(function(){ $(".ent-tab>li").removeClass("ent-active"); $(this).addClass("ent-active"); $(".ent-tab-content>div").addClass("hide"); $(".ent-tab-content>div:eq("+$(this).index()+")").removeClass("hide"); if($(this).index() == 1){ b_afterLogin(); }else if($(this).index() == 5 && serviceList == null){ //加载服务列表 serviceList = new ServiceList(); } }); pcShare(); }); function initMap(){ //获取地图的经纬度 loadJS("http://api.map.baidu.com/getscript?v=2&ak=AFd8b176f363f23e6a23d516f4cfb742&services=&t=20150522093217",function(){ loadJS("/js/geocoder.js",function(){ doOptions(); }); }); } //显示地图 function showMap(){ document.getElementById('mapshowdiv').style.display = 'block'; document.getElementById('closeshowmap').style.display = 'block'; document.getElementById('fade').style.display = 'block'; $("html,body").addClass("overflow-hidden"); } //关闭地图 function closeMap(){ document.getElementById('mapshowdiv').style.display = 'none'; document.getElementById('closeshowmap').style.display = 'none'; document.getElementById('fade').style.display = 'none'; $("html,body").removeClass("overflow-hidden"); } function b_afterLogin(flag){ if($(".ent-tab>li:eq(1)").hasClass("ent-active") && relation == null){ initRelation(); } } //加载关系网 function initRelation(){ if(isLogined){ $(".entrelation").height(500); var relationNoData = function(){ $("#entrelation-limit,#entrelation-nologin").addClass("hide"); relation = ""; $("#entrelation-infovis").hide(); $("#entrelation-findnull").removeClass("hide"); $(".entrelation").css("height","auto"); } $.ajax({ url: "/member/getRelation", method: "post", data: {regNo:regNo,entName:entName}, success: function(r){ if(r.flag == false){ $("#entrelation-nologin").addClass("hide"); $("#entrelation-limit,#entrelation-noauthe").removeClass("hide"); $("#entrelation-infovis").hide(); $(".entrelation").css("height","auto"); }else if(r.flag == true && (r == null || typeof(r) == "undefined" || typeof(r.relation.links) == "undefined" || r.relation.links.length == 0 || typeof(r.relation.nodes) == "undefined" || r.relation.nodes.length <= 1)){ relationNoData(); }else if(r.flag == true){ $("#entrelation-limit,#entrelation-nologin").addClass("hide"); loadJS("/js/d3.v3.min.js",function(){ loadJS("/js/geometry.js",function(){ loadJS("/js/relation.js",function(){ relation = new Relation(legcerNo,regNo,r.relation); relation.init(); }); }); }); }else{ relationNoData(); } }, error: function(){ relationNoData(); } }); }else{ $("#entrelation-limit,#entrelation-nologin").removeClass("hide"); } } //服务列表 function ServiceList(){ loadJS("/js/paging.js",function(){ paging = new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},6,function(r){ if((typeof(synopsis) == "undefined" || synopsis == null || synopsis == "") && r.length == 0){ $(".ent-yellowpage .ent-findnull").removeClass("hide"); $(".ent-yellowpage .ent-layout-down").remove(); return; } $(".serviceList-layout").removeClass("hide"); var html = ''; for(var i=0;i-1; html += '' +'' +''; if(flag){ html += ''; } html += r[i].s_name; if(flag){ html += ''; } html += ''; if(flag){ html += '报价:'+(r[i].s_pricemy==1?"面议":f_price+"元")+'' +'成交:'+i_sales+'|评价:'+i_comments+''; }else{ html += '  '; } html += '' +'
'+r[i].s_introduction+'
' +''; } $("#serviceListPaging").parent().prevAll().remove(); $("#serviceListPaging").parent().before(html); /*$(".ent-serviceintroduction").each(function(){ console.info($(this).height() +"------"+ $(this).children("div").height()); if($(this).height() < $(this).children("div").height()){ $(this).parent().append("......"); } });*/ }); }); }