portal html css js resource

userInforShow.js 30KB

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