portal html css js resource

information.brow.js 40KB

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