portal html css js resource

userInforShow.js 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  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. var sDate = "";
  336. var eDate = "";
  337. if(data[i].startMonth) {
  338. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
  339. sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
  340. if(data[i].stopMonth) {
  341. eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  342. } else {
  343. eDate = " - "+ "至今";
  344. }
  345. }
  346. var projectHtml = '<li>';
  347. projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + sDate + eDate + '</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. var timeho="";
  358. if(data[i].year){
  359. timeho = data[i].year+'年';
  360. }else{
  361. data[i].year="";
  362. }
  363. if(!data[i].descp) {
  364. data[i].descp = "";
  365. }
  366. var honorHtml = '<li>';
  367. honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + timeho + '</small></div>';
  368. honorHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  369. honorHtml += '</li>';
  370. $("#honorShow").append(honorHtml);
  371. }
  372. }
  373. }
  374. var timeJobShow = function(data) {
  375. if(data.length > 0) {
  376. for(var i = 0; i < data.length; i++) {
  377. if(data[i].department) {
  378. var dep = "-" + data[i].department;
  379. } else {
  380. var dep = ""
  381. }
  382. var sDate = "";
  383. var eDate = "";
  384. if(data[i].startMonth) {
  385. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
  386. sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
  387. if(data[i].stopMonth) {
  388. eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  389. } else {
  390. eDate = " - "+ "至今";
  391. }
  392. }
  393. var JobHtml = '<li>';
  394. JobHtml += '<div class="h4Font h4tit">' + data[i].company + '-' + data[i].title + '' + dep + '<small class="h6Font">' + sDate + eDate + '</small></div>';
  395. JobHtml += '</li>';
  396. $("#timeJobShow").append(JobHtml);
  397. }
  398. }
  399. }
  400. var eduBgShow = function(data) {
  401. if(data.length > 0) {
  402. for(var i = 0; i < data.length; i++) {
  403. var college="",major="",degree=""
  404. if(data[i].college){
  405. college =' - ' + data[i].college
  406. }else{
  407. data[i].college="";
  408. }
  409. if(data[i].major){
  410. major =' - ' + data[i].major
  411. }else{
  412. data[i].major="";
  413. }
  414. if(data[i].degree){
  415. degree =' - ' + eduDegree[data[i].degree]
  416. if(data[i].degree==0){
  417. degree =""
  418. }
  419. }else{
  420. data[i].degree="";
  421. }
  422. var timebiye="";
  423. if(data[i].year){
  424. if(data[i].year.trim()=="至今"){
  425. timebiye=data[i].year;
  426. }else{
  427. timebiye=data[i].year+'年';
  428. }
  429. }else{
  430. timebiye="";
  431. }
  432. var showHtml = '<li><div class="h4Font h4tit">'
  433. showHtml += data[i].school + college + major + degree;
  434. showHtml +='<small class="h6Font">' + timebiye + '</small></div></li>';
  435. $("#eduBgShow").append(showHtml);
  436. }
  437. }
  438. }
  439. //判断点赞的用户是否有头像
  440. function getRecords($researchAreaLogs, caption) {
  441. var ret = [];
  442. var t = 0;
  443. for(var i = 0; i < $researchAreaLogs.length; i++) {
  444. if(caption == $researchAreaLogs[i].caption) {
  445. ret[t] = {
  446. id: $researchAreaLogs[i].opreteProfessorId,
  447. img: $researchAreaLogs[i].hasHeadImage
  448. }
  449. t++;
  450. }
  451. }
  452. return ret;
  453. }
  454. //用户详细信息
  455. function getUserInfo(professorId){
  456. $.ajax({
  457. type:"get",
  458. url:"/ajax/professor/info/"+ professorId,
  459. async:true,
  460. success: function(data) {
  461. var $info = data.data;
  462. if(data.success) {
  463. if($info.hasHeadImage){
  464. $("#proHead").css("background-image","url(/images/head/"+ $info.id +"_l.jpg)");
  465. }
  466. $("#proName").text($info.name);
  467. var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
  468. $("#proAuth").addClass(oStyS.sty); $("#proAuth").attr("title",oStyS.title);
  469. if($info.address){
  470. $("#proAddress").html($info.address + "<span style='margin-right:10px;'></span>");
  471. }
  472. var proOther="";
  473. if($info.orgName){
  474. if($info.department){
  475. if($info.office){
  476. proOther = $info.orgName + "," + $info.department + "," + $info.office
  477. }else{
  478. proOther = $info.orgName + "," + $info.department
  479. }
  480. }else{
  481. proOther = $info.orgName
  482. }
  483. }
  484. $("#proOther").text(proOther);
  485. var llqtitle=$info.name + "-" + proOther.replace(/,/gi,"-") + "-科袖网";//修改浏览器title信息
  486. if($info.title){
  487. $("#proTit").html($info.title + "<span style='margin-right:10px;'></span>");
  488. llqtitle = $info.name + "-" + $info.title + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
  489. }
  490. document.title = llqtitle;
  491. //个人简介
  492. if($info.descp) {
  493. $("#descpS").parents(".coninfobox").removeClass("displayNone");
  494. $("#item1user>.nodatabox").addClass("displayNone");
  495. $("#descpS").text($info.descp);
  496. }
  497. //学术领域
  498. if($info.subject) {
  499. $("#subjectShow").parents(".coninfobox").removeClass("displayNone");
  500. $("#item1user>.nodatabox").addClass("displayNone");
  501. subjectShow($info.subject);
  502. }
  503. //研究方向
  504. if($info.researchAreas.length) {
  505. $("#researchAreaShow").parents(".coninfobox").removeClass("displayNone");
  506. $("#item1user>.nodatabox").addClass("displayNone");
  507. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  508. }
  509. //行业领域
  510. if($info.industry) {
  511. $("#industryShow").parents(".coninfobox").removeClass("displayNone");
  512. $("#item1user>.nodatabox").addClass("displayNone");
  513. industryShow($info.industry);
  514. }
  515. //教育背景
  516. if($info.edus.length) {
  517. eduBgShow($info.edus);
  518. } else {
  519. $("#eduBgShow").parents(".coninfobox").hide();
  520. }
  521. //兼职
  522. if($info.jobs.length) {
  523. timeJobShow($info.jobs);
  524. } else {
  525. $("#timeJobShow").parents(".coninfobox").hide();
  526. }
  527. //项目
  528. if($info.projects.length) {
  529. projectShow($info.projects)
  530. } else {
  531. $("#projectShow").parents(".coninfobox").hide();
  532. }
  533. //荣誉
  534. if($info.honors.length) {
  535. honorShow($info.honors);
  536. } else {
  537. $("#honorShow").parents(".coninfobox").hide();
  538. }
  539. if($info.honors.length == 0 && $info.projects.length == 0 && $info.jobs.length == 0 && $info.edus.length == 0){
  540. $("#item6user>.nodatabox").show();
  541. $("#item6user>.nodatabox").find(".noContip").text("主人尚未完善详细资料")
  542. }
  543. var weibotitle = $info.name;
  544. var weibourl = window.location.href;
  545. var weibopic ="http://"+window.location.host+"/images/head/"+ $info.id +"_l.jpg";
  546. $("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
  547. }
  548. },
  549. error: function() {
  550. $.MsgBox.Alert('提示', '链接服务器超时')
  551. }
  552. });
  553. }
  554. //合作历史及评价
  555. function historyEvaluate(){
  556. $.ajax({
  557. "url": "/ajax/consult/pqAssessHis",
  558. "type": "get",
  559. "data": {
  560. "professorId": professorId
  561. },
  562. "async": false,
  563. "success": function(response) {
  564. if(response.success) {
  565. var $data = response.data.data;
  566. if($data.length>0){
  567. $("#historyEvaluate").parents(".coninfobox").removeClass("displayNone");
  568. $("#item1user>.nodatabox").addClass("displayNone");
  569. for(var i = 0; i < $data.length; i++) {
  570. var assessTime = commenTime($data[i].assessTime);
  571. var assessContant ="";
  572. if($data[i].assessContant) {
  573. assessContant = $data[i].assessContant;
  574. }
  575. var userhed='';
  576. if($data[i].professor.hasHeadImage) {
  577. userhed = 'background-image:url(/images/head/' + $data[i].professor.id + '_l.jpg)';
  578. } else {
  579. userhed = 'background-image:url(/images/default-photo.jpg)';
  580. }
  581. var add = "";
  582. add += '<li class="flexCenter">';
  583. add += '<a href="userInforShow.html?professorId='+ $data[i].professor.id +'" class="userhref"><div class="madiaHead useHead useHeadMsg" style="'+ userhed +'"></div></a>'
  584. add += '<div class="madiaInfo"><div style="position: relative;">';
  585. add += '<a href="userInforShow.html?professorId='+ $data[i].professor.id +'" class="userhref"><span class="h1Font messageName">'+ $data[i].professor.name +'</span></a>';
  586. add += '<em class="authiconNew authicon-pro" title=" "></em><span class="commenttime">'+ assessTime +'</span>';
  587. add += '<ul class="starShow">';
  588. add += '<li></li> <li></li> <li></li> <li></li> <li></li>';
  589. add += '</ul></div>';
  590. add += '<p class="h2Font messageContent">'+ assessContant +'</p>';
  591. add += '</div></li>';
  592. var $add = $(add);
  593. $("#historyEvaluate").append($add);
  594. $add.find(".starShow>li:lt(" + $data[i].assessStar + ")").addClass('evastar');
  595. }
  596. }else{
  597. }
  598. }
  599. }
  600. })
  601. }
  602. //获取资源
  603. function getResource(pageSize, pageNo,isbind){
  604. $.ajax({
  605. "url": "/ajax/resource/pqProPublish",
  606. "type": "get",
  607. "async": false,
  608. "data": {
  609. "professorId": professorId,
  610. "pageSize": pageSize,
  611. "pageNo": pageNo
  612. },
  613. "success": function(data) {
  614. console.log(data);
  615. if(data.success) {
  616. var madiaHead ='';
  617. var dataStr=data.data.data;
  618. if(dataStr.length > 0){
  619. $("#showResource").parents(".coninfobox").removeClass("displayNone");
  620. $("#item1user>.nodatabox").addClass("displayNone");
  621. for(var i = 0; i < dataStr.length; i++) {
  622. if(dataStr[i].images.length) {
  623. madiaHead ='/data/resource/' + dataStr[i].images[0].imageSrc ;
  624. }else{
  625. madiaHead ='/images/default-resource.jpg';
  626. }
  627. var strAdd = '';
  628. strAdd += '<li><a traget="_blank" href="resourceShow.html?resourceId='+ dataStr[i].resourceId +'" class="flexCenter urlgo">';
  629. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ madiaHead +')"></div>';
  630. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr[i].resourceName +'</p><p class="h2Font ellipsisSty">应用用途:'+ dataStr[i].supportedServices+'</p></div>';
  631. strAdd += '</a></li>';
  632. if(i==0){
  633. $("#showResource").append(strAdd);
  634. }
  635. $("#proResource").append(strAdd);
  636. }
  637. //分页
  638. if(isbind==true){
  639. $("#proResource").siblings(".tcdPageCode").createPage({
  640. pageCount: Math.ceil(data.data.total / 10),
  641. current: data.data.pageNo,
  642. backFn: function(p) {
  643. $("#proResource").html("");
  644. getResource(10, p,false);
  645. document.body.scrollTop = document.documentElement.scrollTop = 0;
  646. }
  647. });
  648. }
  649. }else{
  650. $("#proResource + .nodatabox").show();
  651. $("#proResource + .nodatabox").find(".noContip").text("主人尚未发布任何资源");
  652. }
  653. }
  654. },
  655. "error": function() {
  656. $.MsgBox.Alert("提示", "服务器连接超时")
  657. }
  658. });
  659. }
  660. //获取文章
  661. function getArticle(pageSize, pageNo,isbind){
  662. $.ajax({
  663. url: "/ajax/article/pqProPublish",
  664. dataType: 'json', //数据格式类型
  665. type: 'GET', //http请求类型
  666. data: {
  667. "professorId": professorId,
  668. "pageSize": pageSize,
  669. "pageNo": pageNo
  670. },
  671. timeout: 10000, //超时设置
  672. success: function(data) {
  673. if(data.success) {
  674. var madiaHead ='/images/default-artical.jpg';
  675. var dataStr=data.data.data;
  676. if(dataStr.length > 0){
  677. $("#showArticle").parents(".coninfobox").removeClass("displayNone");
  678. $("#item1user>.nodatabox").addClass("displayNone");
  679. for(var i = 0; i < dataStr.length; i++) {
  680. if(dataStr[i].articleImg) {
  681. madiaHead ='/data/article/' + dataStr[i].articleImg ;
  682. }
  683. var strAdd = '';
  684. strAdd += '<li><a traget="_blank" href="articalShow.html?articleId='+ dataStr[i].articleId +'" class="flexCenter urlgo">';
  685. strAdd += '<div class="madiaHead artHead" style="background-image:url('+ madiaHead +')"></div>';
  686. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr[i].articleTitle +'</p>';
  687. strAdd += '<ul class="h2Font clearfix">';
  688. strAdd += '<li><span class="time">'+ commenTime(dataStr[i].publishTime) +'</span></li>';
  689. strAdd += '<li><span id="pageViews">阅读量 '+ dataStr[i].pageViews +'</span></li>';
  690. strAdd += '<li><span id="articleAgree">点赞 '+ dataStr[i].articleAgree +'</span></li>';
  691. strAdd += '<li><span id="comment"></span></li>';
  692. strAdd += '</ul></div>';
  693. strAdd += '</a></li>';
  694. var $strAdd = $(strAdd);
  695. $("#proArticel").append( $strAdd);
  696. commentnum(dataStr[i].articleId, $strAdd) //文章评论数
  697. if(i==0){
  698. $("#showArticle").append(strAdd);
  699. commentnum(dataStr[0].articleId, $strAdd)
  700. }
  701. }
  702. //分页
  703. if(isbind==true){
  704. $("#proArticel").siblings(".tcdPageCode").createPage({
  705. pageCount: Math.ceil(data.data.total / 10),
  706. current: data.data.pageNo,
  707. backFn: function(p) {
  708. $("#proArticel").html("");
  709. getArticle(10, p,false);
  710. document.body.scrollTop = document.documentElement.scrollTop = 0;
  711. }
  712. });
  713. }
  714. }else{
  715. $("#proArticel + .nodatabox").show();
  716. $("#proArticel + .nodatabox").find(".noContip").text("主人尚未发布任何文章");
  717. }
  718. }
  719. },
  720. error: function() {
  721. return;
  722. }
  723. });
  724. }
  725. //获取专利
  726. function getPatent(pageSize, pageNo,isbind){
  727. $.ajax({
  728. url: "/ajax/ppatent/byProfessor",
  729. dataType: 'json', //数据格式类型
  730. type: 'GET', //http请求类型
  731. data: {
  732. "id": professorId,
  733. "pageSize": pageSize,
  734. "pageNo": pageNo
  735. },
  736. timeout: 10000, //超时设置
  737. success: function(data) {
  738. if(data.success) {
  739. var dataStr=data.data.data;
  740. if(dataStr.length > 0){
  741. $("#showPatent").parents(".coninfobox").removeClass("displayNone");
  742. $("#item1user>.nodatabox").addClass("displayNone");
  743. for(var i = 0; i < dataStr.length; i++) {
  744. if(!dataStr[i].reqPerson){
  745. dataStr[i].reqPerson="";
  746. }
  747. var strAdd = '';
  748. strAdd += '<li><a traget="_blank" href="patentShow.html?patentId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  749. strAdd += '<div class="madiaHead patentHead"></div>';
  750. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  751. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors +'</p>';
  752. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  753. strAdd += '</div>';
  754. strAdd += '</a></li>';
  755. var $strAdd = $(strAdd);
  756. $("#proPatent").append( $strAdd);
  757. if(i==0){
  758. $("#showPatent").append(strAdd);
  759. }
  760. }
  761. //分页
  762. if(isbind==true){
  763. $("#proPatent").siblings(".tcdPageCode").createPage({
  764. pageCount: Math.ceil(data.data.total / 10),
  765. current: data.data.pageNo,
  766. backFn: function(p) {
  767. $("#proPatent").html("");
  768. getArticle(10, p,false);
  769. document.body.scrollTop = document.documentElement.scrollTop = 0;
  770. }
  771. });
  772. }
  773. }else{
  774. $("#proPatent + .nodatabox").show();
  775. $("#proPatent + .nodatabox").find(".noContip").text("主人尚未导入任何专利");
  776. }
  777. }
  778. },
  779. error: function() {
  780. return;
  781. }
  782. });
  783. }
  784. //获取论文
  785. function getPaper(pageSize, pageNo,isbind){
  786. $.ajax({
  787. url: "/ajax/ppaper/byProfessor",
  788. dataType: 'json', //数据格式类型
  789. type: 'GET', //http请求类型
  790. data: {
  791. "id": professorId,
  792. "pageSize": pageSize,
  793. "pageNo": pageNo
  794. },
  795. timeout: 10000, //超时设置
  796. success: function(data) {
  797. if(data.success) {
  798. var dataStr=data.data.data;
  799. if(dataStr.length > 0){
  800. $("#showPaper").parents(".coninfobox").removeClass("displayNone");
  801. $("#item1user>.nodatabox").addClass("displayNone");
  802. for(var i = 0; i < dataStr.length; i++) {
  803. var moreInf=""
  804. if(!dataStr[i].cn4periodical){
  805. dataStr[i].cn4periodical="";
  806. }
  807. if(!dataStr[i].en4periodical){
  808. dataStr[i].en4periodical="";
  809. }
  810. if(!dataStr[i].pubDay){
  811. dataStr[i].pubDay="";
  812. }
  813. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  814. var strAdd = '';
  815. strAdd += '<li><a traget="_blank" href="paperShow.html?paperId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  816. strAdd += '<div class="madiaHead paperHead"></div>';
  817. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  818. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors +'</p>';
  819. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  820. strAdd += '</div>';
  821. strAdd += '</a></li>';
  822. var $strAdd = $(strAdd);
  823. $("#proPaper").append( $strAdd);
  824. if(i==0){
  825. $("#showPaper").append(strAdd);
  826. }
  827. }
  828. //分页
  829. if(isbind==true){
  830. $("#proPaper").siblings(".tcdPageCode").createPage({
  831. pageCount: Math.ceil(data.data.total / 10),
  832. current: data.data.pageNo,
  833. backFn: function(p) {
  834. $("#proPaper").html("");
  835. getArticle(10, p,false);
  836. document.body.scrollTop = document.documentElement.scrollTop = 0;
  837. }
  838. });
  839. }
  840. }else{
  841. $("#proPaper + .nodatabox").show();
  842. $("#proPaper + .nodatabox").find(".noContip").text("主人尚未导入任何论文");
  843. }
  844. }
  845. },
  846. error: function() {
  847. return;
  848. }
  849. });
  850. }
  851. //查文章评论数
  852. function commentnum(articleId, $itemlist) {
  853. $.ajax({
  854. "url": "/ajax/leaveWord/lwCount",
  855. "type": "GET",
  856. "dataType": "json",
  857. "async": false,
  858. "data": {
  859. "articleId": articleId
  860. },
  861. "success": function(data) {
  862. if(data.success) {
  863. $itemlist.find("#comment").text("评论 " + data.data);
  864. }
  865. },
  866. "error": function() {
  867. $.MsgBox.Alert('提示', '链接服务器超时')
  868. }
  869. });
  870. }
  871. })