portal html css js resource

attention-list.js 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. /*我的关注列表*/
  2. $(function() {
  3. var userid = $.cookie("userid");
  4. expertAttention();
  5. followResources();
  6. $("#fixbtn li").on("click",function(){
  7. var indexLi=$(this).index();
  8. $("#fixbtn li").removeClass("liactive");
  9. $(".attentsCon .attentList").hide();
  10. $("#fixbtn li").eq(indexLi).addClass("liactive");
  11. $(".attentsCon .attentList").eq(indexLi).show();
  12. });
  13. $("#lookMyAttention").click(function(){
  14. $("body").css("position","fixed");
  15. $("#attentCover").fadeIn();
  16. })
  17. //关闭按钮
  18. $("#workclose").click(function(){
  19. $("#attentCover").fadeOut();
  20. $("body").css("position","");
  21. });
  22. /*关注专家*/
  23. function expertAttention() {
  24. var data = {
  25. "professorId": userid,
  26. "watchType": 1,
  27. "pageNo": 1,
  28. "pageSize": 1000
  29. }
  30. $.ajax({
  31. url: "/ajax/watch/qaPro",
  32. data: data,
  33. dataType: 'json', //数据格式类型
  34. type: 'get', //http请求类型
  35. success: function(data) {
  36. $("#expert").html("");
  37. if(data.success && data.data.data != "") {
  38. var datalist = data.data.data;
  39. datalistEach(datalist);
  40. }
  41. },
  42. error: function() {
  43. $.MsgBox.Alert('提示', "服务器链接超时");
  44. }
  45. });
  46. }
  47. /*关注资源*/
  48. function followResources() {
  49. var data = {
  50. "professorId": userid,
  51. "watchType": 2,
  52. "pageNo": 1,
  53. "pageSize": 1000
  54. }
  55. $.ajax({
  56. url: "/ajax/watch/qaPro",
  57. data: data,
  58. dataType: 'json', //数据格式类型
  59. type: 'get', //http请求类型
  60. success: function(data) {
  61. console.log(data);
  62. $("#resources").html("");
  63. if(data.success && data.data.data != "") {
  64. var datalistd = data.data.data;
  65. ResourcesEach(datalistd);
  66. }
  67. },
  68. error: function() {
  69. $.MsgBox.Alert('提示', "服务器链接超时");
  70. }
  71. });
  72. }
  73. /*专家数据遍历*/
  74. function datalistEach(datalist) {
  75. $.each(datalist, function(index, item) {
  76. /*获取头像*/
  77. //console.log(JSON.stringify(item));
  78. if(item.professor.hasHeadImage == 1) {
  79. var img = "/images/head/" + item.professor.id + "_l.jpg";
  80. } else {
  81. var img = "../images/default-photo.jpg";
  82. }
  83. /*获取研究方向信息*/
  84. var researchAreas = item.professor.researchAreas;
  85. //console.log(JSON.stringify(item.professor.researchAreas))
  86. var rlist = '';
  87. for(var n = 0; n < researchAreas.length; n++) {
  88. //console.log(researchAreas[n].caption);
  89. rlist += '<span>' + researchAreas[n].caption
  90. if(n < researchAreas.length - 1) {
  91. rlist += " , "
  92. }
  93. rlist += '</span>';
  94. }
  95. var arr = [];
  96. arr[0] = item.professor.title || item.professor.office;
  97. arr[1] = item.professor.orgName || "";
  98. if(arr[0]) {
  99. if(arr[1]) {
  100. arr[2] = arr[0] + "," + arr[1]
  101. } else {
  102. arr[2] = arr[0];
  103. }
  104. } else {
  105. if(arr[1]) {
  106. arr[2] = arr[1];
  107. }else{
  108. arr[2] = "";
  109. }
  110. }
  111. var li = document.createElement('li');
  112. li.innerHTML = '<a class="proinfor clearfix" target="_blank" href="userInforShow.html?professorId=' + item.professor.id + '">' +
  113. '<div class="headblock floatL"><img id="proHead" class="headimg userRadius" src="' + img + '"></div>' +
  114. '<div class="mediaBody" style="padding-top:20px;">' +
  115. '<p class="h1font"><span class="listtit">' + item.professor.name + '<em class="authiconNew authicon-pro"></em></span></p>' +
  116. '<p class="listtit2 h2font">'+arr[2]+'</p>' +
  117. '<p class="ellipsisSty listtit3 h2font">' + rlist + '</p>' +
  118. '</div></a></li>';
  119. $("#expert").append(li);
  120. });
  121. }
  122. /*资源数据遍历*/
  123. function ResourcesEach(datalistd) {
  124. $.each(datalistd, function(index, item) {
  125. var oName;
  126. /*获取头像*/
  127. if(item.resource.images.length) {
  128. var img ='/data/resource/' + item.resource.images[0].imageSrc
  129. } else {
  130. var img = "../images/default-resource.jpg";
  131. }
  132. if(item.resource.editProfessor) {
  133. var stl = autho(item.resource.editProfessor.authType,item.resource.editProfessor.orgAuth, item.resource.editProfessor.authStatus);
  134. oName=item.resource.editProfessor.name;
  135. }else {
  136. var stl={};
  137. stl.sty="";
  138. stl.title="";
  139. if(item.resource.organization.authStatus==3) {
  140. stl.sty="authicon-com-ok";
  141. stl.title="认证企业";
  142. }
  143. oName=item.resource.organization.name;
  144. }
  145. var li = document.createElement('li');
  146. li.innerHTML = '<a class="proinfor clearfix" target="_blank" href="resourceShow.html?resourceId=' + item.resource.resourceId + '">' +
  147. '<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src="' + img + '"></div>' +
  148. '<div class="mediaBody" style="float:left;width:450px;overflow:hidden;">' +
  149. '<span class=" ellipsisSty listtit">' + item.resource.resourceName + '</span>' +
  150. '<p class="ellipsisSty listtit2">用途:' + item.resource.supportedServices + '</p>' +
  151. '<span class="listtit">' +oName+ '<em class="authiconNew '+stl.sty+'" title="'+stl.title+'"></em></span>' +
  152. //'<p class="listtit2"><span>' + title + '</span><span>' + office + '</span><span>' + orgName + '</span><span>' + address + '</span></p>' +
  153. '</div></a></li>';
  154. $("#resources").append(li);
  155. });
  156. }
  157. /*文章列表*/
  158. function article() {
  159. var data = {
  160. "professorId": userid,
  161. "watchType": 3,
  162. "pageNo": 1,
  163. "pageSize": 1000
  164. }
  165. $.ajax({
  166. url: "/ajax/watch/qaPro",
  167. data: data,
  168. dataType: 'json', //数据格式类型
  169. type: 'get', //http请求类型
  170. success: function(data) {
  171. if(data.success && data.data.data != "") {
  172. var $info=data.data.data;
  173. for(var i = 0; i < $info.length; i++) {
  174. var img='../images/default-artical.jpg';
  175. var oName,oString,ohref;
  176. if($info[i].article.articleImg) {
  177. img="/data/article/"+$info[i].article.articleImg;
  178. }
  179. if($info[i].article.articleType==1){
  180. oName=$info[i].article.professor.name;
  181. oString='<em class="authiconNew authicon-pro" title="科袖认证专家"></em>';
  182. ohref="articalShow.html?articleId="+$info[i].article.articleId;
  183. }else{
  184. oName=$info[i].article.organization.name;
  185. ohref="articalShow.html?articleId="+$info[i].article.articleId;
  186. if($info[i].article.organization.authStatus==3){
  187. oString='<em class="authiconNew authicon-com-ok" title="认证企业"></em>';
  188. }
  189. }
  190. var li = document.createElement('li');
  191. li.innerHTML = '<a class="proinfor clearfix" target="_blank" href="'+ohref+'">' +
  192. '<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src="' + img + '"></div>' +
  193. '<div class="mediaBody">' +
  194. '<span class="listtit" style="display:block;">' + $info[i].article.articleTitle + '</span>' +
  195. '<span class="listtit">' + oName+oString+'</span>' +
  196. '</div></a></li>';
  197. $("#article").append(li);
  198. }
  199. }
  200. },
  201. error: function() {
  202. $.MsgBox.Alert('提示', "服务器链接超时");
  203. }
  204. });
  205. }
  206. article();
  207. /*关注专利信息*/
  208. function patent() {
  209. var data = {
  210. "professorId": userid,
  211. "watchType": 4,
  212. "pageNo": 1,
  213. "pageSize": 1000
  214. }
  215. $.ajax({
  216. url: "/ajax/watch/qaPro",
  217. data: data,
  218. dataType: 'json', //数据格式类型
  219. type: 'get', //http请求类型
  220. success: function(data) {
  221. console.log(data);
  222. if(data.success && data.data.data != "") {
  223. var arr=[];
  224. for(var i in data.data.data) {
  225. arr[i]=data.data.data[i].watchObject;
  226. }
  227. $.ajax({
  228. url: "/ajax/ppatent/qm",
  229. data: {
  230. id:arr,
  231. },
  232. dataType: 'json', //数据格式类型
  233. type: 'get', //http请求类型
  234. traditional: true,
  235. success: function(data) {
  236. console.log(data);
  237. if(data.success && data.data != "") {
  238. var $data=data.data;
  239. for(var i=0;i<$data.length;i++) {
  240. var li = document.createElement('li');
  241. li.innerHTML = '<a class="proinfor clearfix" target="_blank" href="patentShow.html?patentId='+$data[i].id+'">' +
  242. '<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src="../images/default-patent.jpg"></div>' +
  243. '<div class="mediaBody">' +
  244. '<span class="listtit" style="display:block;">'+$data[i].name+'</span>' +
  245. '<span class="listtit">'+$data[i].authors.substring(0,$data[i].authors.length-1)+'</span>' +
  246. '<p class="listtit">'+$data[i].reqPerson+'</p>' +
  247. '</div></a></li>';
  248. $("#patent").append(li)
  249. }
  250. }
  251. },
  252. error: function() {
  253. $.MsgBox.Alert('提示', "服务器链接超时");
  254. }
  255. });
  256. }
  257. },
  258. error: function() {
  259. $.MsgBox.Alert('提示', "服务器链接超时");
  260. }
  261. });
  262. }
  263. patent();
  264. /*关注论文信息*/
  265. function paper() {
  266. var data = {
  267. "professorId": userid,
  268. "watchType": 5,
  269. "pageNo": 1,
  270. "pageSize": 1000
  271. }
  272. $.ajax({
  273. url: "/ajax/watch/qaPro",
  274. data: data,
  275. dataType: 'json', //数据格式类型
  276. type: 'get', //http请求类型
  277. success: function(data) {
  278. console.log(data);
  279. if(data.success && data.data.data != "") {
  280. var arr=[];
  281. for(var i in data.data.data) {
  282. arr[i]=data.data.data[i].watchObject;
  283. }
  284. $.ajax({
  285. url: "/ajax/ppaper/qm",
  286. data: {
  287. id:arr,
  288. },
  289. dataType: 'json', //数据格式类型
  290. type: 'get', //http请求类型
  291. traditional: true,
  292. success: function(data) {
  293. console.log(data);
  294. if(data.success && data.data != "") {
  295. var $data=data.data;
  296. for(var i=0;i<$data.length;i++) {
  297. var li = document.createElement('li');
  298. li.innerHTML = '<a class="proinfor clearfix" target="_blank" href="paperShow.html?paperId='+$data[i].id+'">' +
  299. '<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src="../images/default-paper.jpg"></div>' +
  300. '<div class="mediaBody">' +
  301. '<span class="listtit" style="display:block;">'+$data[i].name+'</span>' +
  302. '<span class="listtit">'+$data[i].authors.substring(0,$data[i].authors.length-1)+'</span>' +
  303. '<p class="listtit">'+$data[i].pubDay+'</p>' +
  304. '</div></a></li>';
  305. $("#paper").append(li)
  306. }
  307. }
  308. },
  309. error: function() {
  310. $.MsgBox.Alert('提示', "服务器链接超时");
  311. }
  312. });
  313. }
  314. },
  315. error: function() {
  316. $.MsgBox.Alert('提示', "服务器链接超时");
  317. }
  318. });
  319. }
  320. paper();
  321. /*关注企业信息*/
  322. /*关注论文信息*/
  323. function company() {
  324. var data = {
  325. "professorId": userid,
  326. "watchType": 6,
  327. "pageNo": 1,
  328. "pageSize": 1000
  329. }
  330. $.ajax({
  331. url: "/ajax/watch/qaPro",
  332. data: data,
  333. dataType: 'json', //数据格式类型
  334. type: 'get', //http请求类型
  335. success: function(data) {
  336. console.log(data);
  337. if(data.success && data.data.data != "") {
  338. var arr=[];
  339. for(var i in data.data.data) {
  340. arr[i]=data.data.data[i].watchObject;
  341. }
  342. $.ajax({
  343. url: "/ajax/org/qm",
  344. data: {
  345. id:arr,
  346. },
  347. dataType: 'json', //数据格式类型
  348. type: 'get', //http请求类型
  349. traditional: true,
  350. success: function(data) {
  351. console.log(data);
  352. if(data.success && data.data != "") {
  353. var $data=data.data;
  354. console.log($data);
  355. for(var i=0;i<$data.length;i++) {
  356. var li = document.createElement('li');
  357. li.innerHTML = '<a class="proinfor clearfix" target="_blank" href="">' +
  358. '<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src=""></div>' +
  359. '<div class="mediaBody">' +
  360. '<p><span class="listtit">'+$data[i].name+'<em class="authiconNew" title=""></em></span></p>'+
  361. '<span class="listtit" id="orgTit"></span>' +
  362. '<span class="listtit" id="orgOther"></span>' +
  363. '</div></a></li>';
  364. var $itemlist=$(li);
  365. $("#company").append(li);
  366. $itemlist.find("a").attr("href", "cmpInforShow.html?orgId=" + $data[i].id );
  367. if($data[i].hasOrgLogo) {
  368. $itemlist.find("#proHead").attr("src", "/images/org/" + $data[i].id + ".jpg" );
  369. }else{
  370. $itemlist.find("#proHead").attr("src", "/images/default-icon.jpg" );
  371. }
  372. if($data[i].authStatus == 3) {
  373. $itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "科袖认证企业");;
  374. }
  375. console.log($data[i])
  376. var orgOther = "";
  377. if($data[i].industry) {
  378. orgOther = $data[i].industry.replace(/,/gi, " | ");
  379. }
  380. $itemlist.find("#orgOther").text(orgOther);
  381. if($data[i].orgType == "2") {
  382. $itemlist.find("#orgTit").html(orgTypeShow[$data[i].orgType] + "<span style='margin-right:10px;'></span>");
  383. }
  384. }
  385. }
  386. },
  387. error: function() {
  388. $.MsgBox.Alert('提示', "服务器链接超时");
  389. }
  390. });
  391. }
  392. },
  393. error: function() {
  394. $.MsgBox.Alert('提示', "服务器链接超时");
  395. }
  396. });
  397. }
  398. company();
  399. })