$(function(){ if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){ location.href="http://" + window.location.host + "/e/index.html"; } $(".headnav li").eq(0).addClass("navcurrent"); loginStatus();//判断个人是否登录 var userid = $.cookie('userid'); //加载页面时,判断企业账号是否登录 var orgid = $.cookie('orgId'); $("#cmpSettled").on("click",function(){ if (orgid && orgid != "null" && orgid != null) { location.href="cmp-portal/cmp-needList.html" }else{ location.href="cmp-portal/cmp-settled-reg.html" } }) $("#gocmp").on("click",function(){ if (orgid && orgid != "null" && orgid != null) { location.href="cmp-portal/cmp-needList.html" }else{ location.href="cmp-portal/cmp-settled-log.html" } }) var sureOrg ='

请先确认您的所在机构:(建议填写正式全称)

'+ '

50字以内

'+ '

注:

1. 只能发布您所在机构的需求。

2. 当您在资料中变更了所在机构后,该需求将会自动关闭。

'; $(".setTimeBlock").on("focus",".sureOrg",function(){ $(".msg-warning").show(); }).on("blur",".sureOrg",function(){ $(".msg-warning").hide(); }).on("keyup",".sureOrg",function(){ if($(this).val().length>0){ $(".setTimeBlock").find(".mb_btnOkpub").removeAttr("disabled"); }else{ $(".setTimeBlock").find(".mb_btnOkpub").attr("disabled",true) } }) /*发布需求*/ $("#postNow").click(function(){ if(userid=="null"||userid==undefined){ location.href="login.html"; return; } window.open("postDemand.html"); }) /*我是专家*/ $("#JoinKeXiu").click(function(){ if(userid=="null"||userid==undefined){ location.href="login.html"; } location.href="expert-authentication.html" }) mouseIn() ruZhuCmp() resShare() hotArea() // carouselThis() var thisTabcon=$("#hotArea>li:first-child").text(); var thisTabcon2=$("#hotArea2>li:first-child").text(); $("#hotArea>li").eq(0).addClass("liNow"); $("#hotArea2>li").eq(0).addClass("liNow"); proShow(thisTabcon) teamShow(thisTabcon2) $("#hotArea").on("click","li",function(){ thisTabcon=$(this).text(); $("#hotArea>li").eq($(this).index()).addClass("liNow").siblings().removeClass("liNow") proShow(thisTabcon); }) $("#hotArea2").on("click","li",function(){ thisTabcon2=$(this).text(); $("#hotArea2>li").eq($(this).index()).addClass("liNow").siblings().removeClass("liNow") teamShow(thisTabcon2); }) // $(".con-ulList").on("mouseenter","li",function(){kz // $(this).find(".boxBlockimg").css("transform", "scale(1.1)"); // }).on("mouseleave","li",function(){ // $(this).find(".boxBlockimg").css("transform", "scale(1)"); // }) function ruZhuCmp(){//入驻企业 $.ajax({ url: "/ajax/org/index/search", type: "GET", timeout: 10000, dataType: "json", data:{ "rows": 6 }, success: function(data) { if(data.success) { var $info = data.data; for(var i = 0; i < $info.length; i++) { var liStr=$("
  • ").appendTo("#ruZhuCmp"); var cmpname,imgurl='../images/default-icon.jpg' if($info[i].hasOrgLogo) { imgurl='/images/org/' + $info[i].id + '.jpg'; } if($info[i].forShort){ cmpname = $info[i].forShort; }else{ cmpname = $info[i].name; } var oSty={sty:"",tit:""}; if($info[i].authStatus == 3) { oSty.sty="authicon-com-ok" oSty.tit="科袖认证企业" } var orgOther = "",orgType=""; if($info[i].industry) { orgOther = $info[i].industry.replace(/,/gi, " | "); } if($info[i].orgType == "2") { orgType = orgTypeShow[$info[i].orgType] + ""; } var strCon=''; strCon += '' strCon += '
    ' strCon += '
    ' strCon += '
    ' strCon += '
    ' strCon += ''+cmpname+'' strCon += '' strCon += '
    ' strCon += '
    ' strCon += ''+orgType+orgOther+'' strCon += '
    ' strCon += '
    ' liStr.html(strCon); } } }, error: function() { } }) } function resShare(){//资源共享 $.ajax({ url: "/ajax/resource/index/search", type: "GET", timeout: 10000, dataType: "json", data:{ "rows":8 }, success: function(data) { if(data.success) { var $info = data.data; for(var i = 0; i < $info.length; i++) { var liStr=$("
  • ").appendTo("#resShare"); var cmpname,imgurl='../images/default-resource.jpg' var oSty={sty:"",tit:""}; if($info[i].images.length > 0) { imgurl='/data/resource/' + $info[i].images[0].imageSrc } if($info[i].resourceType == 1) { //个人资源 cmpname = $info[i].editProfessor.name; oSty = autho($info[i].editProfessor.authType, $info[i].editProfessor.orgAuth, $info[i].editProfessor.authStatus); } else if($info[i].resourceType == 2) { //企业资源 if($info[i].organization.forShort) { cmpname = $info[i].organization.forShort; }else{ cmpname = $info[i].organization.name; } if($info[i].organization.authStatus==3){ oSty.sty="authicon-com-ok" oSty.tit="科袖认证企业" } } var strCon=''; strCon += '' // strCon += '
    ' strCon += '
    ' strCon += '
    '+$info[i].resourceName+'
    ' strCon += '
    ' strCon += ''+cmpname+'' strCon += '' strCon += '
    ' strCon += '
    ' liStr.html(strCon); } $(".madiaOuter").each(function(i){ $(this).showOn($(".madiaInner").eq(i)); }); } }, error: function() { } }) } function proShow(thiscon){//专家 $.ajax({ url: "/ajax/professor/index/search", type: "GET", timeout: 10000, dataType: "json", async:false, data:{ "subject":thiscon, "rows": 6 }, success: function(data) { if(data.success) { var $info = data.data; //console.log(data) $("#proShow").html(""); for(var i = 0; i < $info.length; i++) { var liStr=$("
  • ").appendTo("#proShow"); var cmpname,imgurl='../images/default-photo.jpg' var oSty=autho($info[i].authType, $info[i].orgAuth, $info[i].authStatus); cmpname = $info[i].name; if($info[i].hasHeadImage) { imgurl='/images/head/' + $info[i].id + '_l.jpg'; } var oTitle=''; if($info[i].title) { oTitle = $info[i].title; if($info[i].orgName){ oTitle = $info[i].title +','+ $info[i].orgName; } } else { if($info[i].office) { oTitle = $info[i].office; if($info[i].orgName){ oTitle = $info[i].office +','+ $info[i].orgName; } } } var oResult="" if($info[i].researchAreas.length > 0){ oResult = '研究方向:'; for(var n = 0; n < $info[i].researchAreas.length; n++) { oResult += $info[i].researchAreas[n].caption if(n < $info[i].researchAreas.length - 1) { oResult += ";" } } } var strCon=''; strCon += '' strCon += '
    ' strCon += '
    ' strCon += '
    ' strCon += ''+cmpname+'' strCon += '' strCon += '
    ' strCon += '
    '+oTitle+'
    ' strCon += '
    '+oResult+'
    ' strCon += '
    ' liStr.html(strCon); } } }, error: function() { } }) } function teamShow(thiscon){ $.ajax({ url: "/ajax/team/pq", type: "GET", timeout: 10000, dataType: "json", async:false, data:{ "subject":thiscon, "status": 3, "pageSize": 6, "pageNo": 1 }, success: function(data) { if(data.success) { var $info = data.data.data; //console.log(data) $("#teamShow").html(""); for(var i = 0; i < $info.length; i++) { var liStr=$("
  • ").appendTo("#teamShow"); var strCon=''; strCon += '' strCon += '
    ' strCon += '
    ' strCon += ''+$info[i].name+'' strCon += '
    ' strCon += '
    '+$info[i].orgName+' '+ $info[i].city +'
    ' strCon += '
    学术领域:'+$info[i].subject+'
    ' strCon += '
    ' liStr.html(strCon); } } }, error: function() { } }) } function hotArea(){//领域名称 $.ajax({ url: "/ajax/dataDict/qaDictCode", type: "GET", timeout: 10000, async:false, dataType: "json", data: { "dictCode":"SUBJECT", }, success: function(data) { if(data.success) { var $info = data.data; //console.log(data) for(var i = 0; i < $info.length; i++) { $("
  • "+$info[i].caption+"
  • ").appendTo("#hotArea"); $("
  • "+$info[i].caption+"
  • ").appendTo("#hotArea2"); } } }, error: function() { } }) } //kexiu carousel function carouselThis(){ $.ajax({ url: "/ajax/article/find", type: "GET", timeout: 10000, dataType: "json", data:{ "col": 7, "pageSize": 3, "pageNo": 1 }, success: function(data) { if(data.success) { $("#carouselThis").html(""); var $info = data.data.data; for(var i = 0; i < $info.length; i++) { var liStr=$('
    ').appendTo("#carouselThis"); if(i==0){ $(".item").addClass("active") } var imgurl="../images/default-artical.jpg"; if($info[i].articleImg) { imgurl ='/data/article/' + $info[i].articleImg ; } if($info[i].articleType==1){ } var strCon=''; strCon += '' strCon += '' liStr.html(strCon); // if($info[i].articleType==1){ // userFun($info[i].professorId, liStr); // }else{ // cmpFun($info[i].orgId, liStr); // } } } }, error: function() { } }) } /*用户信息*/ function userFun(id,$listItem) { $.ajax({ "url": "/ajax/professor/baseInfo/" + id, "type": "get", "async": true, "success": function(data) { if(data.success && data.data) { $listItem.find(".ownerName").text(data.data.name); } }, "error": function() { $.MsgBox.Alert('提示', '链接服务器超时') } }); } /*企业用户信息*/ function cmpFun(id,$listItem) { $.ajax({ "url": "/ajax/org/" + id, "type": "get", "async": true, "success": function(data) { if(data.success && data.data) { if(data.data.forShort) { $listItem.find(".ownerName").text(data.data.forShort); }else{ $listItem.find(".ownerName").text(data.data.name); } } }, "error": function() { $.MsgBox.Alert('提示', '链接服务器超时') } }); } //资源mouseIn效果 function mouseIn(){ $.fn.extend({ showOn : function(div){ var w = this.width(), h = this.height(), xpos = w/2, ypos = h/2, eventType = "", direct = ""; this.css({"overflow" : "hidden", "position" : "relative"}); div.css({"position" : "absolute", "top" : this.width()}); this.on("mouseenter mouseleave", function(e){ var oe = e || event; var x = oe.offsetX; var y = oe.offsetY; var angle = Math.atan((x - xpos)/(y - ypos)) * 180 / Math.PI; if(angle > -45 && angle < 45 && y > ypos){ direct = "down"; } if(angle > -45 && angle < 45 && y < ypos){ direct = "up"; } if(((angle > -90 && angle <-45) || (angle >45 && angle <90)) && x > xpos){ direct = "right"; } if(((angle > -90 && angle <-45) || (angle >45 && angle <90)) && x < xpos){ direct = "left"; } move(e.type, direct) }); function move(eventType, direct){ if(eventType == "mouseenter"){ switch(direct){ case "down": div.css({"left": "0px", "top": h}).stop(true,true).animate({"top": "0px"}, "fast"); break; case "up": div.css({"left": "0px", "top": -h}).stop(true,true).animate({"top": "0px"}, "fast"); break; case "right": div.css({"left": w, "top": "0px"}).stop(true,true).animate({"left": "0px"}, "fast"); break; case "left": div.css({"left": -w, "top": "0px"}).stop(true,true).animate({"left": "0px"}, "fast"); break; } }else{ switch(direct){ case "down": div.stop(true,true).animate({"top": h}, "fast"); break; case "up": div.stop(true,true).animate({"top": -h}, "fast"); break; case "right": div.stop(true,true).animate({"left": w}, "fast"); break; case "left": div.stop(true,true).animate({"left": -w}, "fast"); break; } } } } }); } })