$(document).ready(function() { var id = GetQueryString("orgId"); var oComDescp,oComIndustry,oComSubject,oComQualification,oComUser; loginStatus();//判断个人是否登录 $(document).scroll(function(){ var top3 = $(window).height(); var top5 = $(".content-left").height(); var top4 = $("#container").height(); var top1 = $(document).scrollTop(); var top2 = $("#container").height() - top3 + (top3 - 80 - top5) - 10; //变成绝对定位 if(top1 >= 300) { $(".content-left").css({ "position": "fixed", "top": "80px" }); if(top1 >= top2) { $('.information-content').css("position", "static"); $(".content-left").css("position", "absolute"); $(".content-left").css("top", top4 - top5 - 10 + "px"); } else { $('.information-content').css("position", "relative"); $(".content-left").css({ "position": "fixed", "top": "80px" }); } } else { $(".content-left").css({ "position": "static" }); } }) /*企业信息*/ function companyInformation() { $.ajax({ url: "/ajax/org/" + id, type: "GET", timeout: 10000, dataType: "json", beforeSend: function() {}, success: function(data, textState) { if(data.success) { var $data = data.data; var companytitle = $data.name + "-科袖网"; window.setTimeout(function() { document.title = companytitle; }, 500); $("#comName").text($data.name); if($data.authStatus == 3) { $("#authS").addClass("authicon-com-ok").attr("title", "认证企业"); } /*else { $("#authS").addClass("authicon-com-no").attr("title", "未认证企业"); }*/ if($data.hasOrgLogo) { $("#oimg").attr("src", "/images/org/" + $data.id + ".jpg"); } else { $("#oimg").attr("src", "images/default-icon.jpg"); } if($data.orgUrl) { $("#inteAddress").text($data.orgUrl); } else { $("#inteAddress").text(""); } if($data.foundTime) { var oTime = timeGeshi($data.foundTime); $("#createTime").text(oTime); } else { $("#createTime").remove(); } if($data.city) { $("#ocity").text($data.city); } if($data.descp) { $(".editbox").text($data.descp); } else { oComDescp=0; $("span:contains('企业简介')").parents(".introduction").hide(); $("a:contains('企业简介')").hide(); } if($data.orgSize) { switch($data.orgSize) { case '1': $("#qualificationList").text("50人以内") break; case '2': $("#qualificationList").text("50-100人") break; case '3': $("#qualificationList").text("100-200人") break; case '4': $("#qualificationList").text("200-500人") break; case '5': $("#qualificationList").text("500-1000人") break; case '6': $("#qualificationList").text("1000人以上") break; default: break; } } else { $("#qualificationList").remove(); } if($data.orgType) { switch($data.orgType) { case '2': $("#orgType").text("国有企业"); break; case '3': $("#orgType").text("上市企业"); break; case '4': $("#orgType").text("合资企业"); break; case '5': $("#orgType").text("私人企业"); break; case '6': $("#orgType").text("外资企业"); break; case '7': $("#orgType").text("初创企业"); break; default: break; } }else{ $("#orgType").remove(); } if($data.industry) { indu($data.industry, '#industryShow') } else { oComIndustry=0; $("span:contains('所属行业')").parents(".introduction").hide(); $("a:contains('所属行业')").hide(); } if($data.subject) { indu($data.subject, '#subjectShow') } else { oComSubject=0; $("span:contains('专注领域')").parents(".introduction").hide(); $("a:contains('专注领域')").hide(); } if($data.qualification) { indu($data.qualification, '#qiye ') } else { oComQualification=0; $("span:contains('企业资质')").parents(".introduction").hide(); $("a:contains('企业资质')").hide(); } } }, error: function(XMLHttpRequest, textStats, errorThrown) { $.MsgBox.Alert('提示', '服务器请求失败') } }) } /*时间格式转换*/ function timeGeshi(otm) { var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8); return otme; } /*应用行业及领域及企业纸质*/ function indu(oString, oSelector) { var arr = oString.split(","); var oArr = new Array(); var i; for(i in arr) { if(oSelector == "#subjectShow") { oArr.push('
' + arr[i] + '
'); } else { oArr.push('
  • ' + arr[i] + '
  • '); } } $(oSelector).html(oArr.join("")); } /*获取所有的企业用户*/ function companyUser() { $.ajax({ url: "/ajax/professor/qaOrgAuth", type: "GET", timeout: 10000, dataType: "json", data: { "orgId": id, orgAuth:1 }, beforeSend: function() {}, success: function(data, textState) { if(data.success) { var $info = data.data; if($info.length==0){ $("span:contains('企业用户')").parents(".introduction").hide(); $("a:contains('企业用户')").hide(); oComUser=0; if(oComDescp==0&&oComIndustry==0&&oComSubject==0&&oComQualification==0&&oComUser==0){ $("div:contains('企业信息')").parents(".content-left").hide(); } } userHtml($info); } }, error: function(XMLHttpRequest, textStats, errorThrown) { $.MsgBox.Alert('提示', '服务器请求失败') } }) } /*填充企业下用户*/ function userHtml(arr) { for(var i = 0; i < arr.length; i++) { var tiof = "", img; if(arr[i].hasHeadImage) { img = "/images/head/" + arr[i].id + "_l.jpg"; } else { img = "images/default-photo.jpg" } if(arr[i].title) { if(arr[i].office) { tiof = arr[i].title + " ," + arr[i].office; } else { tiof = arr[i].title; } } else { if(arr[i].office) { tiof = arr[i].office; } } var oString = '
    ' oString += '
    ' oString += '' oString += '
    ' + arr[i].name + '
    ' oString += '
    ' + tiof + '
    ' $("#userList").append(oString); } } companyInformation(); companyUser(); /*企业文章*/ $.ajax({ url: "/ajax/article/qaOrg", dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 data: { "orgId": id }, timeout: 10000, //超时设置 success: function(data) { if(data.success) { if(data.data.length==0){ $("span:contains('科研文章')").parents(".introduction").hide(); } for(var i = 0; i < data.data.length; i++) { var add = '
  • ' add += '
    ' add += '
    ' + data.data[i].articleTitle + '
    ' add += '
    ' add += '
  • '; $add = $(add); $("#reachArticle").append($add); $add.find('.tagsBox span').text(data.data[i].industry); //data.data[i].subject if(data.data[i].articleImg) { $add.find(".art_img").attr("style", "background: url(/data/article/" + data.data[i].articleImg + ") center center no-repeat;background-size:cover;"); } } //资源轮播 var $content2 = $(".sharescrollbox.Acrollbox"); var childcount2 = $content2.find(".otherRes.shareshow li").length; Carousel(3, 3, 3, childcount2, $content2, $(".articalbtn.resounext"), $(".articalbtn.resouprev")); } }, error: function() { return; } }); /*点击企业员工头像跳转个人浏览页面*/ $("#userList").on("click","img",function(){ var dataId=$(this).attr("data-id"); console.log(dataId) location.href="information-brow.html?professorId="+dataId; }) })