portal html css js resource

information.brow.js 39KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143
  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 userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_s.jpg'></span>";
  204. } else {
  205. showDiv += "<span class='like-people userRadius'><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 userRadius'><img class='like-h' src='../images/head/" + $photos[j].id + "_s.jpg'></span>";
  212. } else {
  213. showDiv += "<span class='like-people userRadius'><img class='like-h' src='../images/default-photo.jpg'></span>";
  214. }
  215. }
  216. showDiv += "<span class='like-people like-more userRadius'></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. //认证
  326. var oSty=autho($info[i].professor.authType,$info[i].professor.orgAuth,$info[i].professor.authStatus);
  327. var title = "",
  328. office = "",
  329. orgName = "",
  330. address = '';
  331. if($info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  332. title = $info[i].professor.title + ",";
  333. office = $info[i].professor.office + ",";
  334. orgName = $info[i].professor.orgName + " | ";
  335. address = $info[i].professor.address;
  336. } else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  337. office = $info[i].professor.office + ",";
  338. orgName = $info[i].professor.orgName + " | ";
  339. address = $info[i].professor.address;
  340. } else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  341. title = $info[i].professor.title + ",";
  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. title = $info[i].professor.title + ",";
  346. office = $info[i].professor.office + " | ";
  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. office = $info[i].professor.office + ",";
  351. orgName = $info[i].professor.orgName;
  352. } else if(!$info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && $info[i].professor.address) {
  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. office = $info[i].professor.office + " | ";
  357. address = $info[i].professor.address;
  358. } else if(!$info[i].professor.title && $info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  359. office = $info[i].professor.office + ",";
  360. orgName = $info[i].professor.orgName;
  361. } else if($info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  362. title = $info[i].professor.title + " | ";
  363. address = $info[i].professor.address;
  364. } else if($info[i].professor.title && !$info[i].professor.office && $info[i].professor.orgName && !$info[i].professor.address) {
  365. office = $info[i].professor.title + ",";
  366. address = $info[i].professor.orgName;
  367. } else if($info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
  368. title = $info[i].professor.title + ",";
  369. office = $info[i].professor.office;
  370. } else if(!$info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && $info[i].professor.address) {
  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. orgName = $info[i].professor.orgName;
  374. } else if(!$info[i].professor.title && $info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
  375. office = $info[i].professor.office;
  376. } else if($info[i].professor.title && !$info[i].professor.office && !$info[i].professor.orgName && !$info[i].professor.address) {
  377. title = $info[i].professor.title;
  378. }
  379. var addw = '<li data-id="'+$info[i].professor.id+'" style="cursor:pointer">'
  380. addw += '<a class="proinfor clearfix">'
  381. addw += '<div class="headblock floatL"><img id="proHead" class="headimg userRadius" src="' + img + '"></div>'
  382. addw += '<div class="mediaBody">'
  383. addw += '<span class="listtit"><span id="proName">' + $info[i].professor.name + '</span><em class="authiconNew ' + oSty.sty + '" title="'+ oSty.title +'"></em></span>'
  384. addw += '<div class="listtit2">' + title + office + orgName + address + '</div>'
  385. addw += '</div></a></li>'
  386. $(".attentList").append(addw);
  387. }
  388. $("body").css("position", "fixed");
  389. }
  390. },
  391. error: function() {}
  392. });
  393. });
  394. /*研究方向点赞点击每一个点赞的用户进入点赞用户的浏览页面*/
  395. $(".attentList").on("click","li",function(){
  396. var opid=$(this).attr("data-id");
  397. location.href="information-brow.html?professorId="+opid;
  398. })
  399. $.get("/ajax/professor/info/" + professorId, function($data) {
  400. if($data.success) {
  401. var $info = $data.data;
  402. orgId=$info.orgId;
  403. orgAuth=$info.orgAuth;
  404. if(orgAuth==1){
  405. $("#orgNameS").css("cursor","pointer");
  406. }
  407. if($info) {
  408. if($info.authType == 1) {
  409. $(".yesshow").show();
  410. if(ass == 0){
  411. $('span:contains("合作历史及评价")').parents(".introduction").hide();
  412. }
  413. if(resou == 0 && ass == 0) {
  414. $('div:contains("合作机会")').parents(".menublock").hide();
  415. }
  416. } else {
  417. if($info.authentication == 3) {
  418. $("#office").hide();
  419. $("#titleS").hide();
  420. }
  421. }
  422. //修改浏览器title信息
  423. if($info.title) {
  424. var qtitle = " - " + $info.title;
  425. } else {
  426. var qtitle = "";
  427. }
  428. if($info.office) {
  429. var qoffice = " - " + $info.office;
  430. } else {
  431. var qoffice = "";
  432. }
  433. var llqtitle = $info.name + qtitle + qoffice + "-" + $info.orgName + "-科袖网";
  434. window.setInterval(function() {
  435. document.title = llqtitle;
  436. }, 500);
  437. //展示专家的信息
  438. //认证
  439. var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
  440. $(".proModify").addClass(oStyS.sty);
  441. $(".proModify").attr("title",oStyS.title);
  442. $("#nameS").text($info.name);
  443. if($info.office) {
  444. if($info.title) {
  445. $("#office").text($info.office + ",");
  446. } else {
  447. $("#office").text($info.office);
  448. }
  449. }
  450. if($info.title) {
  451. $("#titleS").text($info.title);
  452. }
  453. if($info.department) {
  454. if($info.orgName) {
  455. $("#industryS").text($info.department + ",");
  456. } else {
  457. $("#industryS").text($info.department);
  458. }
  459. }
  460. if($info.orgName) {
  461. $("#orgNameS").text($info.orgName);
  462. }
  463. if($info.address) {
  464. $("#address").text($info.address);
  465. }
  466. if($info.hasHeadImage) {
  467. $("#headImage").attr("src", "/images/head/" + professorId + "_l.jpg");
  468. } else {
  469. $("#headImage").attr("src", "/images/default-photo.jpg");
  470. }
  471. $("#orgImage").attr("src", "/images/org/" + $info.orgId + ".jpg");
  472. $("#orgImage").load(function() {})
  473. .error(function() {
  474. $("#orgImage").attr("src", "/images/default-icon.jpg");
  475. });
  476. //显示专家信息到保存数据
  477. name = $info.name;
  478. 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) {
  479. $("div:contains('个人信息')").parents(".menublock").hide();
  480. }
  481. if($info.descp) {
  482. $("#descpS").text($info.descp);
  483. } else {
  484. $("span:contains('个人简介')").parents(".introduction").hide();
  485. $("a:contains('个人简介')").hide();
  486. }
  487. //展示专家的学科
  488. //alert($info.authentication);
  489. if($info.authType == 1) {
  490. if($info.subject) {
  491. subjectShow($info.subject);
  492. } else {
  493. $("span:contains('学术领域')").parents(".introduction").hide();
  494. $("a:contains('学术领域')").hide();
  495. }
  496. } else {
  497. if($info.authentication == 1) {
  498. if($info.subject) {
  499. subjectShow($info.subject);
  500. } else {
  501. $("span:contains('学术领域')").parents(".introduction").hide();
  502. $("a:contains('学术领域')").hide();
  503. }
  504. } else {
  505. $("span:contains('学术领域')").parents(".introduction").hide();
  506. $("a:contains('学术领域')").hide();
  507. }
  508. }
  509. //研究方向
  510. if($info.authType == 1) {
  511. if($info.researchAreas.length) {
  512. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  513. } else {
  514. $("span:contains('研究方向')").parents(".introduction").hide();
  515. $("a:contains('研究方向')").hide();
  516. }
  517. } else {
  518. $("span:contains('研究方向')").parents(".introduction").hide();
  519. $("a:contains('研究方向')").hide();
  520. }
  521. //展示专家的行业
  522. if($info.authType == 1) {
  523. if($info.industry) {
  524. industryShow($info.industry);
  525. } else {
  526. $("span:contains('应用行业')").parents(".introduction").hide();
  527. $("a:contains('应用行业')").hide();
  528. }
  529. } else {
  530. if($info.authentication == 2) {
  531. if($info.industry) {
  532. industryShow($info.industry);
  533. } else {
  534. $("span:contains('应用行业')").parents(".introduction").hide();
  535. $("a:contains('应用行业')").hide();
  536. }
  537. } else {
  538. $("span:contains('应用行业')").parents(".introduction").hide();
  539. $("a:contains('应用行业')").hide();
  540. }
  541. }
  542. //教育北京
  543. if($info.edus.length) {
  544. eduBgShow($info.edus);
  545. } else {
  546. $("span:contains('教育背景')").parents(".introduction").hide();
  547. $("a:contains('教育背景')").hide();
  548. }
  549. //兼职
  550. if($info.jobs.length) {
  551. timeJobShow($info.jobs);
  552. } else {
  553. $("span:contains('工作经历')").parents(".introduction").hide();
  554. $("a:contains('工作经历')").hide();
  555. }
  556. //项目
  557. if($info.projects.length) {
  558. projectShow($info.projects)
  559. } else {
  560. $("span:contains('项目经历')").parents(".introduction").hide();
  561. $("a:contains('项目经历')").hide();
  562. }
  563. //论文
  564. if($info.papers.length) {
  565. paperShow($info.papers);
  566. } else {
  567. $("span:contains('著作、论文、文章')").parents(".introduction").hide();
  568. $("a:contains('著作、论文、文章')").hide();
  569. }
  570. //专利
  571. if($info.patents.length) {
  572. patentShow($info.patents);
  573. } else {
  574. $("span:contains('专利')").parents(".introduction").hide();
  575. $("a:contains('专利')").hide();
  576. }
  577. //荣誉
  578. if($info.honors.length) {
  579. honorShow($info.honors);
  580. } else {
  581. $("span:contains('荣誉及奖项')").parents(".introduction").hide();
  582. $("a:contains('荣誉及奖项')").hide();
  583. }
  584. //下滑滚动不覆盖底部
  585. var d;
  586. var t;
  587. $(function() {
  588. var art_height;
  589. var isHidden=$("#reA").is(":hidden");//是否隐藏
  590. if(isHidden) {
  591. art_height=0;
  592. }else{
  593. art_height=$("#reA").outerHeight(true);
  594. }
  595. $(document).scroll(function() {
  596. var top3 = $(window).height();
  597. var top5 = $(".content-left").height();
  598. var top4 = $("#container").height() + art_height;
  599. //console.log(top5+","+top4+","+top3);
  600. var top1 = $(document).scrollTop();
  601. var top2 = $("#container").height() - top3 + (top3 - 80 - top5) - 10; //变成绝对定位
  602. if(top1 >= 300) {
  603. $(".content-left").css({
  604. "position": "fixed",
  605. "top": "80px"
  606. });
  607. if(top1 >= top2) {
  608. $('.information-content').css("position", "static");
  609. $(".content-left").css("position", "absolute");
  610. $(".content-left").css("top", top4 - top5 - 10 + "px");
  611. } else {
  612. $('.information-content').css("position", "relative");
  613. $(".content-left").css({
  614. "position": "fixed",
  615. "top": "80px"
  616. });
  617. }
  618. } else {
  619. $(".content-left").css({
  620. "position": "static"
  621. });
  622. }
  623. //咨询框弹出
  624. var foot_height = $(".footerblock").height();
  625. if(top1 >= 180 && top1 < top4 - top3) {
  626. $(".coulstblock").slideDown();
  627. $(".coulstblock").css({
  628. "bottom": "0"
  629. });
  630. } else if(top1 >= top4 - top3) {
  631. $(".coulstblock").css({
  632. "bottom": -(top4 - top3 - top1 ) - art_height + "px"
  633. });
  634. } else {
  635. $(".coulstblock").slideUp();
  636. $(".coulstblock").css({
  637. "bottom": "0"
  638. });
  639. }
  640. })
  641. });
  642. //下滑滚动不覆盖底部 结束
  643. }
  644. }
  645. });
  646. }
  647. $("#hsearch").on("click", function() {
  648. var searchContent = $("#hsearchContent").val();
  649. location.href = "search.html?searchContent=" + searchContent;
  650. });
  651. //拿到点击的顺序,然后求出局文档的距离
  652. $(".subsidebar").mouseenter(function(){
  653. var dd=$(this)[0].className;
  654. if(dd!="subsidebar subcolor"){
  655. $(this).css("background","#efefef");
  656. }
  657. }).mouseleave(function(){
  658. $(this).css("background","")
  659. });
  660. //专家信息点击换背景颜色
  661. $(".subsidebar").click(function() {
  662. $(".subsidebar").removeClass("subcolor");
  663. $(".subsidebar").eq($(".subsidebar").index(this)).addClass("subcolor");
  664. });
  665. $(".subsidebar").click(function() {
  666. var index = $(".subsidebar").index(this)+1;
  667. //console.log(index)
  668. var offset = $(".introduction").eq(index).offset();
  669. $("body,html").animate({
  670. scrollTop: offset.top - 80 + "px" //��body��scrollTop����pos��top����ʵ���˹���
  671. }, 1000);
  672. }).mousedown(function(){
  673. $(this).css("background","");
  674. });
  675. /*科研文章*/
  676. $.ajax({
  677. url: "/ajax/article/qaPro",
  678. dataType: 'json', //数据格式类型
  679. type: 'GET', //http请求类型
  680. data: {
  681. "professorId": professorId
  682. },
  683. timeout: 10000, //超时设置
  684. success: function(data) {
  685. if(data.success) {
  686. var pp=ifUserType(professorId)
  687. if(!pp.authType2) {
  688. $("#reA").hide();
  689. return;
  690. } else {
  691. if(data.data.length == 0) {
  692. $("#reA").hide();
  693. return;
  694. }
  695. $("#reA").show();
  696. for(var i = 0; i < data.data.length; i++) {
  697. var add = '<li><a href="articalInfo.html?articleId=' + data.data[i].articleId + '&professorId=' + professorId + '" style="display:block;">'
  698. add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
  699. add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
  700. add += '</div><div class="tagsBox"><span></span></div>'
  701. add += '</a></li>';
  702. $add = $(add);
  703. $("#reachArticle").append($add);
  704. $add.find('.tagsBox span').text(data.data[i].industry); //data.data[i].subject
  705. if(data.data[i].articleImg) {
  706. $add.find(".art_img").attr("style", "background: url(/data/article/" + data.data[i].articleImg + ") 0 0 no-repeat;background-size:cover;");
  707. }
  708. }
  709. //资源轮播
  710. var $content2 = $(".sharescrollbox.Acrollbox");
  711. var childcount2 = $content2.find(".otherRes.shareshow li").length;
  712. Carousel(3, 3, 3, childcount2, $content2, $(".articalbtn.resounext"), $(".articalbtn.resouprev"));
  713. }
  714. }
  715. },
  716. error: function() {
  717. return;
  718. }
  719. });
  720. var resou;
  721. //科研资源
  722. $.ajax({
  723. "url": "/ajax/resource/qapro",
  724. "type": "get",
  725. "async": false,
  726. "data": {
  727. "professorId": professorId
  728. },
  729. "success": function(data) {
  730. if(data.success) {
  731. var pp=ifUserType(professorId)
  732. if(!pp.authType2) {
  733. $("span:contains('研发资源')").parents(".introduction").hide();
  734. return;
  735. } else {
  736. resou = data.data.length;
  737. if(data.data.length == 0) {
  738. $("#infor-browse").css("display", "none");
  739. $("span:contains('研发资源')").parents(".introduction").hide();
  740. $("a:contains('研发资源')").hide();
  741. return;
  742. } else {
  743. $("span:contains('研发资源')").parents(".introduction").show();
  744. }
  745. if(data.data.length > 3) {
  746. $("#infor-browse").css("display", "block");
  747. $(".resoubtn").css("display", "block");
  748. }
  749. var add = "";
  750. for(var i = 0; i < data.data.length; i++) {
  751. add = '<div class="sharesrc">'
  752. add += '<div class="shareshow">'
  753. add += '<a href="resourceInfo.html?resourceId=' + data.data[i].resourceId + '"class="remess" style="display:block;" resourceId=' + data.data[i].resourceId + '>'
  754. add += '<div class="ResImgBox" style="max-width:200px;width:200px;height: 200px;">'
  755. add += '<img class="resImg headRadius resourceImg" src="/images/resource/' + data.data[i].resourceId + '.jpg" />'
  756. add += '</div></a>'
  757. add += '<div class="shareopeart"><a class="sharebtn resourceConsult" professorId=' + data.data[i]["professorId"] + '>咨询</a><a class="sharebtn applicant" style="display:none">申请</a></div>'
  758. add += '</div>'
  759. add += '<p class="restit ellipsisSty">资源名称:<span class="presou consultTitleVal" resourceConsultTitle = "">' + data.data[i].resourceName + '</span></p>'
  760. add += '<p class="briefinfor ellipsisSty-2">应用用途:' + data.data[i].supportedServices + '</p>'
  761. add += '</div>'
  762. $("#sharescrollbox").append(add);
  763. $('.applicant').eq(i).attr("resourceId", data.data[i].resourceId);
  764. $(".resourceImg").eq(i).attr("src", "/images/resource/" + data.data[i].resourceId + ".jpg");
  765. $(".resourceImg").load(function() {})
  766. .error(function() {
  767. $(this).attr("src", "/images/default-resource.jpg");
  768. });
  769. add = "";
  770. }
  771. //资源轮播
  772. var $content = $("#sharescrollbox");
  773. var childcount = $content.find(".sharesrc").length;
  774. Carousel(3, 3, 3, childcount, $content, $(".resoubtn2.resounext"), $(".resoubtn2.resouprev"));
  775. //科研资源中点咨询
  776. $(".introduction").find(".resourceConsult").bind("click", clickResourceConsult);
  777. }
  778. } else {
  779. $.MsgBox.Alert("消息", "系统异常!");
  780. }
  781. },
  782. "error": function() {
  783. $.MsgBox.Alert('message', 'failddd')
  784. }
  785. });
  786. function getIdentity(professorId) {
  787. $.ajax({
  788. "url": "ajax/professor/" + professorId,
  789. "type": "get",
  790. "async": false,
  791. "success": function(data) {
  792. if(data.success) {
  793. //console.log(data);
  794. $("option")[0].value = data.data.name;
  795. $("option")[1].value = data.data.organization.name;
  796. //console.log($("option")[0].value);
  797. //console.log($("option")[1].value);
  798. } else {
  799. $.MsgBox.Alert("消息", "系统异常!");
  800. }
  801. },
  802. "error": function() {
  803. $.MsgBox.Alert('message', 'failddd')
  804. }
  805. })
  806. }
  807. //资源申请入口
  808. $('.introduction').on("click", '.applicant', function() {
  809. if(userid && userid != null && userid != "null") {
  810. ResourceApply(); //调用资源申请HTML创建函数
  811. $(".limitBox").removeClass("limitBox");
  812. $(".limitwords").removeClass("limitwords");
  813. $(".limitwordbox").removeClass("limitwordbox");
  814. //获取当前时间并且格式化时间
  815. var myDate = new Date();
  816. var nowYear = myDate.getFullYear();
  817. var nowMonth = myDate.getMonth() + 1;
  818. var nowDate = myDate.getDate();
  819. if(nowMonth < 10) {
  820. nowMonth = "0" + nowMonth.toString();
  821. }
  822. if(nowDate < 10) {
  823. nowDate = "0" + nowDate.toString();
  824. }
  825. var now = nowYear + "-" + nowMonth + "-" + nowDate;
  826. $("#datepicker").val(now);
  827. $("#datepicker").datepicker({
  828. "dateFormat": " yy-mm-dd"
  829. });
  830. $(".timelo").css("display", "none");
  831. $(".namecon").text(name);
  832. $(".applysure").hide();
  833. $(".btnboxup").hide();
  834. var index1 = $(this).parent().parent().parent().index();
  835. var resName = $('.presou').eq(index1).text();
  836. var resourceID = $(this).attr("resourceId");
  837. $.ajax({
  838. "url": "/ajax/resource/" + resourceID,
  839. "type": "get",
  840. "async": false,
  841. "success": function(info) {
  842. if(info.success) {
  843. if(info.data.images.length) {
  844. $(".resouImage").attr("src", "/images/resource/" + resourceID + ".jpg");
  845. } else {
  846. $(".resouImage").attr("src", "/images/default-resource.jpg");
  847. }
  848. }
  849. }
  850. })
  851. $(".log").text(resName);
  852. getIdentity(userid);
  853. $("#deliver").on("click", function() {
  854. var $data = {};
  855. $data.demandId = userid;
  856. $data.resourceId = resourceID;
  857. $data.detailDemand = $(".detail").val();
  858. //去除时间里面的- 和字符串前后的空格
  859. $data.deliverTime = replaceStr($.trim($(".dealTime").val()));
  860. //alert(replaceStr($.trim($(".dealTime").val())));
  861. //alert(replaceStr($.trim($(".dealTime").val())).length);
  862. $data.operationStatus = 1;
  863. $data.applysquare = $("select option:selected").val();
  864. //console.log($data.applysquare);
  865. $.ajax({
  866. "url": "/ajax/operation",
  867. "type": "POST",
  868. "success": function(rdata) {
  869. if(rdata.success) {
  870. $.MsgBox.Alert('message', '资源"' + resName + '"申请发送成功!');
  871. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  872. $(".blackcover").remove();
  873. $("body").css("position", "");
  874. //location.reload(true);
  875. } else {
  876. $.MsgBox.Alert('message', '资源"' + resName + '"申请发送失败,请重新申请!');
  877. }
  878. },
  879. "data": $data,
  880. "beforeSend": function() { /*console.log(this.data)*/ },
  881. "contentType": "application/x-www-form-urlencoded",
  882. dataType: "json"
  883. });
  884. });
  885. } else {
  886. $.MsgBox.Alert("消息", "您还未登录,请登录之后进行资源申请");
  887. }
  888. });
  889. //科研资源中的咨询
  890. function clickResourceConsult() {
  891. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  892. var professorId = $(this).attr("professorId");
  893. consultHandler();
  894. var liEle = $("ul.menucon").children();
  895. for(var i = 0; i < liEle.length; i++) {
  896. $(liEle[i]).removeClass('clicknow');
  897. $(liEle[1]).addClass("clicknow");
  898. };
  899. var item = $(this).parent().parent().parent();
  900. var consultTitleVal = item.find(".consultTitleVal").text();
  901. $("#consultTitle").val("关于" + consultTitleVal + "的咨询");
  902. } else {
  903. $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
  904. $("#mb_btn_ok").val("去登录");
  905. var aele = document.createElement('a');
  906. $("#mb_btnbox").append(aele);
  907. $("#mb_btnbox a").css({
  908. 'display': "block",
  909. 'width': '100%',
  910. 'height': '40px',
  911. 'position': 'absolute',
  912. 'bottom': '-6px',
  913. 'left': '0'
  914. });
  915. aele.setAttribute('href', '../login.html');
  916. }
  917. };
  918. //===============点击咨询==============
  919. var userid = $.cookie("userid"); //登陆人id====重复代码
  920. var professorId = GetQueryString("professorId"); //专家id====重复代码
  921. //点击科研资源的咨询
  922. $("#consultbtn,#conbtn").bind('click', consultHandler);
  923. function consultHandler() {
  924. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  925. ConsultApply();
  926. concultProInfo(professorId);
  927. //点击的发送
  928. $("#sendConsultBtn").click(function() {
  929. sendConsultHandler($(this).attr("proId"));
  930. });
  931. } else {
  932. $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
  933. $("#mb_btn_ok").val("去登录");
  934. var aele = document.createElement('a');
  935. $("#mb_btnbox").append(aele);
  936. $("#mb_btnbox a").css({
  937. 'display': "block",
  938. 'width': '100%',
  939. 'height': '40px',
  940. 'position': 'absolute',
  941. 'bottom': '-6px',
  942. 'left': '0'
  943. });
  944. aele.setAttribute('href', '../login.html');
  945. }
  946. };
  947. //合作历史及评价
  948. var ass;
  949. $.ajax({
  950. "url": "/ajax/consult/pqAssessHis",
  951. "type": "get",
  952. "data": {
  953. "professorId": professorId
  954. },
  955. "async": false,
  956. "success": function(response) {
  957. if(response.success) {
  958. var $data = response.data.data;
  959. ass = $data.length;
  960. if($data.length == 0) {
  961. $("span:contains('合作历史及评价')").parents(".introduction").hide();
  962. $("a:contains('合作历史及评价')").hide();
  963. }
  964. for(var i = 0; i < $data.length; i++) {
  965. var add = "";
  966. var assessTime = $data[i]["assessTime"].substr(0, 4) + "-" + $data[i].assessTime.substr(4, 2) + "-" + $data[i].assessTime.substr(6, 2) + " " +
  967. $data[i].assessTime.substr(8, 2) + ":" + $data[i].assessTime.substr(10, 2);
  968. add += '<div class="evaluate2">'
  969. add += '<div class="lefteva">'
  970. add += '<a class="evaimg userRadius">'
  971. if($data[i].professor.hasHeadImage) {
  972. add += '<img src="/images/head/' + $data[i].professor.id + '_l.jpg" width="100%" height="100%">'
  973. } else {
  974. add += '<img src="/images/default-photo.jpg" width="100%" height="100%">'
  975. }
  976. add += '</a>'
  977. add += '<p>' + $data[i].professor.name + '</p><p>'
  978. // if($data[i].professor.office) {
  979. // add+='<span>'+$data[i].professor.office+' ,</span>'
  980. // }
  981. // if($data[i].professor.title) {
  982. // add+='<span>'+$data[i].professor.title+'</span>'
  983. // }
  984. add += '</p><p>'
  985. // if($data[i].professor.department) {
  986. // add+='<span>'+$data[i].professor.department+' ,</span>'
  987. // }
  988. // if($data[i].professor.orgName) {
  989. // add+='<span>'+$data[i].professor.orgName+'</span>'
  990. // }
  991. add += '</p>'
  992. add += '</div>'
  993. add += '<div class="righteva">'
  994. add += '<ul class="evasort">'
  995. add += '<li>咨询时间:<span>' + assessTime + '</span></li>'
  996. add += '</ul>'
  997. add += '<div class="evastarbox" id="evastarboxx" style="margin-left: -5px;">'
  998. add += '<span class="evastar"></span>'
  999. add += '<span class="evastar"></span>'
  1000. add += '<span class="evastar"></span>'
  1001. add += '<span class="evastar"></span>'
  1002. add += '<span class="evastar"></span>'
  1003. add += '</div>'
  1004. if($data[i].assessContant) {
  1005. add += '<p class="evabrief">' + $data[i].assessContant + ' </p>'
  1006. }
  1007. add += '</div>'
  1008. add += '</div>'
  1009. var $add = $(add);
  1010. $(".shareabout2").append($add);
  1011. $add.find(".evastar:lt(" + $data[i].assessStar + ")").addClass('staspan');
  1012. }
  1013. $(".evaluate2").eq($data.length - 1).css("border-bottom", "none");
  1014. }
  1015. }
  1016. })
  1017. proinfo(professorId);
  1018. //底部咨询申请入口专家信息
  1019. function proinfo(professorId) {
  1020. $.ajax({
  1021. url: "/ajax/professor/editBaseInfo/" + professorId,
  1022. type: "get",
  1023. data: {
  1024. "id": professorId
  1025. },
  1026. contentType: "application/x-www-form-urlencoded",
  1027. success: function(response) {
  1028. var myData = response["data"];
  1029. //console.log(myData);
  1030. $("#foot_proname").html(myData["name"]);
  1031. if(myData["address"]) {
  1032. $("#foot_proaddress").html(' | ' + myData["address"]);
  1033. }
  1034. if(myData["title"]) {
  1035. $("#foot_protitle").html(myData["title"]);
  1036. }
  1037. if(myData["department"]) {
  1038. $("#foot_prodepar").html(myData["department"]);
  1039. }
  1040. if(myData["orgName"]) {
  1041. if(myData["department"] == null || myData["department"] == '') {
  1042. $("#foot_proorgname").html(myData["orgName"]);
  1043. } else {
  1044. $("#foot_proorgname").html(',' + myData["orgName"]);
  1045. }
  1046. }
  1047. //认证
  1048. var oStyT=autho(myData.authType,myData.orgAuth,myData.authStatus);
  1049. $("#foot_promodify").addClass(oStyT.sty);
  1050. $("#foot_promodify").attr("title",oStyT.title);
  1051. //头像
  1052. if(myData["hasHeadImage"] == 0) {
  1053. $("#foot_proimg").attr("src", "images/default-photo.jpg");
  1054. } else {
  1055. $("#foot_proimg").attr("src", "images/head/" + myData["id"] + "_l.jpg");
  1056. }
  1057. },
  1058. error: function(error) {
  1059. $.MsgBox.Alert("message", "请求数据失败");
  1060. }
  1061. });
  1062. }
  1063. /*点击机构名字进入企业浏览页面*/
  1064. $("#orgNameS").click(function(){
  1065. if(orgAuth==1){
  1066. location.href="companybrowinfor.html?orgId="+orgId;
  1067. }
  1068. })
  1069. })