123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- $(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", "认证企业");
- }
-
- $("#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('<div class="acad">' + arr[i] + '</div>');
- } else {
- oArr.push('<li>' + arr[i] + '</li>');
- }
- }
- $(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 = '<dd>'
- oString += '<div class="staffChild">'
- oString += '<img class="userRadius" src="' + img + '" width="100%" data-id="'+arr[i].id+'" style="cursor:pointer"/>'
- oString += '</div><div class="h4Font"><span>' + arr[i].name + '</span></div>'
- oString += '<div class="h4Font">' + tiof + '</div></dd>'
- $("#userList").append(oString);
- }
- }
- companyInformation();
- companyUser();
-
- $.ajax({
- url: "/ajax/article/qaOrgPublish",
- dataType: 'json',
- type: 'GET',
- 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 = '<li><a href="articalShow.html?articleId=' + data.data[i].articleId +'" style="display:block;">'
- add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
- add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
- add += '</div><div class="tagsBox"><span></span></div>'
- add += '</a></li>';
- $add = $(add);
- $("#reachArticle").append($add);
- $add.find('.tagsBox span').text(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;
- })
- })
|