123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440 |
- $(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 ='<div class="mb-list mb-listL" style="text-align:left"><p class="msg-tit">请先确认您的所在机构:<small>(建议填写正式全称)</small></p>'+
- '<div style="height:56px;"><input type="text" class="form-control sureOrg" placeholder="如:北京科袖科技有限公司" /><p class="msg-warning">50字以内</p></div>'+
- '<div class="msg-tip"><p>注:</p><p>1. 只能发布您所在机构的需求。</p><p>2. 当您在资料中变更了所在机构后,该需求将会自动关闭。</p></div></div>';
- $(".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()
- var thisTabcon=$(".con-ultab>li:first-child").text();
- $(".con-ultab>li").eq(0).addClass("liNow");
- proShow(thisTabcon)
-
- $(".con-ultab").on("click","li",function(){
- thisTabcon=$(this).text();
- $(".con-ultab>li").eq($(this).index()).addClass("liNow").siblings().removeClass("liNow")
- proShow(thisTabcon);
- })
- $(".con-ulList").on("mouseenter","li",function(){
- $(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=$("<li></li>").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] + "<span style='margin-right:16px;'></span>";
- }
- var strCon='';
- strCon += '<a target="_blank" href="cmpInforShow.html?orgId='+$info[i].id+'">'
- strCon += '<div class="madiaHead">'
- strCon += '<div class="boxBlock"><img class="boxBlockimg" src="'+imgurl+'"></div></div>'
- strCon += '<div class="madiaInfo">'
- strCon += '<div class="h1Font clearfix">'
- strCon += '<span class="qiyego ellipsisSty">'+cmpname+'</span>'
- strCon += '<span class="authiconNew '+oSty.sty+'" title="'+oSty.tit+'"></span>'
- strCon += '</div>'
- strCon += '<div class="h3Font ellipsisSty">'
- strCon += '<span>'+orgType+orgOther+'</span>'
- strCon += '</div>'
- strCon += '</div></a>'
- 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=$("<li></li>").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 += '<a target="_blank" class="madiaOuter" href="resourceShow.html?resourceId='+$info[i].resourceId+'" style="background-image:url('+imgurl+');">'
- strCon += '<div class="madiaInfo madiaInner">'
- strCon += '<div class="h1Font ellipsisSty-2">'+$info[i].resourceName+'</div>'
- strCon += '<div class="h3Font clearfix">'
- strCon += '<span class="qiyego ellipsisSty">'+cmpname+'</span>'
- strCon += '<span class="authiconNew '+oSty.sty+'" title="'+oSty.tit+'"></span>'
- strCon += '</div>'
- strCon += '</div></a>'
- 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;
-
- $("#proShow").html("");
- for(var i = 0; i < $info.length; i++) {
- var liStr=$("<li class='flexCenter'></li>").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 += '<a target="_blank" href="userInforShow.html?professorId='+$info[i].id+'">'
- strCon += '<div class="madiaHead" style="background-image:url('+imgurl+')"></div>'
- strCon += '<div class="madiaInfo">'
- strCon += '<div class="h1Font clearfix">'
- strCon += '<span class="qiyego ellipsisSty">'+cmpname+'</span>'
- strCon += '<span class="authiconNew '+oSty.sty+'" title="'+oSty.tit+'"></span>'
- strCon += '</div>'
- strCon += '<div class="h3Font ellipsisSty" style="margin-top:0;">'+oTitle+'</div>'
- strCon += '<div class="h3Font ellipsisSty-2">'+oResult+'</div>'
- strCon += '</div></a>'
- 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;
-
- for(var i = 0; i < $info.length; i++) {
- var liStr=$("<li>"+$info[i].caption+"</li>").appendTo("#hotArea");
- }
- }
- },
- error: function() {
- }
- })
- }
-
-
- 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=$('<div class="item"></div>').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 += '<a target="_blank" class="aitemLink" href="/'+ pageUrl('a',$info[i])+'" style="background-image: url('+ imgurl+')" alt="'+$info[i].articleTitle+'">'
- strCon += '<div class="carousel-caption">'
- strCon += '<div class="homeinfo">'
- strCon += '<p class="h1Font ellipsisSty-2">'+ $info[i].articleTitle+'</p>'
- strCon += '</div>'
- strCon += '</div></a>'
- liStr.html(strCon);
- }
- }
- },
- 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('提示', '链接服务器超时')
- }
- });
- }
-
- 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;
- }
- }
- }
- }
- });
- }
-
- })
|