/*我的关注列表*/ $(function() { var userid = $.cookie("userid"); expertAttention(); followResources(); $("#fixbtn li").on("click",function(){ var indexLi=$(this).index(); $("#fixbtn li").removeClass("liactive"); $(".attentsCon .attentList").hide(); $("#fixbtn li").eq(indexLi).addClass("liactive"); $(".attentsCon .attentList").eq(indexLi).show(); }); $("#lookMyAttention").click(function(){ $("body").css("position","fixed"); $("#attentCover").fadeIn(); }) //关闭按钮 $("#workclose").click(function(){ $("#attentCover").fadeOut(); $("body").css("position",""); }); /*关注专家*/ function expertAttention() { var data = { "professorId": userid, "watchType": 1, "pageNo": 1, "pageSize": 1000 } $.ajax({ url: "/ajax/watch/qaPro", data: data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 success: function(data) { $("#expert").html(""); if(data.success && data.data.data != "") { var datalist = data.data.data; datalistEach(datalist); } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } /*关注资源*/ function followResources() { var data = { "professorId": userid, "watchType": 2, "pageNo": 1, "pageSize": 1000 } $.ajax({ url: "/ajax/watch/qaPro", data: data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 success: function(data) { console.log(data); $("#resources").html(""); if(data.success && data.data.data != "") { var datalistd = data.data.data; ResourcesEach(datalistd); } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } /*专家数据遍历*/ function datalistEach(datalist) { $.each(datalist, function(index, item) { /*获取头像*/ //console.log(JSON.stringify(item)); if(item.professor.hasHeadImage == 1) { var img = "/images/head/" + item.professor.id + "_l.jpg"; } else { var img = "../images/default-photo.jpg"; } /*获取研究方向信息*/ var researchAreas = item.professor.researchAreas; //console.log(JSON.stringify(item.professor.researchAreas)) var rlist = ''; for(var n = 0; n < researchAreas.length; n++) { //console.log(researchAreas[n].caption); rlist += '' + researchAreas[n].caption if(n < researchAreas.length - 1) { rlist += " , " } rlist += ''; } var arr = []; arr[0] = item.professor.title || item.professor.office; arr[1] = item.professor.orgName || ""; if(arr[0]) { if(arr[1]) { arr[2] = arr[0] + "," + arr[1] } else { arr[2] = arr[0]; } } else { if(arr[1]) { arr[2] = arr[1]; }else{ arr[2] = ""; } } var li = document.createElement('li'); li.innerHTML = '' + '' + '' + '' + item.professor.name + '' + ''+arr[2]+'' + '' + rlist + '' + ''; $("#expert").append(li); }); } /*资源数据遍历*/ function ResourcesEach(datalistd) { $.each(datalistd, function(index, item) { var oName; /*获取头像*/ if(item.resource.images.length) { var img ='/data/resource/' + item.resource.images[0].imageSrc } else { var img = "../images/default-resource.jpg"; } if(item.resource.editProfessor) { var stl = autho(item.resource.editProfessor.authType,item.resource.editProfessor.orgAuth, item.resource.editProfessor.authStatus); oName=item.resource.editProfessor.name; }else { var stl={}; stl.sty=""; stl.title=""; if(item.resource.organization.authStatus==3) { stl.sty="authicon-com-ok"; stl.title="认证企业"; } oName=item.resource.organization.name; } var li = document.createElement('li'); li.innerHTML = '' + '' + '' + '' + item.resource.resourceName + '' + '用途:' + item.resource.supportedServices + '' + '' +oName+ '' + //'' + title + '' + office + '' + orgName + '' + address + '' + ''; $("#resources").append(li); }); } /*文章列表*/ function article() { var data = { "professorId": userid, "watchType": 3, "pageNo": 1, "pageSize": 1000 } $.ajax({ url: "/ajax/watch/qaPro", data: data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 success: function(data) { if(data.success && data.data.data != "") { console.log(data) var $info=data.data.data; for(var i = 0; i < $info.length; i++) { var img='../images/default-artical.jpg'; var oName,oString,ohref; if($info[i].article.articleImg) { img="/data/article/"+$info[i].article.articleImg; } if($info[i].article.articleType==1){ oName=$info[i].article.professor.name; oString=''; ohref="articalShow.html?articleId="+$info[i].article.articleId; }else{ oName=$info[i].article.organization.name; ohref="articalShow.html?articleId="+$info[i].article.articleId; if($info[i].article.organization.authStatus==3){ oString=''; } } var li = document.createElement('li'); li.innerHTML = '' + '' + '' + '' + $info[i].article.articleTitle + '' + '' + oName+oString+'' + ''; $("#article").append(li); } } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } article(); /*关注专利信息*/ function patent() { var data = { "professorId": userid, "watchType": 4, "pageNo": 1, "pageSize": 1000 } $.ajax({ url: "/ajax/watch/qaPro", data: data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 success: function(data) { console.log(data); if(data.success && data.data.data != "") { var arr=[]; for(var i in data.data.data) { arr[i]=data.data.data[i].watchObject; } $.ajax({ url: "/ajax/ppatent/qm", data: { id:arr, }, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 traditional: true, success: function(data) { console.log(data); if(data.success && data.data != "") { var $data=data.data; for(var i=0;i<$data.length;i++) { var li = document.createElement('li'); li.innerHTML = '' + '' + '' + ''+$data[i].name+'' + ''+$data[i].authors.substring(0,$data[i].authors.length-1)+'' + ''+$data[i].reqPerson+'' + ''; $("#patent").append(li) } } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } patent(); /*关注论文信息*/ function paper() { var data = { "professorId": userid, "watchType": 5, "pageNo": 1, "pageSize": 1000 } $.ajax({ url: "/ajax/watch/qaPro", data: data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 success: function(data) { console.log(data); if(data.success && data.data.data != "") { var arr=[]; for(var i in data.data.data) { arr[i]=data.data.data[i].watchObject; } $.ajax({ url: "/ajax/ppaper/qm", data: { id:arr, }, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 traditional: true, success: function(data) { console.log(data); if(data.success && data.data != "") { var $data=data.data; for(var i=0;i<$data.length;i++) { var li = document.createElement('li'); li.innerHTML = '' + '' + '' + ''+$data[i].name+'' + ''+$data[i].authors.substring(0,$data[i].authors.length-1)+'' + ''+$data[i].pubDay+'' + ''; $("#paper").append(li) } } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } paper(); /*关注企业信息*/ function company() { var data = { "professorId": userid, "watchType": 6, "pageNo": 1, "pageSize": 1000 } $.ajax({ url: "/ajax/watch/qaPro", data: data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 success: function(data) { console.log(data); if(data.success && data.data.data != "") { var arr=[]; for(var i in data.data.data) { arr[i]=data.data.data[i].watchObject; } $.ajax({ url: "/ajax/org/qm", data: { id:arr, }, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 traditional: true, success: function(data) { console.log(data); if(data.success && data.data != "") { var $data=data.data; console.log($data); for(var i=0;i<$data.length;i++) { var li = document.createElement('li'); li.innerHTML = '' + '' + '' + ''+$data[i].name+''+ '' + '' + ''; var $itemlist=$(li); $("#company").append($itemlist); $itemlist.find("a").attr("href", "cmpInforShow.html?orgId=" + $data[i].id ); if($data[i].hasOrgLogo) { $itemlist.find("#proHead").attr("src", "/images/org/" + $data[i].id + ".jpg" ); }else{ $itemlist.find("#proHead").attr("src", "/images/default-icon.jpg" ); } if($data[i].authStatus == 3) { $itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "科袖认证企业");; } console.log($data[i]) var orgOther = ""; if($data[i].industry) { orgOther = $data[i].industry.replace(/,/gi, " | "); } $itemlist.find("#orgOther").text(orgOther); if($data[i].orgType == "2") { $itemlist.find("#orgTit").html(orgTypeShow[$data[i].orgType] + ""); } } } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } company(); function demands() { var data = { "professorId": userid, "watchType":7, "pageNo": 1, "pageSize": 1000 } $.ajax({ url: "/ajax/watch/qaPro", data: data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 success: function(data) { console.log(data); if(data.success && data.data.data != "") { var arr=[]; for(var i in data.data.data) { arr[i]=data.data.data[i].watchObject; } $.ajax({ url: "/ajax/demand/qm", data: { id:arr, }, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 traditional: true, success: function(data) { console.log(data); if(data.success && data.data != "") { var $data=data.data; console.log($data); for(var i=0;i<$data.length;i++) { var li = document.createElement('li'); var strCon='' strCon+='' strCon+='' strCon+=''+$data[i].title+'' strCon+='' if($data[i].city){ strCon+='所在城市:'+$data[i].city+'' } if($data[i].duration!=0){ strCon+='预期时长:'+demandDuration[$data[i].duration]+'' } if($data[i].cost!=0){ strCon+='费用预算:'+demandCost[$data[i].cost]+'' } if($data[i].invalidDay){ strCon+='有效期至:'+TimeTr($data[i].invalidDay)+'' } strCon+='' strCon+=''; li.innerHTML = strCon var $itemlist=$(li); $("#demands").append($itemlist); } } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } }, error: function() { $.MsgBox.Alert('提示', "服务器链接超时"); } }); } demands(); })
' + item.professor.name + '
'+arr[2]+'
' + rlist + '
用途:' + item.resource.supportedServices + '
' + title + '' + office + '' + orgName + '' + address + '
'+$data[i].reqPerson+'
'+$data[i].pubDay+'
'+$data[i].name+'
'+$data[i].title+'