123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907 |
- $(function() {
- loginStatus();
- var userid = $.cookie("userid");
- var professorId = GetQueryString("professorId");
- if(userid != professorId) {
- ifcollectionAbout(professorId, 1)
- $(".goSpan").show();
- }
-
- if(professorId) {
- getUserInfo(professorId);
- historyEvaluate();
- getResource(10,1,true);
- getArticle(10,1,true);
- getPaper(10,1,true);
- getPatent(10,1,true);
-
- $.ajax({
- type:"get",
- url:"/ajax/watch/countObject",
- data: {
- id: professorId,
- type: 1,
- },
- 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")
- }
- }
- }
- });
-
- $("#conbtn").on('click', function(){
- if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
- ConsultApply();
- concultProInfo(professorId);
-
- $("#sendConsultBtn").click(function() {
- sendConsultHandler($(this).attr("proId"));
- });
- } else {
- $.MsgBox.Alert("提示", "请先登录再进行咨询");
- $("#mb_btn_ok").val("去登录");
- var aele = document.createElement('a');
- $("#mb_btnbox").append(aele);
- $("#mb_btnbox a").css({
- 'display': "block",
- 'width': '100%',
- 'height': '40px',
- 'position': 'absolute',
- 'bottom': '-6px',
- 'left': '0'
- });
- aele.setAttribute('href', '../login.html');
- }
- });
-
- $("#attentBtn").on('click', function() {
- if(userid && userid != null && userid != "null") {
- if($(this).is('.attenedSpan')){
- cancelCollectionAbout(professorId, 1)
- } else {
- collectionAbout(professorId, 1);
- }
- }else{
- $.MsgBox.Alert("提示", "请先登录再进行关注");
- $("#mb_btn_ok").val("去登录");
- var aele = document.createElement('a');
- $("#mb_btnbox").append(aele);
- $("#mb_btnbox a").css({
- 'display': "block",
- 'width': '100%',
- 'height': '40px',
- 'position': 'absolute',
- 'bottom': '-6px',
- 'left': '0'
- });
- aele.setAttribute('href', '../login.html');
- }
- });
-
- 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($data) {
- if($data.success) {
- $.get("/ajax/professor/info/" + professorId, function($data) {
- if($data.success) {
- clFlag = 1;
- var $info = $data.data;
- if($info) {
- $("#researchAreaShow").empty("")
- if($info.researchAreas) {
- researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
- }
- }
- }
- })
- } else {
- $.MsgBox.Alert("提示", $data.msg);
- }
- }
- });
- } else {
- $.MsgBox.Alert("提示", "请登录后点赞");
- }
- })
-
- $("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
- var cap = $(this).attr("caption");
- $.ajax({
- url: "/ajax/researchAreaLog/ql",
- dataType: 'json',
- type: 'GET',
- timeout: 10000,
- data: {
- "professorId": professorId,
- 'caption': cap,
- "rows": 10
- },
- success: function(data) {
- console.log(data)
- if(data.success) {
- $(".listitemdiv").html("");
- var $info = data.data;
- $("#subArea").text(cap);
- $(".resAreaCover").fadeIn();
- $(".resAreaCon").show()
- if($info.length == 0) {
- $(".resAreaCon").hide();
- return;
- }
- for(var i = 0; i < $info.length; i++) {
- if($info[i].professor.hasHeadImage == 1) {
- var imgbg = "/images/head/" + $info[i].professor.id + "_l.jpg";
- } else {
- var imgbg = "../images/default-photo.jpg";
- }
-
- var oSty=autho($info[i].professor.authType,$info[i].professor.orgAuth,$info[i].professor.authStatus);
-
- var title = $info[i].professor.title || "";
- var orgName = $info[i].professor.orgName || "";
- var office = $info[i].professor.office || "";
- if(title != "") {
- var ttitle = title + ",";
- }else{
- if(office!=""){
- var ttitle = office + ",";
- }else{
- var ttitle = office;
- }
- }
- if(orgName != "") {
- orgName = orgName;
- }
-
- var addw ='<li class="flexCenter" data-id="'+$info[i].professor.id+'">'
- addw +='<a href="userInforShow.html?professorId='+ $info[i].professor.id +'" class="expertUrl linkhref">'
- addw +='<div class="lefthead userheadt userRadius" id="expertImg" style="background-image: url('+ imgbg +');"></div>'
- addw +='<div class="centercon" style="padding-right:0;">'
- addw +='<p class="h1font"><span class="nameSpan" id="Name">' + $info[i].professor.name + '</span><em class="authiconNew ' + oSty.sty + '" title="'+ oSty.title +'"></em></p>'
- addw +='<p class="h2font ellipsisSty">'+ ttitle + orgName + '</p>'
- addw +='</div></a></li>';
- $(".listitemdiv").append(addw);
- }
-
- $("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();
- })
- }
-
- var subjectShow = function(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>");
- };
- }
- }
- }
- var oArray=[];
- var researchAreaShow = function($datas, $datarecords) {
- if($datas != undefined && $datas.length != 0) {
- var html = [];
- for(var i = 0; i < $datas.length; ++i) {
- var $data = $datas[i];
- var $photos = [];
-
- if($datarecords.length > 0) {
- $photos = getRecords($datarecords, $data.caption);
- }
- var isAgree = -1;
- for(var j = 0; j < $photos.length; j++) {
- if(userid == $photos[j].id)
- isAgree++;
- }
- oArray[i]=$data.caption;
- if(professorId != userid) {
- if(isAgree) {
- var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><span class="plus" data-pid="'+ $data.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ $data.caption +'">';
- } else {
- var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><span class="plus" style="background-position-y:-26px" data-pid="'+ $data.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ $data.caption +'">';
- }
- } else {
- var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><div class="favorCount" caption="'+ $data.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('');
- }
- }
- var industryShow = function(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>");
- };
- }
- }
- }
- var projectShow = function(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);
- }
- }
- }
- var honorShow = function(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);
- }
- }
- }
- var timeJobShow = function(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 + '-' + data[i].title + '' + dep + '<small class="h6Font">' + sDate + eDate + '</small></div>';
- JobHtml += '</li>';
- $("#timeJobShow").append(JobHtml);
- }
- }
- }
- var eduBgShow = function(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 =' - ' + eduDegree[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 getUserInfo(professorId){
- $.ajax({
- type:"get",
- url:"/ajax/professor/info/"+ professorId,
- async:true,
- success: function(data) {
- var $info = data.data;
- if(data.success) {
- 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{
- proOther = $info.orgName
- }
- }
- $("#proOther").text(proOther);
- var llqtitle=$info.name + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
- if($info.title){
- $("#proTit").html($info.title + "<span style='margin-right:10px;'></span>");
- llqtitle = $info.name + "-" + $info.title + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
- }
- document.title = llqtitle;
-
-
- 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 historyEvaluate(){
- $.ajax({
- "url": "/ajax/consult/pqAssessHis",
- "type": "get",
- "data": {
- "professorId": professorId
- },
- "async": false,
- "success": function(response) {
- if(response.success) {
- var $data = response.data.data;
- if($data.length>0){
- $("#historyEvaluate").parents(".coninfobox").removeClass("displayNone");
- $("#item1user>.nodatabox").addClass("displayNone");
- for(var i = 0; i < $data.length; i++) {
- var assessTime = commenTime($data[i].assessTime);
- var assessContant ="";
- if($data[i].assessContant) {
- assessContant = $data[i].assessContant;
- }
- var userhed='';
- if($data[i].professor.hasHeadImage) {
- userhed = 'background-image:url(/images/head/' + $data[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='+ $data[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='+ $data[i].professor.id +'" class="userhref"><span class="h1Font messageName">'+ $data[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(" + $data[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 traget="_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-2">'+ dataStr[i].resourceName +'</p><p class="h2Font ellipsisSty">应用用途:'+ dataStr[i].supportedServices+'</p></div>';
- strAdd += '</a></li>';
-
- if(i==0){
- $("#showResource").append(strAdd);
- }
- $("#proResource").append(strAdd);
- }
-
- if(isbind==true){
- $("#proResource").siblings(".tcdPageCode").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',
- 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 strAdd = '';
- strAdd += '<li><a traget="_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 += '<li><span id="pageViews">阅读量 '+ dataStr[i].pageViews +'</span></li>';
- strAdd += '<li><span id="articleAgree">点赞 '+ dataStr[i].articleAgree +'</span></li>';
- strAdd += '<li><span id="comment"></span></li>';
- strAdd += '</ul></div>';
- strAdd += '</a></li>';
-
- var $strAdd = $(strAdd);
- $("#proArticel").append( $strAdd);
- commentnum(dataStr[i].articleId, $strAdd)
- if(i==0){
- $("#showArticle").append(strAdd);
- commentnum(dataStr[0].articleId, $strAdd)
- }
-
- }
-
- if(isbind==true){
- $("#proArticel").siblings(".tcdPageCode").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',
- 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 traget="_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 +'</p>';
- strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
- strAdd += '</div>';
- strAdd += '</a></li>';
-
- var $strAdd = $(strAdd);
- $("#proPatent").append( $strAdd);
- if(i==0){
- $("#showPatent").append(strAdd);
- }
- }
-
- if(isbind==true){
- $("#proPatent").siblings(".tcdPageCode").createPage({
- pageCount: Math.ceil(data.data.total / 10),
- current: data.data.pageNo,
- backFn: function(p) {
- $("#proPatent").html("");
- getArticle(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',
- 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 traget="_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 +'</p>';
- strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
- strAdd += '</div>';
- strAdd += '</a></li>';
-
- var $strAdd = $(strAdd);
- $("#proPaper").append( $strAdd);
- if(i==0){
- $("#showPaper").append(strAdd);
- }
- }
-
- if(isbind==true){
- $("#proPaper").siblings(".tcdPageCode").createPage({
- pageCount: Math.ceil(data.data.total / 10),
- current: data.data.pageNo,
- backFn: function(p) {
- $("#proPaper").html("");
- getArticle(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) {
- $itemlist.find("#comment").text("评论 " + data.data);
- }
- },
- "error": function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- });
- }
-
- })
|