portal html css js resource

information.brow.js 39KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. $(function() {
  2. var userid = $.cookie("userid");
  3. var professorId = GetQueryString("professorId");
  4. var name;
  5. if(userid == professorId) {
  6. $("#conbtn,.attentBtn").hide();
  7. }
  8. if(professorId) {
  9. var subjectShow = function(data) {
  10. if(data != undefined && data.length != 0) {
  11. var subs = new Array();
  12. if(data.indexOf(',')) {
  13. subs = data.split(',');
  14. } else {
  15. subs[0] = data;
  16. }
  17. if(subs.length > 0) {
  18. for(var i = 0; i < subs.length; i++) {
  19. $("#subjectShow").append("<div class='acad'>" + subs[i] + "</div>");
  20. };
  21. }
  22. }
  23. }
  24. var industryShow = function(data) {
  25. if(data != undefined && data.length != 0) {
  26. var subs = new Array();
  27. if(data.indexOf(',')) {
  28. subs = data.split(',');
  29. } else {
  30. subs[0] = data;
  31. }
  32. if(subs.length > 0) {
  33. for(var i = 0; i < subs.length; i++) {
  34. $("#industryShow").append("<li>" + subs[i] + "</li>");
  35. };
  36. }
  37. }
  38. }
  39. var eduBgShow = function(data) {
  40. if(data.length > 0) {
  41. for(var i = 0; i < data.length; i++) {
  42. var showHtml = '<li><div class="h4Font h4tit">';
  43. if(data[i].college && data[i].major && data[i].degree) {
  44. showHtml += data[i].school + '-' + data[i].college + '-' + data[i].major + '-' + data[i].degree
  45. } else if(!data[i].college && data[i].major && data[i].degree) {
  46. showHtml += data[i].school + '-' + data[i].major + '-' + data[i].degree
  47. } else if(data[i].college && !data[i].major && data[i].degree) {
  48. showHtml += data[i].school + '-' + data[i].college + '-' + data[i].degree
  49. } else if(data[i].college && data[i].major && !data[i].degree) {
  50. showHtml += data[i].school + '-' + data[i].college + '-' + data[i].major
  51. } else if(!data[i].college && !data[i].major && data[i].degree) {
  52. showHtml += data[i].school + '-' + data[i].degree
  53. } else if(!data[i].college && data[i].major && !data[i].degree) {
  54. showHtml += data[i].school + '-' + data[i].major
  55. } else if(data[i].college && !data[i].major && !data[i].degree) {
  56. showHtml += data[i].school + '-' + data[i].college
  57. }
  58. if(typeof(data[i].year) !== "undefined") {
  59. showHtml += '<small class="h6Font">' + data[i].year + '</small>';
  60. } else {
  61. showHtml += "";
  62. }
  63. showHtml += "</div></li>";
  64. $("#eduBgShow").append(showHtml);
  65. }
  66. }
  67. }
  68. var timeJobShow = function(data) {
  69. if(data.length > 0) {
  70. for(var i = 0; i < data.length; i++) {
  71. var sDate = "";
  72. var eDate = "";
  73. if(data[i].department) {
  74. var dep = "-" + data[i].department;
  75. } else {
  76. var dep = ""
  77. }
  78. if(data[i].startMonth) {
  79. sDate = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6) + "-";
  80. if(data[i].stopMonth) {
  81. eDate = data[i].stopMonth.substr(0, 4) + "-" + data[i].stopMonth.substr(4, 6);
  82. } else {
  83. eDate = "至今";
  84. }
  85. }
  86. var JobHtml = '<li>';
  87. JobHtml += '<div class="h4Font h4tit">' + data[i].company + '-' + data[i].title + '' + dep + '<small class="h6Font">' + sDate + '' + eDate + '</small></div>';
  88. JobHtml += '</li>';
  89. $("#timeJobShow").append(JobHtml);
  90. }
  91. }
  92. }
  93. var projectShow = function(data) {
  94. if(data.length > 0) {
  95. for(var i = 0; i < data.length; i++) {
  96. if(!data[i].descp) {
  97. data[i].descp = "";
  98. }
  99. if(!data[i].startMonth) {
  100. data[i].startMonth = '';
  101. data[i].stopMonth = '';
  102. } else {
  103. data[i].startMonth = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6) + "-"
  104. if(!data[i].stopMonth) {
  105. data[i].stopMonth = '至今';
  106. } else {
  107. data[i].stopMonth = data[i].stopMonth.substr(0, 4) + "-" + data[i].stopMonth.substr(4, 6)
  108. }
  109. }
  110. var projectHtml = '<li class="paddingSpace">';
  111. projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].startMonth + '' + data[i].stopMonth + '</small></div>';
  112. projectHtml += '<div class="h5Font pIndent">' + data[i].descp + '</div>';
  113. projectHtml += '</li>';
  114. $("#projectShow").append(projectHtml);
  115. }
  116. }
  117. }
  118. var paperShow = function(data) {
  119. if(data.length > 0) {
  120. for(var i = 0; i < data.length; i++) {
  121. if(!data[i].year) {
  122. data[i].year = "";
  123. }
  124. if(!data[i].descp) {
  125. data[i].descp = "";
  126. }
  127. if(!data[i].url) {
  128. data[i].url = "";
  129. }
  130. var paperHtml = '<li class="paddingSpace">';
  131. paperHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].year + '</small></div>';
  132. paperHtml += '<div class="h5Font pIndent">' + data[i].descp + '</div>';
  133. paperHtml += '</li>';
  134. $("#paperShow").append(paperHtml);
  135. }
  136. }
  137. }
  138. var patentShow = function(data) {
  139. if(data.length > 0) {
  140. for(var i = 0; i < data.length; i++) {
  141. if(!data[i].year) {
  142. data[i].year = "";
  143. }
  144. if(!data[i].descp) {
  145. data[i].descp = "";
  146. }
  147. if(!data[i].url) {
  148. data[i].url = "";
  149. }
  150. var patentHtml = '<li class="paddingSpace">';
  151. patentHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].year + '</small></div>';
  152. patentHtml += '<div class="h5Font pIndent">' + data[i].descp + '</div>';
  153. patentHtml += '</li>';
  154. $("#patentShow").append(patentHtml);
  155. }
  156. }
  157. }
  158. var honorShow = function(data) {
  159. if(data.length > 0) {
  160. for(var i = 0; i < data.length; i++) {
  161. if(!data[i].year) {
  162. data[i].year = "";
  163. }
  164. if(!data[i].descp) {
  165. data[i].descp = "";
  166. }
  167. var honorHtml = '<li class="paddingSpace">';
  168. honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + data[i].year + '</small></div>';
  169. honorHtml += '<div class="h5Font pIndent">' + data[i].descp + '</div>';
  170. honorHtml += '</li>';
  171. $("#honorShow").append(honorHtml);
  172. }
  173. }
  174. }
  175. var researchAreaShow = function($datas, $datarecords) {
  176. if($datas != undefined && $datas.length != 0) {
  177. var html = [];
  178. for(var i = 0; i < $datas.length; ++i) {
  179. var $data = $datas[i];
  180. var $photos = [];
  181. //获取头像
  182. if($datarecords.length > 0) {
  183. $photos = getRecords($datarecords, $data.caption);
  184. }
  185. var isAgree = -1;
  186. for(var j = 0; j < $photos.length; j++) {
  187. if(userid == $photos[j].id)
  188. isAgree++;
  189. }
  190. if(professorId != userid) {
  191. if(isAgree) {
  192. var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox' caption='" + $data.caption + "'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class='plus ' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox' caption='" + $data.caption + "'>";
  193. } else {
  194. var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse 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='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox' caption='" + $data.caption + "'>";
  195. }
  196. } else {
  197. var showDiv = "<div class='listbox listbox-browse clear'><div class='list-browse favorBox' caption='" + $data.caption + "'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><div class='like-num favorBox' caption='" + $data.caption + "'>";
  198. }
  199. if($photos.length < 6) {
  200. for(var j = 0; j < $photos.length; ++j) {
  201. if($photos[j].img) {
  202. showDiv += "<span class='like-people headRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_s.jpg'></span>";
  203. } else {
  204. showDiv += "<span class='like-people headRadius'><img class='like-h' src='../images/default-photo.jpg'></span>";
  205. }
  206. }
  207. } else {
  208. for(var j = $photos.length - 5; j < $photos.length; ++j) {
  209. if($photos[j].img) {
  210. showDiv += "<span class='like-people headRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_s.jpg'></span>";
  211. } else {
  212. showDiv += "<span class='like-people headRadius'><img class='like-h' src='../images/default-photo.jpg'></span>";
  213. }
  214. }
  215. showDiv += "<span class='like-people like-more headRadius'></span>";
  216. }
  217. showDiv += "</div></div></div>";
  218. html.push(showDiv);
  219. }
  220. document.getElementById("researchAreaShow").innerHTML = html.join('');
  221. }
  222. }
  223. var getRecords = function($researchAreaLogs, caption) {
  224. var ret = [];
  225. var t = 0;
  226. for(var i = 0; i < $researchAreaLogs.length; i++) {
  227. if(caption == $researchAreaLogs[i].caption) {
  228. ret[t] = {
  229. id: $researchAreaLogs[i].opreteProfessorId,
  230. img: $researchAreaLogs[i].hasHeadImage
  231. }
  232. t++;
  233. }
  234. }
  235. return ret;
  236. }
  237. var clFlag = 1;
  238. $("#researchAreaShow").on("click", ".plus", function() {
  239. if(userid && userid != null && userid != "null") {
  240. //点赞变化样式
  241. if(clFlag) {
  242. clFlag = 0;
  243. } else {
  244. return;
  245. }
  246. if($(this).data("isagree") > -1) {
  247. $(this).stop(true, true).animate({
  248. backgroundPositionY: 0
  249. }, 300); //变成未点赞样式
  250. } else {
  251. $(this).stop(true, true).animate({
  252. backgroundPositionY: -26
  253. }, 300); //变成点赞样式
  254. }
  255. $.ajax({
  256. "url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
  257. "type": "POST",
  258. "data": {
  259. "targetId": $(this).data("pid"),
  260. "targetCaption": $(this).data("caption"),
  261. "opId": userid
  262. },
  263. "contentType": "application/x-www-form-urlencoded",
  264. "success": function($data) {
  265. if($data.success) {
  266. $.get("/ajax/professor/info/" + professorId, function($data) {
  267. if($data.success) {
  268. clFlag = 1;
  269. var $info = $data.data;
  270. if($info) {
  271. $("#researchAreaShow").empty("")
  272. if($info.researchAreas) {
  273. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  274. }
  275. }
  276. }
  277. })
  278. } else {
  279. $.MsgBox.Alert("message", $data.msg);
  280. }
  281. }
  282. });
  283. } else {
  284. $.MsgBox.Alert("消息", "请登录后点赞");
  285. /*location.href="login.html"*/
  286. }
  287. })
  288. /*研究方向点赞列表*/
  289. //关闭按钮
  290. $("#workclose").click(function() {
  291. $(".resAreaCover").fadeOut();
  292. $("body").css("position", "static");
  293. });
  294. $("#researchAreaShow").on("click", ".list-browse,.like-num", function() {
  295. var cap = $(this).attr("caption");
  296. console.log(cap.length);
  297. $.ajax({
  298. url: "/ajax/researchAreaLog/ql",
  299. dataType: 'json', //数据格式类型
  300. type: 'GET', //http请求类型
  301. timeout: 10000, //超时设置
  302. data: {
  303. "professorId": professorId,
  304. 'caption': cap,
  305. "rows": 10
  306. },
  307. success: function(data) {
  308. if(data.success) {
  309. $(".attentList").html("");
  310. var $info = data.data;
  311. $("#subArea").text(cap);
  312. if($info.length == 0) {
  313. $(".resAreaCon").hide();
  314. return;
  315. }
  316. for(var i = 0; i < $info.length; i++) {
  317. if($info[i].professor.hasHeadImage == 1) {
  318. var img = "/images/head/" + $info[i].professor.id + "_l.jpg";
  319. } else {
  320. var img = "../images/default-photo.jpg";
  321. }
  322. if($info[i].professor.authType) {
  323. var typeTname = "authicon authicon-cu"
  324. } else {
  325. if($info[i].professor.authStatus) {
  326. if($info[i].professor.authentication == 1) {
  327. var typeTname = "authicon2 authicon-mana";
  328. } else if($info[i].professor.authentication == 2) {
  329. var typeTname = "authicon2 authicon-staff";
  330. } else {
  331. var typeTname = "authicon2 authicon-stu"
  332. }
  333. }
  334. }
  335. var title = "",
  336. office = "",
  337. orgName = "",
  338. address = '';
  339. if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  340. title = $info[i].professor.title + ",";
  341. office = $info[i].professor.office + ",";
  342. orgName = $info[i].professor.orgName + " | ";
  343. address = $info[i].professor.address;
  344. } else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  345. office = $info[i].professor.office + ",";
  346. orgName = $info[i].professor.orgName + " | ";
  347. address = $info[i].professor.address;
  348. } else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  349. title = $info[i].professor.title + ",";
  350. orgName = $info[i].professor.orgName + " | ";
  351. address = $info[i].professor.address;
  352. } else if($info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  353. title = $info[i].professor.title + ",";
  354. office = $info[i].professor.office + " | ";
  355. address = $info[i].professor.address;
  356. } else if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  357. title = $info[i].professor.title + ",";
  358. office = $info[i].professor.office + ",";
  359. orgName = $info[i].professor.orgName;
  360. } else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  361. orgName = $info[i].professor.orgName + " | ";
  362. address = $info[i].professor.address;
  363. } else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  364. office = $info[i].professor.office + " | ";
  365. address = $info[i].professor.address;
  366. } else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  367. office = $info[i].professor.office + ",";
  368. orgName = $info[i].professor.orgName;
  369. } else if($info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  370. title = $info[i].professor.title + " | ";
  371. address = $info[i].professor.address;
  372. } else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  373. office = $info[i].professor.title + ",";
  374. address = $info[i].professor.orgName;
  375. } else if($info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
  376. title = $info[i].professor.title + ",";
  377. office = $info[i].professor.office;
  378. } else if(!$info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  379. address = $info[i].professor.address;
  380. } else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  381. orgName = $info[i].professor.orgName;
  382. } else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
  383. office = $info[i].professor.office;
  384. } else if($info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
  385. title = $info[i].professor.title;
  386. }
  387. var addw = '<li>'
  388. addw += '<a class="proinfor clearfix">'
  389. addw += '<div class="headblock floatL"><img id="proHead" class="headimg headRadius" src="' + img + '"></div>'
  390. addw += '<div class="mediaBody">'
  391. addw += '<span class="listtit"><span id="proName">' + $info[i].professor.name + '</span><em class="' + typeTname + '" style="position:absolute;margin:4px 0 0 2px ;"></em></span>'
  392. addw += '<div class="listtit2">' + title + office + orgName + address + '</div>'
  393. addw += '</div></a></li>'
  394. $(".attentList").append(addw);
  395. }
  396. $(".resAreaCover").fadeIn();
  397. $("body").css("position", "fixed");
  398. }
  399. },
  400. error: function() {}
  401. });
  402. });
  403. $.get("/ajax/professor/info/" + professorId, function($data) {
  404. if($data.success) {
  405. console.log($data);
  406. var $info = $data.data;
  407. if($info) {
  408. if($info.authType == 1) {
  409. $(".yesshow").show();
  410. } else {
  411. if($info.authentication == 3) {
  412. $("#office").hide();
  413. $("#titleS").hide();
  414. }
  415. }
  416. //修改浏览器title信息
  417. if($info.title) {
  418. var qtitle = " - " + $info.title;
  419. } else {
  420. var qtitle = "";
  421. }
  422. if($info.office) {
  423. var qoffice = " - " + $info.office;
  424. } else {
  425. var qoffice = "";
  426. }
  427. var llqtitle = $info.name + qtitle + qoffice + " - " + $info.orgName + " - 科袖网";
  428. window.setInterval(function() {
  429. document.title = llqtitle;
  430. }, 500);
  431. //展示专家的信息
  432. console.log($data);
  433. if($info.authType) {
  434. $(".modify").addClass("authicon authicon-cu");
  435. } else {
  436. if($info.authStatus) {
  437. if($info.authentication == 1) {
  438. $(".modify").addClass("authicon2 authicon-mana").css({
  439. "margin-top": "13px"
  440. });
  441. } else if($info.authentication == 2) {
  442. $(".modify").addClass("authicon2 authicon-staff").css({
  443. "margin-top": "13px"
  444. });
  445. } else {
  446. $(".modify").addClass("authicon2 authicon-stu").css({
  447. "margin-top": "13px"
  448. });
  449. }
  450. }
  451. }
  452. $("#nameS").text($info.name);
  453. if($info.office) {
  454. if($info.title) {
  455. $("#office").text($info.office + ",");
  456. } else {
  457. $("#office").text($info.office);
  458. }
  459. }
  460. if($info.title) {
  461. $("#titleS").text($info.title);
  462. }
  463. if($info.department) {
  464. if($info.orgName) {
  465. $("#industryS").text($info.department + ",");
  466. } else {
  467. $("#industryS").text($info.department);
  468. }
  469. }
  470. if($info.orgName) {
  471. $("#orgNameS").text($info.orgName);
  472. }
  473. if($info.address) {
  474. $("#address").text($info.address);
  475. }
  476. if($info.hasHeadImage) {
  477. $("#headImage").attr("src", "/images/head/" + professorId + "_l.jpg");
  478. } else {
  479. $("#headImage").attr("src", "/images/default-photo.jpg");
  480. }
  481. $("#orgImage").attr("src", "/images/org/" + $info.orgId + ".jpg");
  482. $("#orgImage").load(function() {})
  483. .error(function() {
  484. $("#orgImage").attr("src", "/images/default-icon.jpg");
  485. });
  486. //显示专家信息到保存数据
  487. name = $info.name;
  488. if($info.descp == undefined && $info.subject == undefined && $info.researchAreas.length == 0 && $info.industry == undefined && $info.edus.length == 0 && $info.jobs.length == 0 && $info.projects.length == 0 && $info.papers.length == 0 && $info.patents.length == 0 && $info.honors.length == 0) {
  489. $("div:contains('专家信息')").parents(".menublock").hide();
  490. }
  491. if($info.descp) {
  492. $("#descpS").text($info.descp);
  493. } else {
  494. $("span:contains('个人简介')").parents(".introduction").hide();
  495. $("a:contains('个人简介')").hide();
  496. }
  497. //展示专家的学科
  498. //alert($info.authentication);
  499. if($info.authType == 1) {
  500. if($info.subject) {
  501. subjectShow($info.subject);
  502. } else {
  503. $("span:contains('学术领域')").parents(".introduction").hide();
  504. $("a:contains('学术领域')").hide();
  505. }
  506. } else {
  507. if($info.authentication == 1) {
  508. if($info.subject) {
  509. subjectShow($info.subject);
  510. } else {
  511. $("span:contains('学术领域')").parents(".introduction").hide();
  512. $("a:contains('学术领域')").hide();
  513. }
  514. } else {
  515. $("span:contains('学术领域')").parents(".introduction").hide();
  516. $("a:contains('学术领域')").hide();
  517. }
  518. }
  519. //研究方向
  520. if($info.authType == 1) {
  521. if($info.researchAreas.length) {
  522. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  523. } else {
  524. $("span:contains('研究方向')").parents(".introduction").hide();
  525. $("a:contains('研究方向')").hide();
  526. }
  527. } else {
  528. $("span:contains('研究方向')").parents(".introduction").hide();
  529. $("a:contains('研究方向')").hide();
  530. }
  531. //展示专家的行业
  532. if($info.authType == 1) {
  533. if($info.industry) {
  534. industryShow($info.industry);
  535. } else {
  536. $("span:contains('应用行业')").parents(".introduction").hide();
  537. $("a:contains('应用行业')").hide();
  538. }
  539. } else {
  540. if($info.authentication == 2) {
  541. if($info.industry) {
  542. industryShow($info.industry);
  543. } else {
  544. $("span:contains('应用行业')").parents(".introduction").hide();
  545. $("a:contains('应用行业')").hide();
  546. }
  547. } else {
  548. $("span:contains('应用行业')").parents(".introduction").hide();
  549. $("a:contains('应用行业')").hide();
  550. }
  551. }
  552. //教育北京
  553. if($info.edus.length) {
  554. eduBgShow($info.edus);
  555. } else {
  556. $("span:contains('教育背景')").parents(".introduction").hide();
  557. $("a:contains('教育背景')").hide();
  558. }
  559. //兼职
  560. if($info.jobs.length) {
  561. timeJobShow($info.jobs);
  562. } else {
  563. $("span:contains('工作经历')").parents(".introduction").hide();
  564. $("a:contains('工作经历')").hide();
  565. }
  566. //项目
  567. if($info.projects.length) {
  568. projectShow($info.projects)
  569. } else {
  570. $("span:contains('项目经历')").parents(".introduction").hide();
  571. $("a:contains('项目经历')").hide();
  572. }
  573. //论文
  574. if($info.papers.length) {
  575. paperShow($info.papers);
  576. } else {
  577. $("span:contains('著作、论文、文章')").parents(".introduction").hide();
  578. $("a:contains('著作、论文、文章')").hide();
  579. }
  580. //专利
  581. if($info.patents.length) {
  582. patentShow($info.patents);
  583. } else {
  584. $("span:contains('专利')").parents(".introduction").hide();
  585. $("a:contains('专利')").hide();
  586. }
  587. //荣誉
  588. if($info.honors.length) {
  589. honorShow($info.honors);
  590. } else {
  591. $("span:contains('荣誉及奖项')").parents(".introduction").hide();
  592. $("a:contains('荣誉及奖项')").hide();
  593. }
  594. //下滑滚动不覆盖底部
  595. var d;
  596. var t;
  597. $(function() {
  598. /*向下滚动时,header背景变半透明*/
  599. var top5 = $(".content-left").height();
  600. var top4 = $("#container").height();
  601. var top3 = $(window).height();
  602. $(document).scroll(function() {
  603. var top1 = $(document).scrollTop();
  604. var top2 = $("#container").height() - top3 + (top3 - 80 - top5) - 10; //变成绝对定位
  605. if(top1 >= 300) {
  606. $(".content-left").css({
  607. "position": "fixed",
  608. "top": "80px"
  609. });
  610. if(top1 >= top2) {
  611. $('.information-content').css("position", "static");
  612. $(".content-left").css("position", "absolute");
  613. $(".content-left").css("top", top4 - top5 - 10 + "px");
  614. } else {
  615. $('.information-content').css("position", "relative");
  616. $(".content-left").css({
  617. "position": "fixed",
  618. "top": "80px"
  619. });
  620. }
  621. } else {
  622. $(".content-left").css({
  623. "position": "static"
  624. });
  625. }
  626. //咨询框弹出
  627. var foot_height = $(".footerblock").height();
  628. if(top1 >= 180 && top1 < top4 - top3) {
  629. $(".coulstblock").slideDown();
  630. $(".coulstblock").css({
  631. "bottom": "0"
  632. });
  633. } else if(top1 >= top4 - top3) {
  634. $(".coulstblock").css({
  635. "bottom": -(top4 - top3 - top1) + "px"
  636. });
  637. } else {
  638. $(".coulstblock").slideUp();
  639. $(".coulstblock").css({
  640. "bottom": "0"
  641. });
  642. }
  643. })
  644. });
  645. //下滑滚动不覆盖底部 结束
  646. }
  647. }
  648. });
  649. }
  650. $("#hsearch").on("click", function() {
  651. var searchContent = $("#hsearchContent").val();
  652. location.href = "search.html?searchContent=" + searchContent;
  653. });
  654. //拿到点击的顺序,然后求出局文档的距离
  655. $(".subsidebar").mouseenter(function(){
  656. var dd=$(this)[0].className;
  657. if(dd!="subsidebar subcolor"){
  658. $(this).css("background","#efefef");
  659. }
  660. }).mouseleave(function(){
  661. $(this).css("background","")
  662. });
  663. //专家信息点击换背景颜色
  664. $(".subsidebar").click(function() {
  665. $(".subsidebar").removeClass("subcolor");
  666. $(".subsidebar").eq($(".subsidebar").index(this)).addClass("subcolor");
  667. });
  668. $(".subsidebar").click(function() {
  669. var index = $(".subsidebar").index(this)+1;
  670. //console.log(index)
  671. var offset = $(".introduction").eq(index).offset();
  672. $("body,html").animate({
  673. scrollTop: offset.top - 80 + "px" //��body��scrollTop����pos��top����ʵ���˹���
  674. }, 1000);
  675. }).mousedown(function(){
  676. $(this).css("background","");
  677. });
  678. /*科研文章*/
  679. $.ajax({
  680. url: "/ajax/article/qaPro",
  681. dataType: 'json', //数据格式类型
  682. type: 'GET', //http请求类型
  683. data: {
  684. "professorId": professorId
  685. },
  686. timeout: 10000, //超时设置
  687. success: function(data) {
  688. if(data.success) {
  689. var pp=ifUserType(professorId)
  690. if(!pp.authType2) {
  691. $("#reA").hide();
  692. return;
  693. } else {
  694. if(data.data.length == 0) {
  695. $("#reA").hide();
  696. return;
  697. }
  698. $("#reA").show();
  699. for(var i = 0; i < data.data.length; i++) {
  700. var add = '<li><a href="articalInfo.html?articleId=' + data.data[i].articleId + '&professorId=' + professorId + '" style="display:block;">'
  701. add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
  702. add += '<div class="art_topicbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
  703. add += '</div><div class="tagsBox"><span></span></div>'
  704. add += '</a></li>';
  705. $add = $(add);
  706. $("#reachArticle").append($add);
  707. $add.find('.tagsBox span').text(data.data[i].industry); //data.data[i].subject
  708. if(data.data[i].articleImg) {
  709. $add.find(".art_img").attr("style", "background: url(/data/article/" + data.data[i].articleImg + ") 0 0 no-repeat;background-size:cover;");
  710. }
  711. }
  712. //资源轮播
  713. var $content2 = $(".sharescrollbox.Acrollbox");
  714. var childcount2 = $content2.find(".otherRes.shareshow li").length;
  715. Carousel(3, 3, 3, childcount2, $content2, $(".articalbtn.resounext"), $(".articalbtn.resouprev"));
  716. }
  717. }
  718. },
  719. error: function() {
  720. return;
  721. }
  722. });
  723. var resou;
  724. //科研资源
  725. $.ajax({
  726. "url": "/ajax/resource/qapro",
  727. "type": "get",
  728. "async": false,
  729. "data": {
  730. "professorId": professorId
  731. },
  732. "success": function(data) {
  733. if(data.success) {
  734. var pp=ifUserType(professorId)
  735. if(!pp.authType2) {
  736. $("span:contains('研发资源')").parents(".introduction").hide();
  737. return;
  738. } else {
  739. resou = data.data.length;
  740. if(data.data.length == 0) {
  741. $("#infor-browse").css("display", "none");
  742. $("span:contains('研发资源')").parents(".introduction").hide();
  743. $("a:contains('研发资源')").hide();
  744. return;
  745. } else {
  746. $("span:contains('研发资源')").parents(".introduction").show();
  747. }
  748. if(data.data.length > 3) {
  749. $("#infor-browse").css("display", "block");
  750. $(".resoubtn").css("display", "block");
  751. }
  752. var add = "";
  753. for(var i = 0; i < data.data.length; i++) {
  754. add = '<div class="sharesrc">'
  755. add += '<div class="shareshow">'
  756. add += '<a href="resourceInfo.html?resourceId=' + data.data[i].resourceId + '"class="remess" style="display:block;" resourceId=' + data.data[i].resourceId + '>'
  757. add += '<div class="ResImgBox" style="max-width:200px;width:200px;height: 200px;">'
  758. add += '<img class="resImg headRadius resourceImg" src="/images/resource/' + data.data[i].resourceId + '.jpg" />'
  759. add += '</div></a>'
  760. add += '<div class="shareopeart"><a class="sharebtn resourceConsult" professorId=' + data.data[i]["professorId"] + '>咨询</a><a class="sharebtn applicant" style="display:none">申请</a></div>'
  761. add += '</div>'
  762. add += '<p class="restit">资源名称:<span class="presou consultTitleVal" resourceConsultTitle = "">' + data.data[i].resourceName + '</span></p>'
  763. add += '<p class="briefinfor">应用用途:' + data.data[i].supportedServices + '</p>'
  764. add += '</div>'
  765. $("#sharescrollbox").append(add);
  766. $('.applicant').eq(i).attr("resourceId", data.data[i].resourceId);
  767. $(".resourceImg").eq(i).attr("src", "/images/resource/" + data.data[i].resourceId + ".jpg");
  768. $(".resourceImg").load(function() {})
  769. .error(function() {
  770. $(this).attr("src", "/images/default-resource.jpg");
  771. });
  772. add = "";
  773. }
  774. //资源轮播
  775. var $content = $(".sharescrollbox");
  776. var childcount = $content.find(".sharesrc").length;
  777. Carousel(3, 3, 3, childcount, $content, $(".resoubtn2.resounext"), $(".resoubtn2.resouprev"));
  778. //科研资源中点咨询
  779. $(".introduction").find(".resourceConsult").bind("click", clickResourceConsult);
  780. }
  781. } else {
  782. $.MsgBox.Alert("消息", "系统异常!");
  783. }
  784. },
  785. "error": function() {
  786. $.MsgBox.Alert('message', 'failddd')
  787. }
  788. });
  789. function getIdentity(professorId) {
  790. $.ajax({
  791. "url": "ajax/professor/" + professorId,
  792. "type": "get",
  793. "async": false,
  794. "success": function(data) {
  795. if(data.success) {
  796. //console.log(data);
  797. $("option")[0].value = data.data.name;
  798. $("option")[1].value = data.data.organization.name;
  799. //console.log($("option")[0].value);
  800. //console.log($("option")[1].value);
  801. } else {
  802. $.MsgBox.Alert("消息", "系统异常!");
  803. }
  804. },
  805. "error": function() {
  806. $.MsgBox.Alert('message', 'failddd')
  807. }
  808. })
  809. }
  810. //资源申请入口
  811. $('.introduction').on("click", '.applicant', function() {
  812. if(userid && userid != null && userid != "null") {
  813. ResourceApply(); //调用资源申请HTML创建函数
  814. $(".limitBox").removeClass("limitBox");
  815. $(".limitwords").removeClass("limitwords");
  816. $(".limitwordbox").removeClass("limitwordbox");
  817. //获取当前时间并且格式化时间
  818. var myDate = new Date();
  819. var nowYear = myDate.getFullYear();
  820. var nowMonth = myDate.getMonth() + 1;
  821. var nowDate = myDate.getDate();
  822. if(nowMonth < 10) {
  823. nowMonth = "0" + nowMonth.toString();
  824. }
  825. if(nowDate < 10) {
  826. nowDate = "0" + nowDate.toString();
  827. }
  828. var now = nowYear + "-" + nowMonth + "-" + nowDate;
  829. $("#datepicker").val(now);
  830. $("#datepicker").datepicker({
  831. "dateFormat": " yy-mm-dd"
  832. });
  833. $(".timelo").css("display", "none");
  834. $(".namecon").text(name);
  835. $(".applysure").hide();
  836. $(".btnboxup").hide();
  837. var index1 = $(this).parent().parent().parent().index();
  838. var resName = $('.presou').eq(index1).text();
  839. var resourceID = $(this).attr("resourceId");
  840. $.ajax({
  841. "url": "/ajax/resource/" + resourceID,
  842. "type": "get",
  843. "async": false,
  844. "success": function(info) {
  845. if(info.success) {
  846. if(info.data.images.length) {
  847. $(".resouImage").attr("src", "/images/resource/" + resourceID + ".jpg");
  848. } else {
  849. $(".resouImage").attr("src", "/images/default-resource.jpg");
  850. }
  851. }
  852. }
  853. })
  854. $(".log").text(resName);
  855. getIdentity(userid);
  856. $("#deliver").on("click", function() {
  857. var $data = {};
  858. $data.demandId = userid;
  859. $data.resourceId = resourceID;
  860. $data.detailDemand = $(".detail").val();
  861. //去除时间里面的- 和字符串前后的空格
  862. $data.deliverTime = replaceStr($.trim($(".dealTime").val()));
  863. //alert(replaceStr($.trim($(".dealTime").val())));
  864. //alert(replaceStr($.trim($(".dealTime").val())).length);
  865. $data.operationStatus = 1;
  866. $data.applysquare = $("select option:selected").val();
  867. //console.log($data.applysquare);
  868. $.ajax({
  869. "url": "/ajax/operation",
  870. "type": "POST",
  871. "success": function(rdata) {
  872. if(rdata.success) {
  873. $.MsgBox.Alert('message', '资源"' + resName + '"申请发送成功!');
  874. $(".blackcover").remove();
  875. $("body").css("position", "static");
  876. //location.reload(true);
  877. } else {
  878. $.MsgBox.Alert('message', '资源"' + resName + '"申请发送失败,请重新申请!');
  879. }
  880. },
  881. "data": $data,
  882. "beforeSend": function() { /*console.log(this.data)*/ },
  883. "contentType": "application/x-www-form-urlencoded",
  884. dataType: "json"
  885. });
  886. });
  887. } else {
  888. $.MsgBox.Alert("消息", "您还未登录,请登录之后进行资源申请");
  889. }
  890. });
  891. //科研资源中的咨询
  892. function clickResourceConsult() {
  893. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  894. var professorId = $(this).attr("professorId");
  895. consultHandler();
  896. var liEle = $("ul.menucon").children();
  897. for(var i = 0; i < liEle.length; i++) {
  898. $(liEle[i]).removeClass('clicknow');
  899. $(liEle[1]).addClass("clicknow");
  900. };
  901. var item = $(this).parent().parent().parent();
  902. var consultTitleVal = item.find(".consultTitleVal").text();
  903. $("#consultTitle").val("关于" + consultTitleVal + "的咨询");
  904. } else {
  905. $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
  906. $("#mb_btn_ok").val("去登录");
  907. var aele = document.createElement('a');
  908. $("#mb_btnbox").append(aele);
  909. $("#mb_btnbox a").css({
  910. 'display': "block",
  911. 'width': '100%',
  912. 'height': '40px',
  913. 'position': 'absolute',
  914. 'bottom': '-6px',
  915. 'left': '0'
  916. });
  917. aele.setAttribute('href', '../login.html');
  918. }
  919. };
  920. //===============点击咨询==============
  921. var userid = $.cookie("userid"); //登陆人id====重复代码
  922. var professorId = GetQueryString("professorId"); //专家id====重复代码
  923. //点击科研资源的咨询
  924. $("#consultbtn,#conbtn").bind('click', consultHandler);
  925. function consultHandler() {
  926. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  927. ConsultApply();
  928. concultProInfo(professorId);
  929. //点击的发送
  930. $("#sendConsultBtn").click(function() {
  931. sendConsultHandler($(this).attr("proId"));
  932. });
  933. } else {
  934. $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
  935. $("#mb_btn_ok").val("去登录");
  936. var aele = document.createElement('a');
  937. $("#mb_btnbox").append(aele);
  938. $("#mb_btnbox a").css({
  939. 'display': "block",
  940. 'width': '100%',
  941. 'height': '40px',
  942. 'position': 'absolute',
  943. 'bottom': '-6px',
  944. 'left': '0'
  945. });
  946. aele.setAttribute('href', '../login.html');
  947. }
  948. };
  949. //合作历史及评价
  950. var ass;
  951. $.ajax({
  952. "url": "/ajax/consult/pqAssessHis",
  953. "type": "get",
  954. "data": {
  955. "professorId": professorId
  956. },
  957. "async": false,
  958. "success": function(response) {
  959. if(response.success) {
  960. var $data = response.data.data;
  961. ass = $data.length;
  962. if($data.length == 0) {
  963. $("span:contains('合作历史及评价')").parents(".introduction").hide();
  964. $("a:contains('合作历史及评价')").hide();
  965. }
  966. for(var i = 0; i < $data.length; i++) {
  967. var add = "";
  968. var assessTime = $data[i]["assessTime"].substr(0, 4) + "-" + $data[i].assessTime.substr(4, 2) + "-" + $data[i].assessTime.substr(6, 2) + " " +
  969. $data[i].assessTime.substr(8, 2) + ":" + $data[i].assessTime.substr(10, 2);
  970. add += '<div class="evaluate2">'
  971. add += '<div class="lefteva">'
  972. add += '<a class="evaimg headRadius">'
  973. if($data[i].professor.hasHeadImage) {
  974. add += '<img src="/images/head/' + $data[i].professor.id + '_l.jpg" width="100%" height="100%">'
  975. } else {
  976. add += '<img src="/images/default-photo.jpg" width="100%" height="100%">'
  977. }
  978. add += '</a>'
  979. add += '<p>' + $data[i].professor.name + '</p><p>'
  980. // if($data[i].professor.office) {
  981. // add+='<span>'+$data[i].professor.office+' ,</span>'
  982. // }
  983. // if($data[i].professor.title) {
  984. // add+='<span>'+$data[i].professor.title+'</span>'
  985. // }
  986. add += '</p><p>'
  987. // if($data[i].professor.department) {
  988. // add+='<span>'+$data[i].professor.department+' ,</span>'
  989. // }
  990. // if($data[i].professor.orgName) {
  991. // add+='<span>'+$data[i].professor.orgName+'</span>'
  992. // }
  993. add += '</p>'
  994. add += '</div>'
  995. add += '<div class="righteva">'
  996. add += '<ul class="evasort">'
  997. add += '<li>咨询时间:<span>' + assessTime + '</span></li>'
  998. add += '</ul>'
  999. add += '<div class="evastarbox" id="evastarboxx" style="margin-left: -5px;">'
  1000. add += '<span class="evastar"></span>'
  1001. add += '<span class="evastar"></span>'
  1002. add += '<span class="evastar"></span>'
  1003. add += '<span class="evastar"></span>'
  1004. add += '<span class="evastar"></span>'
  1005. add += '</div>'
  1006. if($data[i].assessContant) {
  1007. add += '<p class="evabrief">' + $data[i].assessContant + ' </p>'
  1008. }
  1009. add += '</div>'
  1010. add += '</div>'
  1011. var $add = $(add);
  1012. $(".shareabout2").append($add);
  1013. $add.find(".evastar:lt(" + $data[i].assessStar + ")").addClass('staspan');
  1014. }
  1015. $(".evaluate2").eq($data.length - 1).css("border-bottom", "none");
  1016. }
  1017. }
  1018. })
  1019. if(resou == 0 && ass == 0) {
  1020. $('div:contains("合作机会")').parents(".menublock").hide();
  1021. }
  1022. proinfo(professorId);
  1023. //底部咨询申请入口专家信息
  1024. function proinfo(professorId) {
  1025. $.ajax({
  1026. url: "/ajax/professor/editBaseInfo/" + professorId,
  1027. type: "get",
  1028. data: {
  1029. "id": professorId
  1030. },
  1031. contentType: "application/x-www-form-urlencoded",
  1032. success: function(response) {
  1033. var myData = response["data"];
  1034. //console.log(myData);
  1035. $("#foot_proname").html(myData["name"]);
  1036. if(myData["address"]) {
  1037. $("#foot_proaddress").html(' | ' + myData["address"]);
  1038. }
  1039. if(myData["title"]) {
  1040. $("#foot_protitle").html(myData["title"]);
  1041. }
  1042. if(myData["department"]) {
  1043. $("#foot_prodepar").html(myData["department"]);
  1044. }
  1045. if(myData["orgName"]) {
  1046. if(myData["department"] == null || myData["department"] == '') {
  1047. $("#foot_proorgname").html(myData["orgName"]);
  1048. } else {
  1049. $("#foot_proorgname").html(',' + myData["orgName"]);
  1050. }
  1051. }
  1052. //是否认证
  1053. // if(myData["authentication"] == true){
  1054. // $("#foot_promodify").addClass("authicon");
  1055. // }else {
  1056. // $("#foot_promodify").addClass("unauthicon");
  1057. // }
  1058. if(myData.authType) { //专家
  1059. $("#foot_promodify").addClass('authicon authicon-cu');
  1060. } else { //普通用户
  1061. if(myData.authStatus) { //身份已认证
  1062. if(myData.authentication == 1) { //科研工作者
  1063. $("#foot_promodify").addClass('authicon2 authicon-mana');
  1064. } else if(myData.authentication == 2) { //企业专家
  1065. $("#foot_promodify").addClass('authicon2 authicon-staff');
  1066. } else { //学生
  1067. $("#foot_promodify").addClass('authicon2 authicon-stu');
  1068. }
  1069. } else { //身份未认证
  1070. }
  1071. };
  1072. //头像
  1073. if(myData["hasHeadImage"] == 0) {
  1074. $("#foot_proimg").attr("src", "images/default-photo.jpg");
  1075. } else {
  1076. $("#foot_proimg").attr("src", "images/head/" + myData["id"] + "_l.jpg");
  1077. }
  1078. },
  1079. error: function(error) {
  1080. $.MsgBox.Alert("message", "请求数据失败");
  1081. }
  1082. });
  1083. }
  1084. })