portal html css js resource

information.brow.js 39KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  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 oarray=[];
  177. var researchAreaShow = function($datas, $datarecords) {
  178. if($datas != undefined && $datas.length != 0) {
  179. var html = [];
  180. for(var i = 0; i < $datas.length; ++i) {
  181. var $data = $datas[i];
  182. var $photos = [];
  183. //获取头像
  184. if($datarecords.length > 0) {
  185. $photos = getRecords($datarecords, $data.caption);
  186. }
  187. var isAgree = -1;
  188. for(var j = 0; j < $photos.length; j++) {
  189. if(userid == $photos[j].id)
  190. isAgree++;
  191. }
  192. oarray[i]=$data.caption;
  193. if(professorId != userid) {
  194. if(isAgree) {
  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 ' data-pid='" + $data.professorId + "' data-caption='" + i + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox' caption='" +$data.caption + "'>";
  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><span class='plus' style=' background-position-y:-26px' data-pid='" + $data.professorId + "' data-caption='" + i + "' data-isagree='" + isAgree + "' ></span><div class='like-num favorBox' caption='" + $data.caption + "'>";
  198. }
  199. } else {
  200. 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 + "'>";
  201. }
  202. if($photos.length < 6) {
  203. for(var j = 0; j < $photos.length; ++j) {
  204. if($photos[j].img) {
  205. showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_s.jpg'></span>";
  206. } else {
  207. showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>";
  208. }
  209. }
  210. } else {
  211. for(var j = $photos.length - 5; j < $photos.length; ++j) {
  212. if($photos[j].img) {
  213. showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_s.jpg'></span>";
  214. } else {
  215. showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>";
  216. }
  217. }
  218. showDiv += "<span class='like-people like-more userRadius'></span>";
  219. }
  220. showDiv += "</div></div></div>";
  221. html.push(showDiv);
  222. }
  223. document.getElementById("researchAreaShow").innerHTML = html.join('');
  224. }
  225. }
  226. var getRecords = function($researchAreaLogs, caption) {
  227. var ret = [];
  228. var t = 0;
  229. for(var i = 0; i < $researchAreaLogs.length; i++) {
  230. if(caption == $researchAreaLogs[i].caption) {
  231. ret[t] = {
  232. id: $researchAreaLogs[i].opreteProfessorId,
  233. img: $researchAreaLogs[i].hasHeadImage
  234. }
  235. t++;
  236. }
  237. }
  238. return ret;
  239. }
  240. var clFlag = 1;
  241. $("#researchAreaShow").on("click", ".plus", function() {
  242. if(userid && userid != null && userid != "null") {
  243. //点赞变化样式
  244. if(clFlag) {
  245. clFlag = 0;
  246. } else {
  247. return;
  248. }
  249. if($(this).data("isagree") > -1) {
  250. $(this).stop(true, true).animate({
  251. backgroundPositionY: 0
  252. }, 300); //变成未点赞样式
  253. } else {
  254. $(this).stop(true, true).animate({
  255. backgroundPositionY: -26
  256. }, 300); //变成点赞样式
  257. }
  258. $.ajax({
  259. "url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
  260. "type": "POST",
  261. "data": {
  262. "targetId": $(this).data("pid"),
  263. "targetCaption": oarray[$(this).data("caption")],
  264. "opId": userid
  265. },
  266. "contentType": "application/x-www-form-urlencoded",
  267. "success": function($data) {
  268. if($data.success) {
  269. $.get("/ajax/professor/info/" + professorId, function($data) {
  270. if($data.success) {
  271. clFlag = 1;
  272. var $info = $data.data;
  273. if($info) {
  274. $("#researchAreaShow").empty("")
  275. if($info.researchAreas) {
  276. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  277. }
  278. }
  279. }
  280. })
  281. } else {
  282. $.MsgBox.Alert("message", $data.msg);
  283. }
  284. }
  285. });
  286. } else {
  287. $.MsgBox.Alert("消息", "请登录后点赞");
  288. /*location.href="login.html"*/
  289. }
  290. })
  291. /*研究方向点赞列表*/
  292. //关闭按钮
  293. $("#workclose").click(function() {
  294. $(".resAreaCover").fadeOut();
  295. $("body").css("position", "");
  296. });
  297. $("#researchAreaShow").on("click", ".list-browse,.like-num", function() {
  298. var cap = $(this).attr("caption");
  299. //console.log(cap.length);
  300. $.ajax({
  301. url: "/ajax/researchAreaLog/ql",
  302. dataType: 'json', //数据格式类型
  303. type: 'GET', //http请求类型
  304. timeout: 10000, //超时设置
  305. data: {
  306. "professorId": professorId,
  307. 'caption': cap,
  308. "rows": 10
  309. },
  310. success: function(data) {
  311. if(data.success) {
  312. $(".attentList").html("");
  313. var $info = data.data;
  314. $("#subArea").text(cap);
  315. $(".resAreaCover").fadeIn();
  316. $(".resAreaCon").show()
  317. if($info.length == 0) {
  318. $(".resAreaCon").hide();
  319. return;
  320. }
  321. for(var i = 0; i < $info.length; i++) {
  322. if($info[i].professor.hasHeadImage == 1) {
  323. var img = "/images/head/" + $info[i].professor.id + "_l.jpg";
  324. } else {
  325. var img = "../images/default-photo.jpg";
  326. }
  327. //认证
  328. var oSty=autho($info[i].professor.authType,$info[i].professor.orgAuth,$info[i].professor.authStatus);
  329. var title = "",
  330. office = "",
  331. orgName = "",
  332. address = '';
  333. if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  334. title = $info[i].professor.title + ",";
  335. office = $info[i].professor.office + ",";
  336. orgName = $info[i].professor.orgName + " | ";
  337. address = $info[i].professor.address;
  338. } else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  339. office = $info[i].professor.office + ",";
  340. orgName = $info[i].professor.orgName + " | ";
  341. address = $info[i].professor.address;
  342. } else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  343. title = $info[i].professor.title + ",";
  344. orgName = $info[i].professor.orgName + " | ";
  345. address = $info[i].professor.address;
  346. } else if($info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  347. title = $info[i].professor.title + ",";
  348. office = $info[i].professor.office + " | ";
  349. address = $info[i].professor.address;
  350. } else if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  351. title = $info[i].professor.title + ",";
  352. office = $info[i].professor.office + ",";
  353. orgName = $info[i].professor.orgName;
  354. } else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  355. orgName = $info[i].professor.orgName + " | ";
  356. address = $info[i].professor.address;
  357. } else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  358. office = $info[i].professor.office + " | ";
  359. address = $info[i].professor.address;
  360. } else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  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. title = $info[i].professor.title + " | ";
  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.title + ",";
  368. address = $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. office = $info[i].professor.office;
  372. } else if(!$info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  373. address = $info[i].professor.address;
  374. } else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  375. orgName = $info[i].professor.orgName;
  376. } else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
  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. title = $info[i].professor.title;
  380. }
  381. var addw = '<li data-id="'+$info[i].professor.id+'" style="cursor:pointer">'
  382. addw += '<a class="proinfor clearfix">'
  383. addw += '<div class="headblock floatL"><img id="proHead" class="headimg userRadius" src="' + img + '"></div>'
  384. addw += '<div class="mediaBody">'
  385. addw += '<span class="listtit"><span id="proName">' + $info[i].professor.name + '</span><em class="authiconNew ' + oSty.sty + '" title="'+ oSty.title +'"></em></span>'
  386. addw += '<div class="listtit2">' + title + office + orgName + address + '</div>'
  387. addw += '</div></a></li>'
  388. $(".attentList").append(addw);
  389. }
  390. $("body").css("position", "fixed");
  391. }
  392. },
  393. error: function() {}
  394. });
  395. });
  396. /*研究方向点赞点击每一个点赞的用户进入点赞用户的浏览页面*/
  397. $(".attentList").on("click","li",function(){
  398. var opid=$(this).attr("data-id");
  399. location.href="userInforShow.html?professorId="+opid;
  400. })
  401. $.get("/ajax/professor/info/" + professorId, function($data) {
  402. if($data.success) {
  403. var $info = $data.data;
  404. orgId=$info.orgId;
  405. orgAuth=$info.orgAuth;
  406. if(orgAuth==1){
  407. $("#orgNameS").css("cursor","pointer");
  408. }
  409. if($info) {
  410. if($info.authType == 1) {
  411. $(".yesshow").show();
  412. if(ass == 0){
  413. $('span:contains("合作历史及评价")').parents(".introduction").hide();
  414. }
  415. if(resou == 0 && ass == 0) {
  416. $('div:contains("合作机会")').parents(".menublock").hide();
  417. }
  418. } else {
  419. if($info.authentication == 3) {
  420. $("#office").hide();
  421. $("#titleS").hide();
  422. }
  423. }
  424. //修改浏览器title信息
  425. if($info.title) {
  426. var qtitle = " - " + $info.title;
  427. } else {
  428. var qtitle = "";
  429. }
  430. if($info.office) {
  431. var qoffice = " - " + $info.office;
  432. } else {
  433. var qoffice = "";
  434. }
  435. var llqtitle = $info.name + qtitle + qoffice + "-" + $info.orgName + "-科袖网";
  436. window.setInterval(function() {
  437. document.title = llqtitle;
  438. }, 500);
  439. //展示专家的信息
  440. //认证
  441. var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
  442. $(".proModify").addClass(oStyS.sty);
  443. $(".proModify").attr("title",oStyS.title);
  444. $("#nameS").text($info.name);
  445. if($info.office) {
  446. if($info.title) {
  447. $("#office").text($info.office + ",");
  448. } else {
  449. $("#office").text($info.office);
  450. }
  451. }
  452. if($info.title) {
  453. $("#titleS").text($info.title);
  454. }
  455. if($info.department) {
  456. if($info.orgName) {
  457. $("#industryS").text($info.department + ",");
  458. } else {
  459. $("#industryS").text($info.department);
  460. }
  461. }
  462. if($info.orgName) {
  463. $("#orgNameS").text($info.orgName);
  464. }
  465. if($info.address) {
  466. $("#address").text($info.address);
  467. }
  468. if($info.hasHeadImage) {
  469. $("#headImage").attr("src", "/images/head/" + professorId + "_l.jpg");
  470. } else {
  471. $("#headImage").attr("src", "/images/default-photo.jpg");
  472. }
  473. $("#orgImage").attr("src", "/images/org/" + $info.orgId + ".jpg");
  474. $("#orgImage").load(function() {})
  475. .error(function() {
  476. $("#orgImage").attr("src", "/images/default-icon.jpg");
  477. });
  478. //显示专家信息到保存数据
  479. name = $info.name;
  480. 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) {
  481. $("div:contains('个人信息')").parents(".menublock").hide();
  482. }
  483. if($info.descp) {
  484. $("#descpS").text($info.descp);
  485. } else {
  486. $("span:contains('个人简介')").parents(".introduction").hide();
  487. $("a:contains('个人简介')").hide();
  488. }
  489. //展示专家的学科
  490. //alert($info.authentication);
  491. if($info.authType == 1) {
  492. if($info.subject) {
  493. subjectShow($info.subject);
  494. } else {
  495. $("span:contains('学术领域')").parents(".introduction").hide();
  496. $("a:contains('学术领域')").hide();
  497. }
  498. } else {
  499. if($info.authentication == 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. $("span:contains('学术领域')").parents(".introduction").hide();
  508. $("a:contains('学术领域')").hide();
  509. }
  510. }
  511. //研究方向
  512. if($info.authType == 1) {
  513. if($info.researchAreas.length) {
  514. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  515. } else {
  516. $("span:contains('研究方向')").parents(".introduction").hide();
  517. $("a:contains('研究方向')").hide();
  518. }
  519. } else {
  520. $("span:contains('研究方向')").parents(".introduction").hide();
  521. $("a:contains('研究方向')").hide();
  522. }
  523. //展示专家的行业
  524. if($info.authType == 1) {
  525. if($info.industry) {
  526. industryShow($info.industry);
  527. } else {
  528. $("span:contains('应用行业')").parents(".introduction").hide();
  529. $("a:contains('应用行业')").hide();
  530. }
  531. } else {
  532. if($info.authentication == 2) {
  533. if($info.industry) {
  534. industryShow($info.industry);
  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. //教育北京
  545. if($info.edus.length) {
  546. eduBgShow($info.edus);
  547. } else {
  548. $("span:contains('教育背景')").parents(".introduction").hide();
  549. $("a:contains('教育背景')").hide();
  550. }
  551. //兼职
  552. if($info.jobs.length) {
  553. timeJobShow($info.jobs);
  554. } else {
  555. $("span:contains('工作经历')").parents(".introduction").hide();
  556. $("a:contains('工作经历')").hide();
  557. }
  558. //项目
  559. if($info.projects.length) {
  560. projectShow($info.projects)
  561. } else {
  562. $("span:contains('项目经历')").parents(".introduction").hide();
  563. $("a:contains('项目经历')").hide();
  564. }
  565. //论文
  566. if($info.papers.length) {
  567. paperShow($info.papers);
  568. } else {
  569. $("span:contains('著作、论文、文章')").parents(".introduction").hide();
  570. $("a:contains('著作、论文、文章')").hide();
  571. }
  572. //专利
  573. if($info.patents.length) {
  574. patentShow($info.patents);
  575. } else {
  576. $("span:contains('专利')").parents(".introduction").hide();
  577. $("a:contains('专利')").hide();
  578. }
  579. //荣誉
  580. if($info.honors.length) {
  581. honorShow($info.honors);
  582. } else {
  583. $("span:contains('荣誉及奖项')").parents(".introduction").hide();
  584. $("a:contains('荣誉及奖项')").hide();
  585. }
  586. //下滑滚动不覆盖底部
  587. var d;
  588. var t;
  589. $(function() {
  590. var art_height;
  591. var isHidden=$("#reA").is(":hidden");//是否隐藏
  592. if(isHidden) {
  593. art_height=0;
  594. }else{
  595. art_height=$("#reA").outerHeight(true);
  596. }
  597. $(document).scroll(function() {
  598. var top3 = $(window).height();
  599. var top5 = $(".content-left").height();
  600. var top4 = $("#container").height() + art_height;
  601. //console.log(top5+","+top4+","+top3);
  602. var top1 = $(document).scrollTop();
  603. var top2 = $("#container").height() - top3 + (top3 - 80 - top5) - 10; //变成绝对定位
  604. if(top1 >= 300) {
  605. $(".content-left").css({
  606. "position": "fixed",
  607. "top": "80px"
  608. });
  609. if(top1 >= top2) {
  610. $('.information-content').css("position", "static");
  611. $(".content-left").css("position", "absolute");
  612. $(".content-left").css("top", top4 - top5 - 10 + "px");
  613. } else {
  614. $('.information-content').css("position", "relative");
  615. $(".content-left").css({
  616. "position": "fixed",
  617. "top": "80px"
  618. });
  619. }
  620. } else {
  621. $(".content-left").css({
  622. "position": "static"
  623. });
  624. }
  625. //咨询框弹出
  626. var foot_height = $(".footerblock").height();
  627. if(top1 >= 180 && top1 < top4 - top3) {
  628. $(".coulstblock").slideDown();
  629. $(".coulstblock").css({
  630. "bottom": "0"
  631. });
  632. } else if(top1 >= top4 - top3) {
  633. $(".coulstblock").css({
  634. "bottom": -(top4 - top3 - top1 ) - art_height + "px"
  635. });
  636. } else {
  637. $(".coulstblock").slideUp();
  638. $(".coulstblock").css({
  639. "bottom": "0"
  640. });
  641. }
  642. })
  643. });
  644. //下滑滚动不覆盖底部 结束
  645. }
  646. }
  647. });
  648. }
  649. $("#hsearch").on("click", function() {
  650. var searchContent = $("#hsearchContent").val();
  651. location.href = "searchNew.html?searchContent=" + searchContent;
  652. });
  653. //拿到点击的顺序,然后求出局文档的距离
  654. $(".subsidebar").mouseenter(function(){
  655. var dd=$(this)[0].className;
  656. if(dd!="subsidebar subcolor"){
  657. $(this).css("background","#efefef");
  658. }
  659. }).mouseleave(function(){
  660. $(this).css("background","")
  661. });
  662. //专家信息点击换背景颜色
  663. $(".subsidebar").click(function() {
  664. $(".subsidebar").removeClass("subcolor");
  665. $(".subsidebar").eq($(".subsidebar").index(this)).addClass("subcolor");
  666. });
  667. $(".subsidebar").click(function() {
  668. var index = $(".subsidebar").index(this)+1;
  669. //console.log(index)
  670. var offset = $(".introduction").eq(index).offset();
  671. $("body,html").animate({
  672. scrollTop: offset.top - 80 + "px" //��body��scrollTop����pos��top����ʵ���˹���
  673. }, 1000);
  674. }).mousedown(function(){
  675. $(this).css("background","");
  676. });
  677. /*科研文章*/
  678. $.ajax({
  679. url: "/ajax/article/qaProPublish",
  680. dataType: 'json', //数据格式类型
  681. type: 'GET', //http请求类型
  682. data: {
  683. "professorId": professorId
  684. },
  685. timeout: 10000, //超时设置
  686. success: function(data) {
  687. if(data.success) {
  688. var pp=ifUserType(professorId)
  689. if(!pp.authType2) {
  690. $("#reA").hide();
  691. return;
  692. } else {
  693. if(data.data.length == 0) {
  694. $("#reA").hide();
  695. return;
  696. }
  697. $("#reA").show();
  698. for(var i = 0; i < data.data.length; i++) {
  699. var add = '<li><a href="articalShow.html?articleId=' + data.data[i].articleId + '" style="display:block;">'
  700. add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
  701. add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
  702. add += '</div><div class="tagsBox"><span></span></div>'
  703. add += '</a></li>';
  704. $add = $(add);
  705. $("#reachArticle").append($add);
  706. $add.find('.tagsBox span').text(data.data[i].subject); //data.data[i].subject
  707. if(data.data[i].articleImg) {
  708. $add.find(".art_img").attr("style", "background: url(/data/article/" + data.data[i].articleImg + ") 0 0 no-repeat;background-size:cover;");
  709. }
  710. }
  711. //资源轮播
  712. var $content2 = $(".sharescrollbox.Acrollbox");
  713. var childcount2 = $content2.find(".otherRes.shareshow li").length;
  714. Carousel(3, 3, 3, childcount2, $content2, $(".articalbtn.resounext"), $(".articalbtn.resouprev"));
  715. }
  716. }
  717. },
  718. error: function() {
  719. return;
  720. }
  721. });
  722. var resou;
  723. //科研资源
  724. $.ajax({
  725. "url": "/ajax/resource/qaProPublish",
  726. "type": "get",
  727. "async": false,
  728. "data": {
  729. "professorId": professorId
  730. },
  731. "success": function(data) {
  732. console.log(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="resourceShow.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 ellipsisSty">资源名称:<span class="presou consultTitleVal" resourceConsultTitle = "">' + data.data[i].resourceName + '</span></p>'
  763. add += '<p class="briefinfor ellipsisSty-2">应用用途:' + data.data[i].supportedServices + '</p>'
  764. add += '</div>'
  765. $("#sharescrollbox").append(add);
  766. $('.applicant').eq(i).attr("resourceId", data.data[i].resourceId);
  767. if(data.data[i].images.length) {
  768. $(".resourceImg").eq(i).attr("src","/data/resource/" + data.data[i].images[0].imageSrc);
  769. }else{
  770. $(".resourceImg").eq(i).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. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  875. $(".blackcover").remove();
  876. $("body").css("position", "");
  877. //location.reload(true);
  878. } else {
  879. $.MsgBox.Alert('message', '资源"' + resName + '"申请发送失败,请重新申请!');
  880. }
  881. },
  882. "data": $data,
  883. "beforeSend": function() { /*console.log(this.data)*/ },
  884. "contentType": "application/x-www-form-urlencoded",
  885. dataType: "json"
  886. });
  887. });
  888. } else {
  889. $.MsgBox.Alert("消息", "您还未登录,请登录之后进行资源申请");
  890. }
  891. });
  892. //科研资源中的咨询
  893. function clickResourceConsult() {
  894. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  895. var professorId = $(this).attr("professorId");
  896. consultHandler();
  897. var liEle = $("ul.menucon").children();
  898. for(var i = 0; i < liEle.length; i++) {
  899. $(liEle[i]).removeClass('clicknow');
  900. $(liEle[1]).addClass("clicknow");
  901. };
  902. var item = $(this).parent().parent().parent();
  903. var consultTitleVal = item.find(".consultTitleVal").text();
  904. $("#consultTitle").val("关于" + consultTitleVal + "的咨询");
  905. } else {
  906. $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
  907. $("#mb_btn_ok").val("去登录");
  908. var aele = document.createElement('a');
  909. $("#mb_btnbox").append(aele);
  910. $("#mb_btnbox a").css({
  911. 'display': "block",
  912. 'width': '100%',
  913. 'height': '40px',
  914. 'position': 'absolute',
  915. 'bottom': '-6px',
  916. 'left': '0'
  917. });
  918. aele.setAttribute('href', '../login.html');
  919. }
  920. };
  921. //===============点击咨询==============
  922. var userid = $.cookie("userid"); //登陆人id====重复代码
  923. var professorId = GetQueryString("professorId"); //专家id====重复代码
  924. //点击科研资源的咨询
  925. $("#consultbtn,#conbtn").bind('click', consultHandler);
  926. function consultHandler() {
  927. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  928. ConsultApply();
  929. concultProInfo(professorId);
  930. //点击的发送
  931. $("#sendConsultBtn").click(function() {
  932. sendConsultHandler($(this).attr("proId"));
  933. });
  934. } else {
  935. $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
  936. $("#mb_btn_ok").val("去登录");
  937. var aele = document.createElement('a');
  938. $("#mb_btnbox").append(aele);
  939. $("#mb_btnbox a").css({
  940. 'display': "block",
  941. 'width': '100%',
  942. 'height': '40px',
  943. 'position': 'absolute',
  944. 'bottom': '-6px',
  945. 'left': '0'
  946. });
  947. aele.setAttribute('href', '../login.html');
  948. }
  949. };
  950. //合作历史及评价
  951. var ass;
  952. $.ajax({
  953. "url": "/ajax/consult/pqAssessHis",
  954. "type": "get",
  955. "data": {
  956. "professorId": professorId
  957. },
  958. "async": false,
  959. "success": function(response) {
  960. if(response.success) {
  961. var $data = response.data.data;
  962. ass = $data.length;
  963. if($data.length == 0) {
  964. $("span:contains('合作历史及评价')").parents(".introduction").hide();
  965. $("a:contains('合作历史及评价')").hide();
  966. }
  967. for(var i = 0; i < $data.length; i++) {
  968. var add = "";
  969. var assessTime = $data[i]["assessTime"].substr(0, 4) + "-" + $data[i].assessTime.substr(4, 2) + "-" + $data[i].assessTime.substr(6, 2) + " " +
  970. $data[i].assessTime.substr(8, 2) + ":" + $data[i].assessTime.substr(10, 2);
  971. add += '<div class="evaluate2">'
  972. add += '<div class="lefteva">'
  973. add += '<a class="evaimg userRadius">'
  974. if($data[i].professor.hasHeadImage) {
  975. add += '<img src="/images/head/' + $data[i].professor.id + '_l.jpg" width="100%" height="100%">'
  976. } else {
  977. add += '<img src="/images/default-photo.jpg" width="100%" height="100%">'
  978. }
  979. add += '</a>'
  980. add += '<p>' + $data[i].professor.name + '</p><p>'
  981. // if($data[i].professor.office) {
  982. // add+='<span>'+$data[i].professor.office+' ,</span>'
  983. // }
  984. // if($data[i].professor.title) {
  985. // add+='<span>'+$data[i].professor.title+'</span>'
  986. // }
  987. add += '</p><p>'
  988. // if($data[i].professor.department) {
  989. // add+='<span>'+$data[i].professor.department+' ,</span>'
  990. // }
  991. // if($data[i].professor.orgName) {
  992. // add+='<span>'+$data[i].professor.orgName+'</span>'
  993. // }
  994. add += '</p>'
  995. add += '</div>'
  996. add += '<div class="righteva">'
  997. add += '<ul class="evasort">'
  998. add += '<li>咨询时间:<span>' + assessTime + '</span></li>'
  999. add += '</ul>'
  1000. add += '<div class="evastarbox" id="evastarboxx" style="margin-left: -5px;">'
  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 += '<span class="evastar"></span>'
  1006. add += '</div>'
  1007. if($data[i].assessContant) {
  1008. add += '<p class="evabrief">' + $data[i].assessContant + ' </p>'
  1009. }
  1010. add += '</div>'
  1011. add += '</div>'
  1012. var $add = $(add);
  1013. $(".shareabout2").append($add);
  1014. $add.find(".evastar:lt(" + $data[i].assessStar + ")").addClass('staspan');
  1015. }
  1016. $(".evaluate2").eq($data.length - 1).css("border-bottom", "none");
  1017. }
  1018. }
  1019. })
  1020. proinfo(professorId);
  1021. //底部咨询申请入口专家信息
  1022. function proinfo(professorId) {
  1023. $.ajax({
  1024. url: "/ajax/professor/editBaseInfo/" + professorId,
  1025. type: "get",
  1026. data: {
  1027. "id": professorId
  1028. },
  1029. contentType: "application/x-www-form-urlencoded",
  1030. success: function(response) {
  1031. var myData = response["data"];
  1032. //console.log(myData);
  1033. $("#foot_proname").html(myData["name"]);
  1034. if(myData["address"]) {
  1035. $("#foot_proaddress").html(' | ' + myData["address"]);
  1036. }
  1037. if(myData["title"]) {
  1038. $("#foot_protitle").html(myData["title"]);
  1039. }
  1040. if(myData["department"]) {
  1041. $("#foot_prodepar").html(myData["department"]);
  1042. }
  1043. if(myData["orgName"]) {
  1044. if(myData["department"] == null || myData["department"] == '') {
  1045. $("#foot_proorgname").html(myData["orgName"]);
  1046. } else {
  1047. $("#foot_proorgname").html(',' + myData["orgName"]);
  1048. }
  1049. }
  1050. //认证
  1051. var oStyT=autho(myData.authType,myData.orgAuth,myData.authStatus);
  1052. $("#foot_promodify").addClass(oStyT.sty);
  1053. $("#foot_promodify").attr("title",oStyT.title);
  1054. //头像
  1055. if(myData["hasHeadImage"] == 0) {
  1056. $("#foot_proimg").attr("src", "images/default-photo.jpg");
  1057. } else {
  1058. $("#foot_proimg").attr("src", "images/head/" + myData["id"] + "_l.jpg");
  1059. }
  1060. },
  1061. error: function(error) {
  1062. $.MsgBox.Alert("message", "请求数据失败");
  1063. }
  1064. });
  1065. }
  1066. /*点击机构名字进入企业浏览页面*/
  1067. $("#orgNameS").click(function(){
  1068. if(orgAuth==1){
  1069. location.href="companybrowinfor.html?orgId="+orgId;
  1070. }
  1071. })
  1072. })