|
$(function() {
loginStatus();//判断个人是否登录
var userid = $.cookie("userid");
var professorId = GetQueryString("professorId");
var oArray=[];
var watchType=1;
if(professorId) {
getUserInfo(professorId);//获取个人详细信息
//historyEvaluate();//获取历史合作及评价
getResource(10,1,true);//获取个人发布的资源
getArticle(10,1,true);//获取个人发布的文章
getPaper(10,1,true);//获取个人发布的论文
getPatent(10,1,true);//获取个人发布的专利
getDemands(5,1,true);//获取个人发布的需求
attentCount();
collAttent(10,1,true);
if(userid!=professorId){
liulanAdd();
relevantExperts();//合作专家
relevantarticalList();//相关文章
likeExperts();//感兴趣专家
information();
ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
$(".goSpan").show();
$(".moreNavUl li.attentType").hide();
$(".moreNavUl li.attendMy").addClass("liNow").text("关注他的人");
$("#item7user>.coninfobox").eq(7).show().siblings().hide();
watchType=0;
attentMy();
}else{
$(".goSpanTo").show();
$(".myoneself").show();
}
$(document).bind("click",function(e){
var target = $(e.target);
if(target.closest(".moreNavUl>li.rightbtn").length == 0){
$(".table-drop").hide();
}
})
$(".navconBox").on("click","li",function(){
$(this).addClass("liNow").siblings().removeClass("liNow");
$(".leftconBox .leftconItem").eq($(".navconBox li").index(this)).show().siblings().hide();
})
$(".navconBox>.mainNavUl").on("click","li:not('.rightbtn')",function(){
$(".moreNav").hide();
})
$(".navconBox>.mainNavUl").on("click","li.rightbtn",function(){
$(".moreNav").show();
})
$(".moreNavUl").on("click","li:not('.rightbtn')",function(){//获取关注对象类型标志
watchType=$(this).attr("data-num");
console.log($(".moreNavUl li:not('.rightbtn')").index(this))
$("#item7user>.coninfobox").eq($(".moreNavUl li:not('.rightbtn')").index(this)).show().siblings().hide();
if(watchType==0){
attentMy()
}else{
collAttent(10,1,true);
}
})
$(".navconBox .moreNav>.moreNavUl").on("click","li.rightbtn",function(){
$(this).find(".table-drop").show();
})
$(".table-drop").on("click","li",function(){
$(".navconBox .moreNav>.moreNavUl>.rightbtn").find("span").html($(this).text());
$(".table-drop").fadeOut(1000);
})
$("#myAttends").on("click",function(){
$(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
$(".navconBox .moreNav").show();
$("#item7user").show().siblings().hide();
$(".moreNavUl li.attentType").eq(0).addClass("liNow").siblings().removeClass("liNow");
$("#item7user>.coninfobox").eq(0).show().siblings().hide();
})
$("#attendmyGo").on("click",function(){
$(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
$(".navconBox .moreNav").show();
$("#item7user").show().siblings().hide();
$(".moreNavUl li.attendMy").addClass("liNow").siblings().removeClass("liNow");
$("#item7user>.coninfobox").eq(7).show().siblings().hide();
watchType=0
attentMy();
})
//点击联系按钮
$("#conbtn").on('click', function(){
if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
location.href="tidings.html?id="+professorId
} else {
quickLog();
operatTab();
closeLog();
}
});
//点击关注按钮
$("#attentBtn").on('click', function() {
if(userid && userid != null && userid != "null") {
if($(this).is('.attenedSpan')){
cancelCollectionAbout(professorId,$(this), 1)
} else {
collectionAbout(professorId,$(this), 1);
}
attentCount();//关注者数量刷新
attentMy();
}else{
quickLog();
operatTab();
closeLog();
}
});
/*研究方向点赞*/
var clFlag = 1;
$("#researchAreaShow").on("click", ".plus", function() {
if(userid && userid != null && userid != "null") {
//点赞变化样式
if(clFlag) {
clFlag = 0;
} else {
return;
}
if($(this).data("isagree") > -1) {
$(this).stop(true, true).animate({
backgroundPositionY: 0
}, 300); //变成未点赞样式
} else {
$(this).stop(true, true).animate({
backgroundPositionY: -26
}, 300); //变成点赞样式
}
$.ajax({
"url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
"type": "POST",
"data": {
"targetId": $(this).data("pid"),
"targetCaption": oArray[$(this).data("caption")],
"opId": userid
},
"contentType": "application/x-www-form-urlencoded",
"success": function(dataStr) {
if(dataStr.success) {
$.get("/ajax/professor/info/" + professorId, function(dataStr) {
if(dataStr.success) {
clFlag = 1;
var $info = dataStr.data;
if($info) {
$("#researchAreaShow").empty("")
if($info.researchAreas) {
researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
}
}
}
})
} else {
$.MsgBox.Alert("提示", dataStr.msg);
}
}
});
} else {
quickLog();
operatTab();
closeLog();
}
})
function information(){
$.ajax({
url: "/ajax/baseUserInfo",
dataType: 'json', //数据格式类型
type: 'GET', //http请求类型
timeout: 10000, //超时设置
data: {
"id": professorId
},
"success": function(data) {
if(data.success){
console.log(data);
if(!data.data.activeTime){
$(".last_meg").removeClass("displayNone");
$(".message_b").on("click",function(){
$(".meg_md5").toggle();
if(data.data.email && data.data.mobilePhone){
$("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号或邮箱 '+data.data.email);
}else if(data.data.mobilePhone && !data.data.email){
$("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号');
}else if(data.data.email && !data.data.mobilePhone){
$("#wayTel").text('邮箱 '+data.data.email);
}
})
}else{
$(".last_meg").addClass("displayNone");
}
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//点击每个研究方向弹出研究方向详情窗口
$("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
var cap = $(this).attr("caption");
$.ajax({
url: "/ajax/researchAreaLog/ql",
dataType: 'json', //数据格式类型
type: 'GET', //http请求类型
timeout: 10000, //超时设置
data: {
"professorId": professorId,
'caption': cap,
"rows": 1000
},
success: function(data) {
console.log(data)
if(data.success) {
$("#areaCon").html("");
var $info = data.data;
$("#subArea").text(cap);
$(".resAreaCover").fadeIn();
$(".resAreaTip").addClass("displayNone")
$(".resAreaCon").show()
if($info.length == 0) {
$(".resAreaCon").hide();
$(".resAreaTip").removeClass("displayNone")
return;
}
for(var i = 0; i < $info.length; i++) {
var liItem = document.createElement("li");
document.getElementById("areaCon").appendChild(liItem);
detailPro($info[i],liItem);
}
$("body").css("position", "fixed");
}
},
error: function() {}
});
});
//关闭按钮
$("#workclose").click(function() {
$(".resAreaCover").fadeOut();
$("body").css("position", "");
});
//点击查看全部资源
$(".coninfobox").on("click","#seeMoreR",function(){
document.body.scrollTop = document.documentElement.scrollTop = 0;
$(".navconBox ul>li").eq(1).addClass("liNow").siblings().removeClass("liNow");
$("#item1user").hide();
$("#item2user").show();
})
//点击查看全部文章
$(".coninfobox").on("click","#seeMoreA",function(){
document.body.scrollTop = document.documentElement.scrollTop = 0;
$(".navconBox ul>li").eq(2).addClass("liNow").siblings().removeClass("liNow");
$("#item1user").hide();
$("#item3user").show();
})
//点击查看全部专利
$(".coninfobox").on("click","#seeMoreP",function(){
document.body.scrollTop = document.documentElement.scrollTop = 0;
$(".navconBox ul>li").eq(3).addClass("liNow").siblings().removeClass("liNow");
$("#item1user").hide();
$("#item4user").show();
})
//点击查看全部论文
$(".coninfobox").on("click","#seeMoreL",function(){
document.body.scrollTop = document.documentElement.scrollTop = 0;
$(".navconBox ul>li").eq(4).addClass("liNow").siblings().removeClass("liNow");
$("#item1user").hide();
$("#item5user").show();
})
}
function attentCount(){
$.ajax({//我关注的
type:"get",
url:"/ajax/watch/countObject",
data: {
id: professorId,
type: 1, //1:专家 2:资源 3:文章
},
async:true,
success:function(data){
if(data.success){
if(data.data){
$("#myFocus").html(data.data)
}else{
$("#myFocus").html("0")
}
}
}
});
$.ajax({//关注我的
type:"get",
url:"/ajax/watch/countProfessor",
data: {
id: professorId,
type: 1,
},
async:true,
success:function(data){
if(data.success){
if(data.data){
$("#focusMe").html(data.data)
}else{
$("#focusMe").html("0")
}
}
}
});
}
function liulanAdd() {
$.ajax({
"url": "/ajax/professor/incPageViews",
"type": "POST",
"dataType": "json",
"async": true,
"data": {
"id": professorId,
},
"success": function(data) {
if(data.success) {
console.log(data);
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//用户详细信息
function getUserInfo(professorId){
$.ajax({
type:"get",
url:"/ajax/professor/info/"+ professorId,
async:true,
success: function(data) {
var $info = data.data;
if(data.success) {
console.log(data)
if($info.hasHeadImage){
$("#proHead").css("background-image","url(/images/head/"+ $info.id +"_l.jpg)");
}
$("#proName").text($info.name);
var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
$("#proAuth").addClass(oStyS.sty); $("#proAuth").attr("title",oStyS.title);
if($info.address){
$("#proAddress").html($info.address + "<span style='margin-right:10px;'></span>");
}
var proOther="";
if($info.orgName){
if($info.department){
if($info.office){
proOther = $info.orgName + "," + $info.department + "," + $info.office
}else{
proOther = $info.orgName + "," + $info.department
}
}else{
if($info.office){
proOther = $info.orgName +"," + $info.office
}else{
proOther = $info.orgName
}
}
}else{
if($info.department){
if($info.office){
proOther = $info.department + "," + $info.office
}else{
proOther = $info.department
}
}else{
if($info.office){
proOther = $info.office
}
}
}
$("#proOther").text(proOther);
var llqtitle=$info.name + "-" + proOther.replace(/,/gi,"-") + "-科袖网";//修改浏览器title信息
if($info.title){
$("#proTit").html($info.title + "<span style='margin-right:10px;'></span>");
llqtitle = $info.name + "-" + $info.title + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
}
document.title = llqtitle;
//主页浏览量
$("#viewNums").text($info.pageViews);
//个人简介
if($info.descp) {
$("#descpS").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
$("#descpS").text($info.descp);
}
//学术领域
if($info.subject) {
$("#subjectShow").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
subjectShow($info.subject);
}
//研究方向
if($info.researchAreas.length) {
$("#researchAreaShow").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
}
//行业领域
if($info.industry) {
$("#industryShow").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
industryShow($info.industry);
}
//教育背景
if($info.edus.length) {
eduBgShow($info.edus);
} else {
$("#eduBgShow").parents(".coninfobox").hide();
}
//兼职
if($info.jobs.length) {
timeJobShow($info.jobs);
} else {
$("#timeJobShow").parents(".coninfobox").hide();
}
//项目
if($info.projects.length) {
projectShow($info.projects)
} else {
$("#projectShow").parents(".coninfobox").hide();
}
//荣誉
if($info.honors.length) {
honorShow($info.honors);
} else {
$("#honorShow").parents(".coninfobox").hide();
}
if($info.honors.length == 0 && $info.projects.length == 0 && $info.jobs.length == 0 && $info.edus.length == 0){
$("#item6user>.nodatabox").show();
$("#item6user>.nodatabox").find(".noContip").text("用户尚未完善详细资料")
}
var weibotitle = $info.name;
var weibourl = window.location.href;
var weibopic ="http://"+window.location.host+"/images/head/"+ $info.id +"_l.jpg";
$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
}
},
error: function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
function subjectShow(data) {
if(data != undefined && data.length != 0) {
var subs = new Array();
if(data.indexOf(',')) {
subs = data.split(',');
} else {
subs[0] = data;
}
if(subs.length > 0) {
for(var i = 0; i < subs.length; i++) {
$("#subjectShow").append("<li>" + subs[i] + "</li>");
};
}
}
}
function researchAreaShow(dataStrs, dataStrrecords) {
if(dataStrs != undefined && dataStrs.length != 0) {
var html = [];
for(var i = 0; i < dataStrs.length; ++i) {
var dataStr = dataStrs[i];
var $photos = [];
//获取头像
if(dataStrrecords.length > 0) {
$photos = getRecords(dataStrrecords, dataStr.caption);
}
var isAgree = -1;
for(var j = 0; j < $photos.length; j++) {
if(userid == $photos[j].id)
isAgree++;
}
oArray[i]=dataStr.caption;
if(professorId != userid) {
if(isAgree) {
var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><span class="plus" data-pid="'+ dataStr.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ dataStr.caption +'">';
} else {
var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><span class="plus" style="background-position-y:-26px" data-pid="'+ dataStr.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ dataStr.caption +'">';
}
} else {
var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><div class="favorCount" caption="'+ dataStr.caption +'">';
}
if($photos.length < 6) {
for(var j = 0; j < $photos.length; ++j) {
if($photos[j].img) {
showDiv += '<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
} else {
showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
}
}
} else {
for(var j = $photos.length - 5; j < $photos.length; ++j) {
if($photos[j].img) {
showDiv +='<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
} else {
showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
}
}
showDiv += '<span class="like-people like-more"></span>';
}
showDiv += "</div></li>";
html.push(showDiv);
}
document.getElementById("researchAreaShow").innerHTML = html.join('');
}
}
function industryShow(data) {
if(data != undefined && data.length != 0) {
var subs = new Array();
if(data.indexOf(',')) {
subs = data.split(',');
} else {
subs[0] = data;
}
if(subs.length > 0) {
for(var i = 0; i < subs.length; i++) {
$("#industryShow").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
};
}
}
}
function projectShow(data) {
if(data.length > 0) {
for(var i = 0; i < data.length; i++) {
if(!data[i].descp) {
data[i].descp = "";
}
var sDate = "";
var eDate = "";
if(data[i].startMonth) {
sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
if(data[i].stopMonth) {
eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
} else {
eDate = " - "+ "至今";
}
}
var projectHtml = '<li>';
projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + sDate + eDate + '</small></div>';
projectHtml += '<div class="h5Font">' + data[i].descp + '</div>';
projectHtml += '</li>';
$("#projectShow").append(projectHtml);
}
}
}
function honorShow(data) {
if(data.length > 0) {
for(var i = 0; i < data.length; i++) {
var timeho="";
if(data[i].year){
timeho = data[i].year+'年';
}else{
data[i].year="";
}
if(!data[i].descp) {
data[i].descp = "";
}
var honorHtml = '<li>';
honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + timeho + '</small></div>';
honorHtml += '<div class="h5Font">' + data[i].descp + '</div>';
honorHtml += '</li>';
$("#honorShow").append(honorHtml);
}
}
}
function timeJobShow(data) {
if(data.length > 0) {
for(var i = 0; i < data.length; i++) {
if(data[i].department) {
var dep = " - " + data[i].department;
} else {
var dep = ""
}
var sDate = "";
var eDate = "";
if(data[i].startMonth) {
sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
if(data[i].stopMonth) {
eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
} else {
eDate = " - "+ "至今";
}
}
var JobHtml = '<li>';
JobHtml += '<div class="h4Font h4tit">' + data[i].company + dep + ' - ' + data[i].title + '<small class="h6Font">' + sDate + eDate + '</small></div>';
JobHtml += '</li>';
$("#timeJobShow").append(JobHtml);
}
}
}
function eduBgShow(data) {
if(data.length > 0) {
for(var i = 0; i < data.length; i++) {
var college="",major="",degree=""
if(data[i].college){
college =' - ' + data[i].college
}else{
data[i].college="";
}
if(data[i].major){
major =' - ' + data[i].major
}else{
data[i].major="";
}
if(data[i].degree){
degree =' - ' + data[i].degree
if(data[i].degree==0){
degree =""
}
}else{
data[i].degree="";
}
var timebiye="";
if(data[i].year){
if(data[i].year.trim()=="至今"){
timebiye=data[i].year;
}else{
timebiye=data[i].year+'年';
}
}else{
timebiye="";
}
var showHtml = '<li><div class="h4Font h4tit">'
showHtml += data[i].school + college + major + degree;
showHtml +='<small class="h6Font">' + timebiye + '</small></div></li>';
$("#eduBgShow").append(showHtml);
}
}
}
//判断点赞的用户是否有头像
function getRecords($researchAreaLogs, caption) {
var ret = [];
var t = 0;
for(var i = 0; i < $researchAreaLogs.length; i++) {
if(caption == $researchAreaLogs[i].caption) {
ret[t] = {
id: $researchAreaLogs[i].opreteProfessorId,
img: $researchAreaLogs[i].hasHeadImage
}
t++;
}
}
return ret;
}
//合作历史及评价
function historyEvaluate(){
$.ajax({
"url": "/ajax/consult/pqAssessHis",
"type": "get",
"data": {
"professorId": professorId,
"pageSize": 1000
},
"async": false,
"success": function(response) {
if(response.success) {
var dataStr = response.data.data;
if(dataStr.length>0){
$("#historyEvaluate").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
for(var i = 0; i < dataStr.length; i++) {
var assessTime = commenTime(dataStr[i].assessTime);
var assessContant ="";
if(dataStr[i].assessContant) {
assessContant = dataStr[i].assessContant;
}
var userhed='';
if(dataStr[i].professor.hasHeadImage) {
userhed = 'background-image:url(/images/head/' + dataStr[i].professor.id + '_l.jpg)';
} else {
userhed = 'background-image:url(/images/default-photo.jpg)';
}
var add = "";
add += '<li class="flexCenter">';
add += '<a href="userInforShow.html?professorId='+ dataStr[i].professor.id +'" class="userhref"><div class="madiaHead useHead useHeadMsg" style="'+ userhed +'"></div></a>'
add += '<div class="madiaInfo"><div style="position: relative;">';
add += '<a href="userInforShow.html?professorId='+ dataStr[i].professor.id +'" class="userhref"><span class="h1Font messageName">'+ dataStr[i].professor.name +'</span></a>';
add += '<em class="authiconNew authicon-pro" title=" "></em><span class="commenttime">'+ assessTime +'</span>';
add += '<ul class="starShow">';
add += '<li></li> <li></li> <li></li> <li></li> <li></li>';
add += '</ul></div>';
add += '<p class="h2Font messageContent">'+ assessContant +'</p>';
add += '</div></li>';
var $add = $(add);
$("#historyEvaluate").append($add);
$add.find(".starShow>li:lt(" + dataStr[i].assessStar + ")").addClass('evastar');
}
}else{
}
}
}
})
}
//获取资源
function getResource(pageSize, pageNo,isbind){
$.ajax({
"url": "/ajax/resource/pqProPublish",
"type": "get",
"async": false,
"data": {
"professorId": professorId,
"pageSize": pageSize,
"pageNo": pageNo
},
"success": function(data) {
console.log(data);
if(data.success) {
var madiaHead ='';
var dataStr=data.data.data;
if(dataStr.length > 0){
$("#showResource").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
for(var i = 0; i < dataStr.length; i++) {
if(dataStr[i].images.length) {
madiaHead ='/data/resource/' + dataStr[i].images[0].imageSrc ;
}else{
madiaHead ='/images/default-resource.jpg';
}
var strAdd = '';
strAdd += '<li><a target="_blank" href="resourceShow.html?resourceId='+ dataStr[i].resourceId +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ madiaHead +')"></div>';
strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].resourceName +'</p><p class="h2Font ellipsisSty-2">用途:'+ dataStr[i].supportedServices+'</p></div>';
strAdd += '</a></li>';
var $strAdd = $(strAdd);
$("#proResource").append(strAdd);
if(isbind==true && i==0){
var $strAddO=$(strAdd);
$("#showResource").html("");
$("#showResource").append($strAddO);
}
}
//分页
if(isbind==true){
$("#proResource").siblings(".tcdPageCode").off("click").createPage({
pageCount: Math.ceil(data.data.total / 10),
current: data.data.pageNo,
backFn: function(p) {
$("#proResource").html("");
getResource(10, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#proResource + .nodatabox").show();
$("#proResource + .nodatabox").find(".noContip").text("用户尚未发布任何资源");
}
}
},
"error": function() {
$.MsgBox.Alert("提示", "服务器连接超时")
}
});
}
//获取文章
function getArticle(pageSize, pageNo,isbind){
$.ajax({
url: "/ajax/article/pqProPublish",
dataType: 'json', //数据格式类型
type: 'GET', //http请求类型
data: {
"professorId": professorId,
"pageSize": pageSize,
"pageNo": pageNo
},
timeout: 10000, //超时设置
success: function(data) {
if(data.success) {
var madiaHead ='/images/default-artical.jpg';
var dataStr=data.data.data;
if(dataStr.length > 0){
$("#showArticle").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
for(var i = 0; i < dataStr.length; i++) {
if(dataStr[i].articleImg) {
madiaHead ='/data/article/' + dataStr[i].articleImg ;
}
var sowU="";
if(dataStr[i].pageViews!=0){
if(dataStr[i].articleAgree!=0){
sowU='<li><span>阅读量 '+dataStr[i].pageViews+'</span></li><li><span>赞 '+dataStr[i].articleAgree+'</span></li>'
}else{
sowU='<li><span>阅读量 '+dataStr[i].pageViews+'</span></li>'
}
}
var strAdd = '';
strAdd += '<li><a target="_blank" href="articalShow.html?articleId='+ dataStr[i].articleId +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead artHead" style="background-image:url('+ madiaHead +')"></div>';
strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr[i].articleTitle +'</p>';
strAdd += '<ul class="h2Font clearfix">';
strAdd += '<li><span class="time">'+ commenTime(dataStr[i].publishTime) +'</span></li>';
strAdd += sowU
strAdd += '<li><span class="comment"></span></li>';
strAdd += '</ul></div>';
strAdd += '</a></li>';
var $strAdd = $(strAdd);
$("#proArticel").append( $strAdd);
commentnum(dataStr[i].articleId, $strAdd) //文章评论数
if(isbind==true && i==0){
var $strAddO = $(strAdd);
$("#showArticle").html("");
$("#showArticle").append($strAddO);
commentnum(dataStr[0].articleId,$strAddO)
}
}
//分页
if(isbind==true){
$("#proArticel").siblings(".tcdPageCode").off("click").createPage({
pageCount: Math.ceil(data.data.total / 10),
current: data.data.pageNo,
backFn: function(p) {
$("#proArticel").html("");
getArticle(10, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#proArticel + .nodatabox").show();
$("#proArticel + .nodatabox").find(".noContip").text("用户尚未发布任何文章");
}
}
},
error: function() {
return;
}
});
}
//获取专利
function getPatent(pageSize, pageNo,isbind){
$.ajax({
url: "/ajax/ppatent/byProfessor",
dataType: 'json', //数据格式类型
type: 'GET', //http请求类型
data: {
"id": professorId,
"pageSize": pageSize,
"pageNo": pageNo
},
timeout: 10000, //超时设置
success: function(data) {
if(data.success) {
var dataStr=data.data.data;
if(dataStr.length > 0){
$("#showPatent").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
for(var i = 0; i < dataStr.length; i++) {
if(!dataStr[i].reqPerson){
dataStr[i].reqPerson="";
}
var strAdd = '';
strAdd += '<li><a target="_blank" href="patentShow.html?patentId='+ dataStr[i].id +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead patentHead"></div>';
strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
strAdd += '</div>';
strAdd += '</a></li>';
var $strAdd = $(strAdd);
$("#proPatent").append( $strAdd);
if(isbind==true && i==0){
var $strAddO=$(strAdd);
$("#showPatent").html("");
$("#showPatent").append($strAddO);
}
}
//分页
if(isbind==true){
$("#proPatent").siblings(".tcdPageCode").off("click").createPage({
pageCount: Math.ceil(data.data.total / 10),
current: data.data.pageNo,
backFn: function(p) {
$("#proPatent").html("");
getPatent(10, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#proPatent + .nodatabox").show();
$("#proPatent + .nodatabox").find(".noContip").text("用户尚未发布任何专利");
}
}
},
error: function() {
return;
}
});
}
//获取论文
function getPaper(pageSize, pageNo,isbind){
$.ajax({
url: "/ajax/ppaper/byProfessor",
dataType: 'json', //数据格式类型
type: 'GET', //http请求类型
data: {
"id": professorId,
"pageSize": pageSize,
"pageNo": pageNo
},
timeout: 10000, //超时设置
success: function(data) {
if(data.success) {
var dataStr=data.data.data;
if(dataStr.length > 0){
$("#showPaper").parents(".coninfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
for(var i = 0; i < dataStr.length; i++) {
var moreInf=""
if(!dataStr[i].cn4periodical){
dataStr[i].cn4periodical="";
}
if(!dataStr[i].en4periodical){
dataStr[i].en4periodical="";
}
if(!dataStr[i].pubDay){
dataStr[i].pubDay="";
}
moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
var strAdd = '';
strAdd += '<li><a target="_blank" href="paperShow.html?paperId='+ dataStr[i].id +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead paperHead"></div>';
strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
strAdd += '</div>';
strAdd += '</a></li>';
var $strAdd = $(strAdd);
$("#proPaper").append( $strAdd);
if(isbind==true && i==0){
var $strAddO=$(strAdd);
$("#showPaper").html();
$("#showPaper").append($strAddO);
}
}
//分页
if(isbind==true){
$("#proPaper").siblings(".tcdPageCode").off("click").createPage({
pageCount: Math.ceil(data.data.total / 10),
current: data.data.pageNo,
backFn: function(p) {
$("#proPaper").html("");
getPaper(10, p,false);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
$("#proPaper + .nodatabox").show();
$("#proPaper + .nodatabox").find(".noContip").text("用户尚未发布任何论文");
}
}
},
error: function() {
return;
}
});
}
//查文章评论数
function commentnum(articleId, $itemlist) {
$.ajax({
"url": "/ajax/leaveWord/lwCount",
"type": "GET",
"dataType": "json",
"async": false,
"data": {
"articleId": articleId
},
"success": function(data) {
if(data.success) {
if(data.data>0){
$itemlist.find(".comment").text("留言 " + data.data);
}
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//合作专家
function relevantExperts(){
$.ajax({
"url": "/ajax/professor/coadjutant",
"type": "get",
"dataType" : "json",
"data" :{"id":professorId},
"success": function(data) {
if(data.success && data.data) {
console.log(data)
for(var i = 0; i < data.data.length; i++) {
var ExpId = data.data[i].professorId;
var paperN=data.data[i].paperCount;
var patentN=data.data[i].patentCount;
var liItem=$('<li class="flexCenter"></li>').appendTo($("#relatePro"));
relExpertsList(ExpId,paperN,patentN,liItem);
}
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//合作专家信息
function relExpertsList(Id,numL,numZ,liItem){
$.ajax({
"url" : "/ajax/professor/info/"+Id,
"type" : "GET" ,
"dataType" : "json",
"success" : function(data) {
if (data.success && data.data!=""){
$("#relatePro").parents(".conBlock").removeClass("displayNone");
var itemlist = '<a target="_blank" href="" class="urlgo">';
itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
itemlist += '<div class="madiaInfo">';
itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
itemlist += '<p class="h2Font ellipsisSty" id="copNum"></p>';
itemlist += '</div></a>';
$(itemlist).appendTo(liItem);
var $itemlist =liItem;
if(numL){
if(numZ){
$itemlist.find("#copNum").text("合作:"+numZ+"项专利,"+numL+"篇论文")
}else{
$itemlist.find("#copNum").text("合作:"+numL+"篇论文")
}
}else{
if(numZ){
$itemlist.find("#copNum").text("合作:"+numZ+"项专利")
}else{
}
}
if(data.data.title) {
if(data.data.orgName) {
$itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
}else{
$itemlist.find("#usertitle").text(data.data.title);
}
}else{
if(data.data.office) {
if(data.data.orgName) {
$itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
}else{
$itemlist.find("#usertitle").text(data.data.office);
}
}else{
if(data.data.orgName) {
$itemlist.find("#usertitle").text(data.data.orgName);
}
}
}
$itemlist.find("#userName").text(data.data.name);
$itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
if(data.data.hasHeadImage == 1) {
$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
}
var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
$itemlist.find(".authiconNew").attr("title", userType.title);
$itemlist.find(".authiconNew").addClass(userType.sty);
}
},
"error":function(){
$.MsgBox.Alert('提示','链接服务器超时')
}
});
}
//相关文章信息
function relevantarticalList(){
$.ajax({
"url" : "/ajax/article/byAssProfessor",
"type" : "GET" ,
"dataType" : "json",
"data" :{"id":professorId},
"traditional": true, //传数组必须加这个
"success" : function(data) {
console.log(data);
if (data.success && data.data!=""){
$("#relateArt").parents(".conBlock").removeClass("displayNone");
var itemlist = '';
$("#relateArt").html("");
for(var i = 0; i < data.data.length; i++) {
var itemlist = '<li class="flexCenter"><a target="_blank" href="articalShow.html?articleId='+ data.data[i].articleId +'" class="urlgo">';
itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
itemlist += '</a></li>';
$itemlist = $(itemlist);
$("#relateArt").append($itemlist);
}
}
},
"error":function(){
$.MsgBox.Alert('提示','链接服务器超时')
}
});
}
//感兴趣
function likeExperts(){
$.ajax({
"url": "/ajax/professor/ralateProfessors",
"type": "get",
"dataType" : "json",
"data" :{"professorId":professorId},
"success": function(data) {
if(data.success && data.data) {
console.log(data)
var lengthT;
if(data.data.length>5){
lengthT=5;
}else{
lengthT=data.data.length
}
for(var i = 0; i < lengthT; i++) {
var ExpId = data.data[i].id;
likeExpertsList(ExpId);
}
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
//感兴趣专家
function likeExpertsList(ExpId){
$.ajax({
"url" : "/ajax/professor/info/"+ExpId,
"type" : "GET" ,
"dataType" : "json",
"success" : function(data) {
if (data.success && data.data!=""){
console.log(data)
$("#likePro").parents(".conBlock").removeClass("displayNone");
var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
itemlist += '<div class="madiaInfo">';
itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
itemlist += '</div></a></li>';
$itemlist = $(itemlist);
$("#likePro").append($itemlist);
if(data.data.title) {
if(data.data.orgName) {
$itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
}else{
$itemlist.find("#usertitle").text(data.data.title);
}
}else{
if(data.data.office) {
if(data.data.orgName) {
$itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
}else{
$itemlist.find("#usertitle").text(data.data.office);
}
}else{
if(data.data.orgName) {
$itemlist.find("#usertitle").text(data.data.orgName);
}
}
}
$itemlist.find("#userName").text(data.data.name);
$itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
if(data.data.hasHeadImage == 1) {
$itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
}
var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
$itemlist.find(".authiconNew").attr("title", userType.title);
$itemlist.find(".authiconNew").addClass(userType.sty);
}
},
"error":function(){
$.MsgBox.Alert('提示','链接服务器超时')
}
});
}
//获取需求
function getDemands(pageSize, pageNo,isbind) {
$.ajax({
url: "/ajax/demand/pq",
type: "GET",
timeout: 10000,
dataType: "json",
data: {
"state":'1',
"uid":professorId,
"pageNo": pageNo,
"pageSize":pageSize
},
beforeSend: function() {
$("#showDemand").append('<img src="../images/loading.gif" class="loading" />');
},
success: function(data) {
if(data.success) {
$("#showDemand").html(" ");
var $info = data.data.data;
if($info.length > 0){
$("#showDemand").parents(".needinfobox").removeClass("displayNone");
$("#item1user>.nodatabox").addClass("displayNone");
for(var i = 0; i < $info.length; i++) {
var liStr=$("<li></li>").appendTo("#showDemand");
demandHtml($info[i],liStr);
}
// if(isbind == true) {
// $(".tcdPageCode").createPage({
// pageCount: Math.ceil(data.data.total / pageSize),
// current: data.data.data.pageNo,
// backFn: function(p) {
// demandList(false,10, p);
// }
// });
// }
}else{
$("#showDemand").parents(".needinfobox").addClass("displayNone");
}
}
$(".loading").remove();
},
error: function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
})
}
function demandHtml(dataStr,liStr) {
var sowU="";
if(dataStr.pageViews!=0){
sowU='<li><span>浏览量 '+dataStr.pageViews +'</span></li>'
}
var strCon='';
strCon+='<a class="" target="_blank" href="demandShow.html?demandId='+dataStr.id+'" class="madiaInfo">'
strCon+='<p class="h1Font ellipsisSty">'+ dataStr.title +'</p>'
strCon+='<ul class="showliTop h3Font clearfix">'
strCon+='<li><span>发布于 '+commenTime(dataStr.createTime)+'</span></li>'
strCon+= sowU
strCon+='</ul>'
strCon+='<p class="h2Font ellipsisSty-2">'+dataStr.descp+'</p>'
strCon+='<ul class="showli clearfix h3Font">'
if(dataStr.city){ strCon+='<li>所在城市:'+dataStr.city+'</li>' }
if(dataStr.duration!=0){ strCon+='<li>预期时长:'+demandDuration[dataStr.duration]+'</li>' }
if(dataStr.cost!=0){ strCon+='<li>费用预算:'+demandCost[dataStr.cost]+'</li>' }
if(dataStr.invalidDay){ strCon+='<li>有效期至:'+TimeTr(dataStr.invalidDay)+'</li>' }
strCon+='</ul>'
strCon+='</a>'
$(strCon).appendTo(liStr);
}
//收藏与关注
function attentMy(){
var num=watchType;
$.ajax({
url: "/ajax/watch/qaWatch",
dataType: 'json', //数据格式类型
type: 'GET', //http请求类型
data: {
"watchObject": professorId,
},
timeout: 10000, //超时设置
success: function(data) {
if(data.success) {
document.getElementById("attendMy").innerHTML="";
document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.add("displayNone");
if(data.data.length>0){
var datalist = data.data;
for(var i = 0; i < datalist.length; i++) {
var liItem = document.createElement("li");
liItem.className="mui-table-view-cell";
document.getElementById("attendMy").appendChild(liItem);
detailPro(datalist[i],liItem);
}
}else{
document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
}
}
},
error: function() {
return;
}
});
}
function collAttent(pageSize, pageNo,isbind,num){
if(!num){
var num=watchType;
}
$.ajax({
url: "/ajax/watch/qaPro",
dataType: 'json', //数据格式类型
type: 'GET', //http请求类型
data: {
"professorId": professorId,
"watchType": num,
"pageNo": pageNo,
"pageSize":pageSize
},
timeout: 10000, //超时设置
success: function(data) {
console.log(data)
var tcdPage;
if(data.success && data.data.data != "") {
var datalist = data.data.data;
if(num==1){
tcdPage=$("#attendPro").parent().find(".tcdPageCode");
document.getElementById("attendPro").innerHTML="";
for(var i = 0; i < datalist.length; i++) {
var liItem = document.createElement("li");
liItem.className="mui-table-view-cell";
document.getElementById("attendPro").appendChild(liItem);
detailPro(datalist[i],liItem);
}
}else if(num==2){
tcdPage=$("#attendRes").parent().find(".tcdPageCode");
detailRes(datalist);
}else if(num==3){
tcdPage=$("#attendArt").parent().find(".tcdPageCode");
detailArt(datalist);
}else if(num==4){
tcdPage=$("#attendPatent").parent().find(".tcdPageCode");
detailPat(datalist);
}else if(num==5){
tcdPage=$("#attendPaper").parent().find(".tcdPageCode");
detailPer(datalist);
}else if(num==6){
tcdPage=$("#attendCmp").parent().find(".tcdPageCode");
detailCmp(datalist);
}else if(num==7){
tcdPage=$("#attendDemand").parent().find(".tcdPageCode");
detailDemand(datalist);
}
if(isbind==true){
tcdPage.off("click").createPage({
pageCount: Math.ceil(data.data.total / 10),
current: data.data.pageNo,
backFn: function(p) {
collAttent(10, p,false,num);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
});
}
}else{
if(num==1){
document.getElementById("attendPro").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
}else if(num==2){
document.getElementById("attendRes").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
}else if(num==3){
document.getElementById("attendArt").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
}else if(num==4){
document.getElementById("attendPatent").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
}else if(num==5){
document.getElementById("attendPaper").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
}else if(num==6){
document.getElementById("attendCmp").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
}else if(num==7){
document.getElementById("attendDemand").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
}
}
},
error: function() {
return;
}
});
}
function detailPro(datalist,liItem) {
var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
var os = "";
if(datalist.professor.title) {
if(datalist.professor.orgName) {
os = datalist.professor.title + "," + datalist.professor.orgName;
} else {
os = datalist.professor.title;
}
} else {
if(datalist.professor.office) {
if(datalist.professor.orgName) {
os = datalist.professor.office + "," + datalist.professor.orgName;
} else {
os = datalist.professor.office;
}
} else {
if(datalist.professor.orgName) {
os = datalist.professor.orgName;
}
}
}
var baImg = "../images/default-photo.jpg";
if(datalist.professor.hasHeadImage == 1) {
baImg = "/images/head/" + datalist.professor.id + "_l.jpg";
}
var strAdd = '';
strAdd += '<a target="_blank" href="userInforShow.html?professorId='+ datalist.professor.id +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead useHead" style="width: 80px;height: 80px;margin-top: -40px;background-image:url(' + baImg + ')"></div>';
strAdd += '<div class="madiaInfo" style="padding-left:92px"><p class="h1Font ellipsisSty">' + datalist.professor.name + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>';
strAdd += '<p class="h2Font ellipsisSty">' + os + '</p>';
strAdd += '</div>';
strAdd += '</a>';
liItem.innerHTML = strAdd
}
function detailCmp(datalist) {
document.getElementById("attendCmp").innerHTML="";
var arr=[];
for(var i in datalist) {
arr[i]=datalist[i].watchObject;
}
$.ajax({
url:"/ajax/org/qm",
data: {
id:arr,
},
dataType: 'json', //数据格式类型
type: 'get', //http请求类型
traditional: true,
success: function(data) {
if(data.success && data.data != "") {
var dataStr=data.data;
for(var i = 0; i < dataStr.length; i++) {
var li = document.createElement("li");
li.setAttribute("data-id", dataStr[i].id);
var oimg = (dataStr[i].hasOrgLogo) ?"/images/org/" + dataStr[i].id + ".jpg" : "../images/default-icon.jpg";
var oAuth = (dataStr[i].authStatus == 3) ? 'authicon-com-ok' : '';
var orgName = (dataStr[i].forShort) ? dataStr[i].forShort : dataStr[i].name;
var orgType = (dataStr[i].orgType == '2') ? "上市企业" : "";
var orgOther = (dataStr[i].industry) ? dataStr[i].industry.replace(/,/gi, " | ") : "";
li.className = "mui-table-view-cell";
var itemlist=''
itemlist += '<a class="flexCenter" target="_blank" href="cmpInforShow.html?orgId='+dataStr[i].id+'"><div class="madiaHead cmpHead">';
itemlist += '<div class="boxBlock"><img class="boxBlockimg" src="' + oimg + '"></div></div>';
itemlist += '<div class="madiaInfo">';
itemlist += '<p class="h1Font"><span>' + orgName + '</span><em class="authiconNew ' + oAuth + '" title="科袖认证企业"></em></p>';
itemlist += '<p class="h2Font ellipsisSty"><span>' + orgType + '</span> <span>' + orgOther + '</span></p>';
itemlist += '</div></a>';
li.innerHTML = itemlist
document.getElementById("attendCmp").appendChild(li);
}
}
},
error: function() {
}
});
}
function detailPat(datalist) {
document.getElementById("attendPatent").innerHTML="";
if(datalist.length<0){
$("#attendPatent + .nodatabox").removeClass("displayNone");
return;
}
var arr=[];
for(var i in datalist) {
arr[i]=datalist[i].watchObject;
}
$.ajax({
url:"/ajax/ppatent/qm",
data: {
id:arr,
},
dataType: 'json', //数据格式类型
type: 'get', //http请求类型
traditional: true,
success: function(data) {
if(data.success && data.data != "") {
var dataStr=data.data;
for(var i = 0; i < dataStr.length; i++) {
var li = document.createElement("li");
li.className = "mui-table-view-cell";
var strAdd = '';
strAdd += '<a target="_blank" href="patentShow.html?patentId='+ dataStr[i].id +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead patentHead"></div>';
strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
strAdd += '</div>';
strAdd += '</a>';
li.innerHTML = strAdd
document.getElementById("attendPatent").appendChild(li);
}
}
},
error: function() {
}
});
}
function detailPer(datalist) {
document.getElementById("attendPaper").innerHTML="";
var arr=[];
for(var i in datalist) {
arr[i]=datalist[i].watchObject;
}
$.ajax({
url:"/ajax/ppaper/qm",
data: {
id:arr,
},
dataType: 'json', //数据格式类型
type: 'get', //http请求类型
traditional: true,
success: function(data) {
if(data.success && data.data != "") {
var dataStr=data.data;
for(var i = 0; i < dataStr.length; i++) {
var moreInf=""
if(!dataStr[i].cn4periodical){
dataStr[i].cn4periodical="";
}
if(!dataStr[i].en4periodical){
dataStr[i].en4periodical="";
}
if(!dataStr[i].pubDay){
dataStr[i].pubDay="";
}
moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
var li = document.createElement("li");
li.className = "mui-table-view-cell";
var strAdd = '';
strAdd += '<a target="_blank" href="paperShow.html?paperId='+ dataStr[i].id +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead paperHead"></div>';
strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
strAdd += '</div>';
strAdd += '</a>';
li.innerHTML = strAdd
document.getElementById("attendPaper").appendChild(li);
}
}
},
error: function() {
}
});
}
function detailRes(datalist) {
document.getElementById("attendRes").innerHTML="";
for(var i = 0; i < datalist.length; i++) {
var dataStr = datalist[i].resource;
var namepo, userType;
if(dataStr.resourceType == 1) {
namepo = dataStr.editProfessor.name;
userType = autho(dataStr.editProfessor.authType, dataStr.editProfessor.orgAuth, dataStr.editProfessor.authStatus);
} else {
if(dataStr.organization.forShort){
namepo = dataStr.organization.forShort;
}else{
namepo = dataStr.organization.name;
}
userType={}
if(dataStr.organization.authStatus==3){
userType.sty="authicon-com-ok"
userType.title="科袖认证企业"
}
}
var rImg = "../images/default-resource.jpg";
if(dataStr.images.length) {
rImg = "/data/resource/" + dataStr.images[0].imageSrc;
}
var li = document.createElement("li");
li.className = "mui-table-view-cell";
var strAdd = '';
strAdd += '<a target="_blank" href="resourceShow.html?resourceId='+ dataStr.resourceId +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ rImg +')"></div>';
strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.resourceName +'</p>';
strAdd += '<p class="h1Font ellipsisSty">'+ namepo +'<em class="authiconNew ' + userType.sty + '" title="'+userType.title+'"></em></p>';
strAdd += '<p class="h2Font ellipsisSty-2">用途:'+ dataStr.supportedServices+'</p></div>';
strAdd += '</a>';
li.innerHTML =strAdd
document.getElementById("attendRes").appendChild(li);
}
}
function detailArt(datalist) {
document.getElementById("attendArt").innerHTML="";
for(var i = 0; i < datalist.length; i++) {
var dataItem = datalist[i].article;
var arImg = "../images/default-artical.jpg";
if(dataItem.articleImg) {
arImg ="/data/article/" + dataItem.articleImg
}
var title = dataItem.articleTitle;
var name = ""
var li = document.createElement("li");
if( dataItem.articleType == 1) {
name = dataItem.professor.name;
} else {
if(dataItem.organization.forShort){
name = dataItem.organization.forShort;
}else{
name = dataItem.organization.name;
}
}
li.className = "mui-table-view-cell";
var strAdd = '';
strAdd += '<a target="_blank" href="articalShow.html?articleId='+ dataItem.articleId +'" class="flexCenter urlgo">';
strAdd += '<div class="madiaHead artHead" style="background-image:url('+ arImg +')"></div>';
strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataItem.articleTitle +'</p>';
strAdd += '<ul class="h2Font clearfix">';
strAdd += '<li><span>'+ name +'</span></li>';
strAdd += '<li><span class="time">'+ commenTime(dataItem.publishTime) +'</span></li>';
strAdd += '<li><span class="comment"></span></li>';
strAdd += '</ul></div>';
strAdd += '</a>';
li.innerHTML = strAdd
document.getElementById("attendArt").appendChild(li);
}
}
function detailDemand(datalist) {
document.getElementById("attendDemand").innerHTML="";
var arr=[];
for(var i in datalist) {
arr[i]=datalist[i].watchObject;
}
$.ajax({
url:"/ajax/demand/qm",
data: {
id:arr,
},
dataType: 'json', //数据格式类型
type: 'get', //http请求类型
traditional: true,
success: function(data) {
if(data.success && data.data != "") {
var dataStr=data.data;
for(var i = 0; i < dataStr.length; i++) {
var li = document.createElement("li");
li.className = "mui-table-view-cell";
var strCon='<a target="_blank" href="demandShow.html?demandId='+ dataStr[i].id +'" class="flexCenter urlgo">';
strCon+='<div class="madiaInfo" style="padding-left:0">'
strCon+='<p class="h1Font ellipsisSty">'+ dataStr[i].title +'</p>'
strCon+='<ul class="showli clearfix h3Font">'
if(dataStr[i].city){ strCon+='<li>'+dataStr[i].city+'</li>' }
if(dataStr[i].duration!=0){ strCon+='<li>预期 '+demandDuration[dataStr[i].duration]+'</li>' }
if(dataStr[i].cost!=0){ strCon+='<li>预算 '+demandCost[dataStr[i].cost]+'</li>' }
if(dataStr[i].invalidDay){ strCon+='<li>有效期至 '+TimeTr(dataStr[i].invalidDay)+'</li>' }
strCon+='</ul></div></a>'
li.innerHTML = strCon
document.getElementById("attendDemand").appendChild(li);
}
}
},
error: function() {
}
});
}
//纠错反馈
$(".correctSubmit").on("click",function(){
var cntCon=$(this).siblings(".correctCon").val();
var cntUser="";
if(userid && userid != null && userid != "null") {
cntUser = userid;
}
if(cntCon.length>500){
$.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
return;
}else{
$.ajax({
"url": "/ajax/feedback/error/professor",
"type": "POST",
"dataType": "json",
"async": true,
"data": {
"id": professorId,
"cnt":cntCon,
"user":cntUser
},
"success": function(data) {
if(data.success) {
backSuccessed();
}
},
"error": function() {
$.MsgBox.Alert('提示', '链接服务器超时')
}
});
}
})
})
|