portal html css js resource

userInforShow.js 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893
  1. $(function() {
  2. loginStatus();//判断个人是否登录
  3. var userid = $.cookie("userid");
  4. var professorId = GetQueryString("professorId");
  5. if(userid != professorId) {
  6. ifcollectionAbout(professorId, 1)
  7. $(".goSpan").show();
  8. }
  9. if(professorId) {
  10. getUserInfo(professorId);//获取个人详细信息
  11. historyEvaluate();//获取历史合作及评价
  12. getResource(10,1,true);//获取个人发布的资源
  13. getArticle(10,1,true);//获取个人发布的文章
  14. getPaper(10,1,true);//获取个人发布的论文
  15. getPatent(10,1,true);//获取个人发布的专利
  16. $.ajax({//我关注的
  17. type:"get",
  18. url:"/ajax/watch/countObject",
  19. data: {
  20. id: professorId,
  21. type: 1, //1:专家 2:资源 3:文章
  22. },
  23. async:true,
  24. success:function(data){
  25. if(data.success){
  26. if(data.data){
  27. $("#myFocus").html(data.data)
  28. }else{
  29. $("#myFocus").html("0")
  30. }
  31. }
  32. }
  33. });
  34. $.ajax({//关注我的
  35. type:"get",
  36. url:"/ajax/watch/countProfessor",
  37. data: {
  38. id: professorId,
  39. type: 1,
  40. },
  41. async:true,
  42. success:function(data){
  43. if(data.success){
  44. if(data.data){
  45. $("#focusMe").html(data.data)
  46. }else{
  47. $("#focusMe").html("0")
  48. }
  49. }
  50. }
  51. });
  52. //点击咨询按钮
  53. $("#conbtn").on('click', function(){
  54. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  55. ConsultApply();
  56. concultProInfo(professorId);
  57. //点击的发送
  58. $("#sendConsultBtn").click(function() {
  59. sendConsultHandler($(this).attr("proId"));
  60. });
  61. } else {
  62. $.MsgBox.Alert("提示", "请先登录再进行咨询");
  63. $("#mb_btn_ok").val("去登录");
  64. var aele = document.createElement('a');
  65. $("#mb_btnbox").append(aele);
  66. $("#mb_btnbox a").css({
  67. 'display': "block",
  68. 'width': '100%',
  69. 'height': '40px',
  70. 'position': 'absolute',
  71. 'bottom': '-6px',
  72. 'left': '0'
  73. });
  74. aele.setAttribute('href', '../login.html');
  75. }
  76. });
  77. //点击关注按钮
  78. $("#attentBtn").on('click', function() {
  79. if(userid && userid != null && userid != "null") {
  80. if($(this).is('.attenedSpan')){
  81. cancelCollectionAbout(professorId, 1)
  82. } else {
  83. collectionAbout(professorId, 1);
  84. }
  85. }else{
  86. $.MsgBox.Alert("提示", "请先登录再进行关注");
  87. $("#mb_btn_ok").val("去登录");
  88. var aele = document.createElement('a');
  89. $("#mb_btnbox").append(aele);
  90. $("#mb_btnbox a").css({
  91. 'display': "block",
  92. 'width': '100%',
  93. 'height': '40px',
  94. 'position': 'absolute',
  95. 'bottom': '-6px',
  96. 'left': '0'
  97. });
  98. aele.setAttribute('href', '../login.html');
  99. }
  100. });
  101. /*研究方向点赞*/
  102. var clFlag = 1;
  103. $("#researchAreaShow").on("click", ".plus", function() {
  104. if(userid && userid != null && userid != "null") {
  105. //点赞变化样式
  106. if(clFlag) {
  107. clFlag = 0;
  108. } else {
  109. return;
  110. }
  111. if($(this).data("isagree") > -1) {
  112. $(this).stop(true, true).animate({
  113. backgroundPositionY: 0
  114. }, 300); //变成未点赞样式
  115. } else {
  116. $(this).stop(true, true).animate({
  117. backgroundPositionY: -26
  118. }, 300); //变成点赞样式
  119. }
  120. $.ajax({
  121. "url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
  122. "type": "POST",
  123. "data": {
  124. "targetId": $(this).data("pid"),
  125. "targetCaption": oArray[$(this).data("caption")],
  126. "opId": userid
  127. },
  128. "contentType": "application/x-www-form-urlencoded",
  129. "success": function($data) {
  130. if($data.success) {
  131. $.get("/ajax/professor/info/" + professorId, function($data) {
  132. if($data.success) {
  133. clFlag = 1;
  134. var $info = $data.data;
  135. if($info) {
  136. $("#researchAreaShow").empty("")
  137. if($info.researchAreas) {
  138. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  139. }
  140. }
  141. }
  142. })
  143. } else {
  144. $.MsgBox.Alert("提示", $data.msg);
  145. }
  146. }
  147. });
  148. } else {
  149. $.MsgBox.Alert("提示", "请登录后点赞");
  150. }
  151. })
  152. //点击每个研究方向弹出研究方向详情窗口
  153. $("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
  154. var cap = $(this).attr("caption");
  155. $.ajax({
  156. url: "/ajax/researchAreaLog/ql",
  157. dataType: 'json', //数据格式类型
  158. type: 'GET', //http请求类型
  159. timeout: 10000, //超时设置
  160. data: {
  161. "professorId": professorId,
  162. 'caption': cap,
  163. "rows": 10
  164. },
  165. success: function(data) {
  166. console.log(data)
  167. if(data.success) {
  168. $(".listitemdiv").html("");
  169. var $info = data.data;
  170. $("#subArea").text(cap);
  171. $(".resAreaCover").fadeIn();
  172. $(".resAreaCon").show()
  173. if($info.length == 0) {
  174. $(".resAreaCon").hide();
  175. return;
  176. }
  177. for(var i = 0; i < $info.length; i++) {
  178. if($info[i].professor.hasHeadImage == 1) {
  179. var imgbg = "/images/head/" + $info[i].professor.id + "_l.jpg";
  180. } else {
  181. var imgbg = "../images/default-photo.jpg";
  182. }
  183. //认证
  184. var oSty=autho($info[i].professor.authType,$info[i].professor.orgAuth,$info[i].professor.authStatus);
  185. var title = $info[i].professor.title || "";
  186. var orgName = $info[i].professor.orgName || "";
  187. var office = $info[i].professor.office || "";
  188. if(title != "") {
  189. var ttitle = title + ",";
  190. }else{
  191. if(office!=""){
  192. var ttitle = office + ",";
  193. }else{
  194. var ttitle = office;
  195. }
  196. }
  197. if(orgName != "") {
  198. orgName = orgName;
  199. }
  200. var addw ='<li class="flexCenter" data-id="'+$info[i].professor.id+'">'
  201. addw +='<a href="userInforShow.html?professorId='+ $info[i].professor.id +'" class="expertUrl linkhref">'
  202. addw +='<div class="lefthead userheadt userRadius" id="expertImg" style="background-image: url('+ imgbg +');"></div>'
  203. addw +='<div class="centercon" style="padding-right:0;">'
  204. addw +='<p class="h1font"><span class="nameSpan" id="Name">' + $info[i].professor.name + '</span><em class="authiconNew ' + oSty.sty + '" title="'+ oSty.title +'"></em></p>'
  205. addw +='<p class="h2font ellipsisSty">'+ ttitle + orgName + '</p>'
  206. addw +='</div></a></li>';
  207. $(".listitemdiv").append(addw);
  208. }
  209. $("body").css("position", "fixed");
  210. }
  211. },
  212. error: function() {}
  213. });
  214. });
  215. //关闭按钮
  216. $("#workclose").click(function() {
  217. $(".resAreaCover").fadeOut();
  218. $("body").css("position", "");
  219. });
  220. //点击查看全部资源
  221. $(".coninfobox").on("click","#seeMoreR",function(){
  222. document.body.scrollTop = document.documentElement.scrollTop = 0;
  223. $(".navconBox ul>li").eq(1).addClass("liNow").siblings().removeClass("liNow");
  224. $("#item1user").hide();
  225. $("#item2user").show();
  226. })
  227. //点击查看全部文章
  228. $(".coninfobox").on("click","#seeMoreA",function(){
  229. document.body.scrollTop = document.documentElement.scrollTop = 0;
  230. $(".navconBox ul>li").eq(2).addClass("liNow").siblings().removeClass("liNow");
  231. $("#item1user").hide();
  232. $("#item3user").show();
  233. })
  234. //点击查看全部专利
  235. $(".coninfobox").on("click","#seeMoreP",function(){
  236. document.body.scrollTop = document.documentElement.scrollTop = 0;
  237. $(".navconBox ul>li").eq(3).addClass("liNow").siblings().removeClass("liNow");
  238. $("#item1user").hide();
  239. $("#item4user").show();
  240. })
  241. //点击查看全部论文
  242. $(".coninfobox").on("click","#seeMoreL",function(){
  243. document.body.scrollTop = document.documentElement.scrollTop = 0;
  244. $(".navconBox ul>li").eq(4).addClass("liNow").siblings().removeClass("liNow");
  245. $("#item1user").hide();
  246. $("#item5user").show();
  247. })
  248. }
  249. var subjectShow = function(data) {
  250. if(data != undefined && data.length != 0) {
  251. var subs = new Array();
  252. if(data.indexOf(',')) {
  253. subs = data.split(',');
  254. } else {
  255. subs[0] = data;
  256. }
  257. if(subs.length > 0) {
  258. for(var i = 0; i < subs.length; i++) {
  259. $("#subjectShow").append("<li>" + subs[i] + "</li>");
  260. };
  261. }
  262. }
  263. }
  264. var oArray=[];
  265. var researchAreaShow = function($datas, $datarecords) {
  266. if($datas != undefined && $datas.length != 0) {
  267. var html = [];
  268. for(var i = 0; i < $datas.length; ++i) {
  269. var $data = $datas[i];
  270. var $photos = [];
  271. //获取头像
  272. if($datarecords.length > 0) {
  273. $photos = getRecords($datarecords, $data.caption);
  274. }
  275. var isAgree = -1;
  276. for(var j = 0; j < $photos.length; j++) {
  277. if(userid == $photos[j].id)
  278. isAgree++;
  279. }
  280. oArray[i]=$data.caption;
  281. if(professorId != userid) {
  282. if(isAgree) {
  283. 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 +'">';
  284. } else {
  285. 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 +'">';
  286. }
  287. } else {
  288. var showDiv = '<li><div class="favorBox" caption="'+ $data.caption +'"><span class="like">'+ $data.count +'</span>'+ $data.caption +'</div><div class="favorCount" caption="'+ $data.caption +'">';
  289. }
  290. if($photos.length < 6) {
  291. for(var j = 0; j < $photos.length; ++j) {
  292. if($photos[j].img) {
  293. showDiv += '<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
  294. } else {
  295. showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
  296. }
  297. }
  298. } else {
  299. for(var j = $photos.length - 5; j < $photos.length; ++j) {
  300. if($photos[j].img) {
  301. showDiv +='<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
  302. } else {
  303. showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
  304. }
  305. }
  306. showDiv += '<span class="like-people like-more"></span>';
  307. }
  308. showDiv += "</div></li>";
  309. html.push(showDiv);
  310. }
  311. document.getElementById("researchAreaShow").innerHTML = html.join('');
  312. }
  313. }
  314. var industryShow = function(data) {
  315. if(data != undefined && data.length != 0) {
  316. var subs = new Array();
  317. if(data.indexOf(',')) {
  318. subs = data.split(',');
  319. } else {
  320. subs[0] = data;
  321. }
  322. if(subs.length > 0) {
  323. for(var i = 0; i < subs.length; i++) {
  324. $("#industryShow").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
  325. };
  326. }
  327. }
  328. }
  329. var projectShow = function(data) {
  330. if(data.length > 0) {
  331. for(var i = 0; i < data.length; i++) {
  332. if(!data[i].descp) {
  333. data[i].descp = "";
  334. }
  335. if(!data[i].startMonth) {
  336. data[i].startMonth = '';
  337. data[i].stopMonth = '';
  338. } else {
  339. data[i].startMonth = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月 - "
  340. if(!data[i].stopMonth) {
  341. data[i].stopMonth = '至今';
  342. } else {
  343. data[i].stopMonth = data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6)+ "月"
  344. }
  345. }
  346. var projectHtml = '<li>';
  347. projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].startMonth + '' + data[i].stopMonth + '</small></div>';
  348. projectHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  349. projectHtml += '</li>';
  350. $("#projectShow").append(projectHtml);
  351. }
  352. }
  353. }
  354. var honorShow = function(data) {
  355. if(data.length > 0) {
  356. for(var i = 0; i < data.length; i++) {
  357. if(!data[i].year) {
  358. data[i].year = "";
  359. }
  360. if(!data[i].descp) {
  361. data[i].descp = "";
  362. }
  363. var honorHtml = '<li>';
  364. honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].year + '年</small></div>';
  365. honorHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  366. honorHtml += '</li>';
  367. $("#honorShow").append(honorHtml);
  368. }
  369. }
  370. }
  371. var timeJobShow = function(data) {
  372. if(data.length > 0) {
  373. for(var i = 0; i < data.length; i++) {
  374. var sDate = "";
  375. var eDate = "";
  376. if(data[i].department) {
  377. var dep = "-" + data[i].department;
  378. } else {
  379. var dep = ""
  380. }
  381. if(data[i].startMonth) {
  382. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月 - ";
  383. if(data[i].stopMonth) {
  384. eDate = data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  385. } else {
  386. eDate = "至今";
  387. }
  388. }
  389. var JobHtml = '<li>';
  390. JobHtml += '<div class="h4Font h4tit">' + data[i].company + '-' + data[i].title + '' + dep + '<small class="h6Font">' + sDate + '' + eDate + '</small></div>';
  391. JobHtml += '</li>';
  392. $("#timeJobShow").append(JobHtml);
  393. }
  394. }
  395. }
  396. var eduBgShow = function(data) {
  397. if(data.length > 0) {
  398. for(var i = 0; i < data.length; i++) {
  399. var showHtml = '<li><div class="h4Font h4tit">';
  400. if(data[i].college && data[i].major && data[i].degree) {
  401. showHtml += data[i].school + '-' + data[i].college + '-' + data[i].major + '-' + data[i].degree
  402. } else if(!data[i].college && data[i].major && data[i].degree) {
  403. showHtml += data[i].school + '-' + data[i].major + '-' + data[i].degree
  404. } else if(data[i].college && !data[i].major && data[i].degree) {
  405. showHtml += data[i].school + '-' + data[i].college + '-' + data[i].degree
  406. } else if(data[i].college && data[i].major && !data[i].degree) {
  407. showHtml += data[i].school + '-' + data[i].college + '-' + data[i].major
  408. } else if(!data[i].college && !data[i].major && data[i].degree) {
  409. showHtml += data[i].school + '-' + data[i].degree
  410. } else if(!data[i].college && data[i].major && !data[i].degree) {
  411. showHtml += data[i].school + '-' + data[i].major
  412. } else if(data[i].college && !data[i].major && !data[i].degree) {
  413. showHtml += data[i].school + '-' + data[i].college
  414. }
  415. if(typeof(data[i].year) !== "undefined") {
  416. showHtml += '<small class="h6Font">' + data[i].year + '年</small>';
  417. } else {
  418. showHtml += "";
  419. }
  420. showHtml += "</div></li>";
  421. $("#eduBgShow").append(showHtml);
  422. }
  423. }
  424. }
  425. //判断点赞的用户是否有头像
  426. function getRecords($researchAreaLogs, caption) {
  427. var ret = [];
  428. var t = 0;
  429. for(var i = 0; i < $researchAreaLogs.length; i++) {
  430. if(caption == $researchAreaLogs[i].caption) {
  431. ret[t] = {
  432. id: $researchAreaLogs[i].opreteProfessorId,
  433. img: $researchAreaLogs[i].hasHeadImage
  434. }
  435. t++;
  436. }
  437. }
  438. return ret;
  439. }
  440. //用户详细信息
  441. function getUserInfo(professorId){
  442. $.ajax({
  443. type:"get",
  444. url:"/ajax/professor/info/"+ professorId,
  445. async:true,
  446. success: function(data) {
  447. var $info = data.data;
  448. if(data.success) {
  449. if($info.hasHeadImage){
  450. $("#proHead").css("background-image","url(/images/head/"+ $info.id +"_l.jpg)");
  451. }
  452. $("#proName").text($info.name);
  453. var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
  454. $("#proAuth").addClass(oStyS.sty); $("#proAuth").attr("title",oStyS.title);
  455. if($info.address){
  456. $("#proAddress").html($info.address + "<span style='margin-right:10px;'></span>");
  457. }
  458. var proOther="";
  459. if($info.orgName){
  460. if($info.department){
  461. if($info.office){
  462. proOther = $info.orgName + "," + $info.department + "," + $info.office
  463. }else{
  464. proOther = $info.orgName + "," + $info.department
  465. }
  466. }else{
  467. proOther = $info.orgName
  468. }
  469. }
  470. $("#proOther").text(proOther);
  471. var llqtitle=$info.name + "-" + proOther.replace(/,/gi,"-") + "-科袖网";//修改浏览器title信息
  472. if($info.title){
  473. $("#proTit").html($info.title + "<span style='margin-right:10px;'></span>");
  474. llqtitle = $info.name + "-" + $info.title + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
  475. }
  476. document.title = llqtitle;
  477. //个人简介
  478. if($info.descp) {
  479. $("#descpS").parents(".coninfobox").removeClass("displayNone");
  480. $("#item1user>.nodatabox").addClass("displayNone");
  481. $("#descpS").text($info.descp);
  482. }
  483. //学术领域
  484. if($info.subject) {
  485. $("#subjectShow").parents(".coninfobox").removeClass("displayNone");
  486. $("#item1user>.nodatabox").addClass("displayNone");
  487. subjectShow($info.subject);
  488. }
  489. //研究方向
  490. if($info.researchAreas.length) {
  491. $("#researchAreaShow").parents(".coninfobox").removeClass("displayNone");
  492. $("#item1user>.nodatabox").addClass("displayNone");
  493. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  494. }
  495. //行业领域
  496. if($info.industry) {
  497. $("#industryShow").parents(".coninfobox").removeClass("displayNone");
  498. $("#item1user>.nodatabox").addClass("displayNone");
  499. industryShow($info.industry);
  500. }
  501. //教育背景
  502. if($info.edus.length) {
  503. eduBgShow($info.edus);
  504. } else {
  505. $("#eduBgShow").parents(".coninfobox").hide();
  506. }
  507. //兼职
  508. if($info.jobs.length) {
  509. timeJobShow($info.jobs);
  510. } else {
  511. $("#timeJobShow").parents(".coninfobox").hide();
  512. }
  513. //项目
  514. if($info.projects.length) {
  515. projectShow($info.projects)
  516. } else {
  517. $("#projectShow").parents(".coninfobox").hide();
  518. }
  519. //荣誉
  520. if($info.honors.length) {
  521. honorShow($info.honors);
  522. } else {
  523. $("#honorShow").parents(".coninfobox").hide();
  524. }
  525. if($info.honors.length == 0 && $info.projects.length == 0 && $info.jobs.length == 0 && $info.edus.length == 0){
  526. $("#item6user>.nodatabox").show();
  527. $("#item6user>.nodatabox").find(".noContip").text("主人尚未完善详细资料")
  528. }
  529. var weibotitle = $info.name;
  530. var weibourl = window.location.href;
  531. var weibopic ="http://"+window.location.host+"/images/head/"+ $info.id +"_l.jpg";
  532. $("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
  533. }
  534. },
  535. error: function() {
  536. $.MsgBox.Alert('提示', '链接服务器超时')
  537. }
  538. });
  539. }
  540. //合作历史及评价
  541. function historyEvaluate(){
  542. $.ajax({
  543. "url": "/ajax/consult/pqAssessHis",
  544. "type": "get",
  545. "data": {
  546. "professorId": professorId
  547. },
  548. "async": false,
  549. "success": function(response) {
  550. if(response.success) {
  551. var $data = response.data.data;
  552. if($data.length>0){
  553. $("#historyEvaluate").parents(".coninfobox").removeClass("displayNone");
  554. $("#item1user>.nodatabox").addClass("displayNone");
  555. for(var i = 0; i < $data.length; i++) {
  556. var assessTime = commenTime($data[i].assessTime);
  557. var assessContant ="";
  558. if($data[i].assessContant) {
  559. assessContant = $data[i].assessContant;
  560. }
  561. var userhed='';
  562. if($data[i].professor.hasHeadImage) {
  563. userhed = 'background-image:url(/images/head/' + $data[i].professor.id + '_l.jpg)';
  564. } else {
  565. userhed = 'background-image:url(/images/default-photo.jpg)';
  566. }
  567. var add = "";
  568. add += '<li class="flexCenter">';
  569. add += '<a href="userInforShow.html?professorId='+ $data[i].professor.id +'" class="userhref"><div class="madiaHead useHead useHeadMsg" style="'+ userhed +'"></div></a>'
  570. add += '<div class="madiaInfo"><div style="position: relative;">';
  571. add += '<a href="userInforShow.html?professorId='+ $data[i].professor.id +'" class="userhref"><span class="h1Font messageName">'+ $data[i].professor.name +'</span></a>';
  572. add += '<em class="authiconNew authicon-pro" title=" "></em><span class="commenttime">'+ assessTime +'</span>';
  573. add += '<ul class="starShow">';
  574. add += '<li></li> <li></li> <li></li> <li></li> <li></li>';
  575. add += '</ul></div>';
  576. add += '<p class="h2Font messageContent">'+ assessContant +'</p>';
  577. add += '</div></li>';
  578. var $add = $(add);
  579. $("#historyEvaluate").append($add);
  580. $add.find(".starShow>li:lt(" + $data[i].assessStar + ")").addClass('evastar');
  581. }
  582. }else{
  583. }
  584. }
  585. }
  586. })
  587. }
  588. //获取资源
  589. function getResource(pageSize, pageNo,isbind){
  590. $.ajax({
  591. "url": "/ajax/resource/pqProPublish",
  592. "type": "get",
  593. "async": false,
  594. "data": {
  595. "professorId": professorId,
  596. "pageSize": pageSize,
  597. "pageNo": pageNo
  598. },
  599. "success": function(data) {
  600. console.log(data);
  601. if(data.success) {
  602. var madiaHead ='';
  603. var dataStr=data.data.data;
  604. if(dataStr.length > 0){
  605. $("#showResource").parents(".coninfobox").removeClass("displayNone");
  606. $("#item1user>.nodatabox").addClass("displayNone");
  607. for(var i = 0; i < dataStr.length; i++) {
  608. if(dataStr[i].images.length) {
  609. madiaHead ='/data/resource/' + dataStr[i].images[0].imageSrc ;
  610. }else{
  611. madiaHead ='/images/default-resource.jpg';
  612. }
  613. var strAdd = '';
  614. strAdd += '<li><a traget="_blank" href="resourceShow.html?resourceId='+ dataStr[i].resourceId +'" class="flexCenter urlgo">';
  615. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ madiaHead +')"></div>';
  616. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr[i].resourceName +'</p><p class="h2Font ellipsisSty">应用用途:'+ dataStr[i].supportedServices+'</p></div>';
  617. strAdd += '</a></li>';
  618. if(i==0){
  619. $("#showResource").append(strAdd);
  620. }
  621. $("#proResource").append(strAdd);
  622. }
  623. //分页
  624. if(isbind==true){
  625. $("#proResource").siblings(".tcdPageCode").createPage({
  626. pageCount: Math.ceil(data.data.total / 10),
  627. current: data.data.pageNo,
  628. backFn: function(p) {
  629. $("#proResource").html("");
  630. getResource(10, p,false);
  631. document.body.scrollTop = document.documentElement.scrollTop = 0;
  632. }
  633. });
  634. }
  635. }else{
  636. $("#proResource + .nodatabox").show();
  637. $("#proResource + .nodatabox").find(".noContip").text("主人尚未发布任何资源");
  638. }
  639. }
  640. },
  641. "error": function() {
  642. $.MsgBox.Alert("提示", "服务器连接超时")
  643. }
  644. });
  645. }
  646. //获取文章
  647. function getArticle(pageSize, pageNo,isbind){
  648. $.ajax({
  649. url: "/ajax/article/pqProPublish",
  650. dataType: 'json', //数据格式类型
  651. type: 'GET', //http请求类型
  652. data: {
  653. "professorId": professorId,
  654. "pageSize": pageSize,
  655. "pageNo": pageNo
  656. },
  657. timeout: 10000, //超时设置
  658. success: function(data) {
  659. if(data.success) {
  660. var madiaHead ='/images/default-artical.jpg';
  661. var dataStr=data.data.data;
  662. if(dataStr.length > 0){
  663. $("#showArticle").parents(".coninfobox").removeClass("displayNone");
  664. $("#item1user>.nodatabox").addClass("displayNone");
  665. for(var i = 0; i < dataStr.length; i++) {
  666. if(dataStr[i].articleImg) {
  667. madiaHead ='/data/article/' + dataStr[i].articleImg ;
  668. }
  669. var strAdd = '';
  670. strAdd += '<li><a traget="_blank" href="articalShow.html?articleId='+ dataStr[i].articleId +'" class="flexCenter urlgo">';
  671. strAdd += '<div class="madiaHead artHead" style="background-image:url('+ madiaHead +')"></div>';
  672. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr[i].articleTitle +'</p>';
  673. strAdd += '<ul class="h2Font clearfix">';
  674. strAdd += '<li><span class="time">'+ commenTime(dataStr[i].publishTime) +'</span></li>';
  675. strAdd += '<li><span id="pageViews">阅读量 '+ dataStr[i].pageViews +'</span></li>';
  676. strAdd += '<li><span id="articleAgree">点赞 '+ dataStr[i].articleAgree +'</span></li>';
  677. strAdd += '<li><span id="comment"></span></li>';
  678. strAdd += '</ul></div>';
  679. strAdd += '</a></li>';
  680. var $strAdd = $(strAdd);
  681. $("#proArticel").append( $strAdd);
  682. commentnum(dataStr[i].articleId, $strAdd) //文章评论数
  683. if(i==0){
  684. $("#showArticle").append(strAdd);
  685. commentnum(dataStr[0].articleId, $strAdd)
  686. }
  687. }
  688. //分页
  689. if(isbind==true){
  690. $("#proArticel").siblings(".tcdPageCode").createPage({
  691. pageCount: Math.ceil(data.data.total / 10),
  692. current: data.data.pageNo,
  693. backFn: function(p) {
  694. $("#proArticel").html("");
  695. getArticle(10, p,false);
  696. document.body.scrollTop = document.documentElement.scrollTop = 0;
  697. }
  698. });
  699. }
  700. }else{
  701. $("#proArticel + .nodatabox").show();
  702. $("#proArticel + .nodatabox").find(".noContip").text("主人尚未发布任何文章");
  703. }
  704. }
  705. },
  706. error: function() {
  707. return;
  708. }
  709. });
  710. }
  711. //获取专利
  712. function getPatent(pageSize, pageNo,isbind){
  713. $.ajax({
  714. url: "/ajax/ppatent/byProfessor",
  715. dataType: 'json', //数据格式类型
  716. type: 'GET', //http请求类型
  717. data: {
  718. "id": professorId,
  719. "pageSize": pageSize,
  720. "pageNo": pageNo
  721. },
  722. timeout: 10000, //超时设置
  723. success: function(data) {
  724. if(data.success) {
  725. var dataStr=data.data.data;
  726. if(dataStr.length > 0){
  727. $("#showPatent").parents(".coninfobox").removeClass("displayNone");
  728. $("#item1user>.nodatabox").addClass("displayNone");
  729. for(var i = 0; i < dataStr.length; i++) {
  730. if(!dataStr[i].reqPerson){
  731. dataStr[i].reqPerson="";
  732. }
  733. var strAdd = '';
  734. strAdd += '<li><a traget="_blank" href="patentShow.html?patentId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  735. strAdd += '<div class="madiaHead patentHead"></div>';
  736. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  737. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors +'</p>';
  738. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  739. strAdd += '</div>';
  740. strAdd += '</a></li>';
  741. var $strAdd = $(strAdd);
  742. $("#proPatent").append( $strAdd);
  743. if(i==0){
  744. $("#showPatent").append(strAdd);
  745. }
  746. }
  747. //分页
  748. if(isbind==true){
  749. $("#proPatent").siblings(".tcdPageCode").createPage({
  750. pageCount: Math.ceil(data.data.total / 10),
  751. current: data.data.pageNo,
  752. backFn: function(p) {
  753. $("#proPatent").html("");
  754. getArticle(10, p,false);
  755. document.body.scrollTop = document.documentElement.scrollTop = 0;
  756. }
  757. });
  758. }
  759. }else{
  760. $("#proPatent + .nodatabox").show();
  761. $("#proPatent + .nodatabox").find(".noContip").text("主人尚未导入任何专利");
  762. }
  763. }
  764. },
  765. error: function() {
  766. return;
  767. }
  768. });
  769. }
  770. //获取论文
  771. function getPaper(pageSize, pageNo,isbind){
  772. $.ajax({
  773. url: "/ajax/ppaper/byProfessor",
  774. dataType: 'json', //数据格式类型
  775. type: 'GET', //http请求类型
  776. data: {
  777. "id": professorId,
  778. "pageSize": pageSize,
  779. "pageNo": pageNo
  780. },
  781. timeout: 10000, //超时设置
  782. success: function(data) {
  783. if(data.success) {
  784. var dataStr=data.data.data;
  785. if(dataStr.length > 0){
  786. $("#showPaper").parents(".coninfobox").removeClass("displayNone");
  787. $("#item1user>.nodatabox").addClass("displayNone");
  788. for(var i = 0; i < dataStr.length; i++) {
  789. var moreInf=""
  790. if(!dataStr[i].cn4periodical){
  791. dataStr[i].cn4periodical="";
  792. }
  793. if(!dataStr[i].en4periodical){
  794. dataStr[i].en4periodical="";
  795. }
  796. if(!dataStr[i].pubDay){
  797. dataStr[i].pubDay="";
  798. }
  799. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  800. var strAdd = '';
  801. strAdd += '<li><a traget="_blank" href="paperShow.html?paperId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  802. strAdd += '<div class="madiaHead paperHead"></div>';
  803. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  804. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors +'</p>';
  805. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  806. strAdd += '</div>';
  807. strAdd += '</a></li>';
  808. var $strAdd = $(strAdd);
  809. $("#proPaper").append( $strAdd);
  810. if(i==0){
  811. $("#showPaper").append(strAdd);
  812. }
  813. }
  814. //分页
  815. if(isbind==true){
  816. $("#proPaper").siblings(".tcdPageCode").createPage({
  817. pageCount: Math.ceil(data.data.total / 10),
  818. current: data.data.pageNo,
  819. backFn: function(p) {
  820. $("#proPaper").html("");
  821. getArticle(10, p,false);
  822. document.body.scrollTop = document.documentElement.scrollTop = 0;
  823. }
  824. });
  825. }
  826. }else{
  827. $("#proPaper + .nodatabox").show();
  828. $("#proPaper + .nodatabox").find(".noContip").text("主人尚未导入任何论文");
  829. }
  830. }
  831. },
  832. error: function() {
  833. return;
  834. }
  835. });
  836. }
  837. //查文章评论数
  838. function commentnum(articleId, $itemlist) {
  839. $.ajax({
  840. "url": "/ajax/leaveWord/lwCount",
  841. "type": "GET",
  842. "dataType": "json",
  843. "async": false,
  844. "data": {
  845. "articleId": articleId
  846. },
  847. "success": function(data) {
  848. if(data.success) {
  849. $itemlist.find("#comment").text("评论 " + data.data);
  850. }
  851. },
  852. "error": function() {
  853. $.MsgBox.Alert('提示', '链接服务器超时')
  854. }
  855. });
  856. }
  857. })