portal html css js resource

paperShow.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. $(document).ready(function() {
  2. loginStatus(); //判断个人是否登录
  3. var userid = $.cookie("userid");
  4. var userName = $.cookie("userName");
  5. var paperId = GetQueryString("paperId");
  6. ifcollectionAbout(paperId,$(".attenSpan").eq(0), 5)
  7. getPaperMe();
  8. pageViewsVal();
  9. if(userid && userid != "null" && userid != null){
  10. $(".ifLoginOn").removeClass("displayNone");
  11. }else{
  12. $(".ifLoginUn").removeClass("displayNone");
  13. }
  14. //点击收藏按钮
  15. $("#collectBtn").on('click', function() {
  16. if(userid && userid != null && userid != "null") {
  17. if($(this).is('.icon-collected')){
  18. cancelCollectionAbout(paperId,$(this), 5)
  19. } else {
  20. collectionAbout(paperId,$(this), 5);
  21. }
  22. }else{
  23. $.MsgBox.Alert("提示", "请先登录再进行收藏");
  24. $("#mb_btn_ok").val("去登录");
  25. var aele = document.createElement('a');
  26. $("#mb_btnbox").append(aele);
  27. $("#mb_btnbox a").css({
  28. 'display': "block",
  29. 'width': '100%',
  30. 'height': '40px',
  31. 'position': 'absolute',
  32. 'bottom': '-6px',
  33. 'left': '0'
  34. });
  35. aele.setAttribute('href', '../login.html');
  36. }
  37. });
  38. //关键词标签点击进去搜索
  39. $(".tagList").on("click","li",function(){
  40. var tagText = $(this).find("p").text();
  41. location.href = "searchNew.html?searchContent=" + tagText + "&tagflag=6";
  42. })
  43. //点击进入个人详情页面
  44. $("#aboutAuthors").on("click","li>a",function(){
  45. var oDataId = $(this).attr("data-id");
  46. if(oDataId.substring(0,1)!="#"){
  47. $(this).attr("href","userInforShow.html?professorId="+oDataId);
  48. }else{
  49. $(this).attr("href","javascript:void(0)");
  50. }
  51. })
  52. $("#aboutAuthors").on("click","li.lastBtn",function(){
  53. $("#aboutAuthors li").css("display","block");
  54. $(this).hide();
  55. })
  56. //点击关注按钮
  57. $("#aboutAuthors").on('click',"span.attenSpan", function() {
  58. var pId=$(this).parent().siblings("a").attr("data-id");
  59. if(userid && userid != null && userid != "null") {
  60. if($(this).is('.attenedSpan')){
  61. cancelCollectionAbout(pId,$(this),1)
  62. } else {
  63. collectionAbout(pId,$(this),1);
  64. }
  65. }else{
  66. $.MsgBox.Alert("提示", "请先登录再进行关注");
  67. $("#mb_btn_ok").val("去登录");
  68. var aele = document.createElement('a');
  69. $("#mb_btnbox").append(aele);
  70. $("#mb_btnbox a").css({
  71. 'display': "block",
  72. 'width': '100%',
  73. 'height': '40px',
  74. 'position': 'absolute',
  75. 'bottom': '-6px',
  76. 'left': '0'
  77. });
  78. aele.setAttribute('href', '../login.html');
  79. }
  80. });
  81. /*获取论文信息*/
  82. function getPaperMe() {
  83. $.ajax({
  84. "url": "/ajax/ppaper/qo",
  85. "type": "GET",
  86. "success": function(data) {
  87. console.log(data);
  88. if(data.success) {
  89. paperHtml(data.data);
  90. getPaperAuthors(data.data.id)
  91. var paperName = data.data.name + "-科袖网";
  92. document.title = paperName;
  93. }
  94. },
  95. "data": {
  96. "id": paperId
  97. },
  98. dataType: "json",
  99. 'error': function() {
  100. $.MsgBox.Alert('提示', '服务器连接超时!');
  101. }
  102. });
  103. }
  104. /*获取论文作者信息*/
  105. function getPaperAuthors(stritrm) {
  106. $.ajax({
  107. "url": "/ajax/ppaper/authors",
  108. "type": "GET",
  109. "success": function(data) {
  110. console.log(data);
  111. if(data.success) {
  112. if(data.data.length>0){
  113. $("#aboutAuthors .lastBtn span").text(data.data.length);
  114. for(var i=0;i<data.data.length;i++){
  115. var authTy="",authTit="",baseInfo="",ifPoint="",imgbg="../images/default-photo.jpg";
  116. if(data.data[i].professorId.substring(0, 1) != "#"){
  117. $.ajax({
  118. type:"get",
  119. url:"/ajax/professor/editBaseInfo/" + data.data[i].professorId,
  120. async:false,
  121. success:function($proData){
  122. console.log($proData)
  123. if($proData.success){
  124. var showPro = $proData.data;
  125. if(showPro.hasHeadImage == 1) {
  126. imgbg = "/images/head/" + showPro.id + "_l.jpg";
  127. } else {
  128. imgbg = "../images/default-photo.jpg";
  129. }
  130. ifPoint = "pointThis";
  131. //认证
  132. var oSty = autho(showPro.authType,showPro.orgAuth,showPro.authStatus);
  133. authTy = oSty.sty;
  134. authTit = oSty.title;
  135. var title = showPro.title || "";
  136. var orgName = showPro.orgName || "";
  137. var office = showPro.office || "";
  138. if(orgName!=""){
  139. if(title != "") {
  140. baseInfo = title + "," + orgName;
  141. }else{
  142. if(office!=""){
  143. baseInfo = office + "," + orgName;
  144. }else{
  145. baseInfo = orgName;
  146. }
  147. }
  148. }else{
  149. if(title != "") {
  150. baseInfo = title;
  151. }else{
  152. if(office!=""){
  153. baseInfo = office;
  154. }else{
  155. baseInfo = "";
  156. }
  157. }
  158. }
  159. var str="";
  160. str +='<li class="flexCenter"><a href="" class="'+ ifPoint +'" data-id="'+ showPro.id +'">'
  161. str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
  162. str +='<div class="madiaInfo" style="margin-top:-8px" >'
  163. str +='<p class="ellipsisSty"><span class="h1Font">'+ showPro.name +'</span><em class="authiconNew '+ authTy +'" title="'+ authTit +'"></em></p>'
  164. str +='<p class="h2Font ellipsisSty">'+ baseInfo +'</p>'
  165. str +='</div></a>';
  166. if(showPro.id==userid){
  167. str +=''
  168. }else{
  169. str +='<div class="goSpan"><span class="attenSpan">关注</span></div>';
  170. }
  171. str +='</li>';
  172. var $str=$(str);
  173. $("#aboutAuthors .lastBtn").before($str);
  174. if(showPro.id!=userid){
  175. ifcollectionAbout(showPro.id,$str.find(".attenSpan"),1);
  176. }
  177. }
  178. }
  179. })
  180. }else{
  181. var str="";
  182. str +='<li class="flexCenter"><a data-id="'+ data.data[i].professorId +'">'
  183. str +='<div class="madiaHead useHead" style="background-image:url('+ imgbg +')"></div>'
  184. str +='<div class="madiaInfo">'
  185. str +='<p class="ellipsisSty"><span class="h1Font">'+ data.data[i].name +'</span></p>'
  186. str +='</div></a>';
  187. if(data.data[i].name==userName){
  188. str +='<div class="goSpan"><span class="ifMe" flag="1">是我本人</span></div>'
  189. }else{
  190. str +='<div class="goSpan"><span class="yaoqing">邀请'
  191. str +='<div class="shareCode clearfix"><div class="floatL qrcodeUser"></div>'
  192. str +='<div class="shareWord floatR"><p>打开微信“扫一扫”,<br/>打开网页后点击屏幕右上角“分享”按钮</p></div>'
  193. str +='</div></span></div>';
  194. }
  195. str +='</li>';
  196. var $str=$(str);
  197. $("#aboutAuthors .lastBtn").before($str);
  198. }
  199. if(data.data.length<5){
  200. $("#aboutAuthors li").css("display","block");
  201. $(".lastBtn").hide();
  202. }else{
  203. $("#aboutAuthors li:lt(3)").css("display","block");
  204. }
  205. }
  206. //邀请
  207. $('.goSpan').on("mouseenter",".yaoqing",function(){
  208. $(this).find('.shareCode').stop(true,false).fadeIn();
  209. }).on("mouseleave",".yaoqing",function(){
  210. $(this).find('.shareCode').stop(true,false).fadeOut();
  211. });
  212. //邀请作者
  213. var Qcu=document.getElementsByClassName("qrcodeUser");
  214. for(var i=0;i<Qcu.length;i++){
  215. var qrcode= new QRCode(Qcu[i], {
  216. width : 100,
  217. height : 100
  218. });
  219. makeCode();
  220. }
  221. function makeCode(){
  222. var hurl = window.location.host;
  223. if(userid) {
  224. var elurl = "http://" + hurl + "/e/I.html?i=" + s16to64(paperId)+"&d="+s16to64(userid)+"&f=1";
  225. } else{
  226. var elurl = "http://" + hurl + "/e/I.html?i=" + s16to64(paperId)+"&f=1";
  227. }
  228. qrcode.makeCode(elurl);
  229. }
  230. //是我本人
  231. $('.goSpan').on("click",".ifMe",function(){
  232. var oF=$(this).attr("flag");
  233. if(oF==1){
  234. $.MsgBox.Confirm("提示", "确认这是您发表的论文?", daoRuPaper);
  235. $(this).attr("flag","0");
  236. }else{
  237. return;
  238. }
  239. });
  240. }
  241. }
  242. },
  243. "data": {
  244. "id": stritrm
  245. },
  246. dataType: "json",
  247. 'error': function() {
  248. $.MsgBox.Alert('提示', '服务器连接超时!');
  249. }
  250. });
  251. }
  252. function daoRuPaper(){
  253. $.ajax({
  254. "url": "/ajax/ppaper/ass",
  255. "type": "POST",
  256. "data": {
  257. id:paperId,
  258. uid:userid,
  259. author: userName
  260. },
  261. dataType: "json",
  262. "success": function(data) {
  263. if(data.success) {
  264. if(data.data){
  265. $(".ifMe").text("导入成功").css("background","#ccc");
  266. }
  267. }
  268. },
  269. 'error': function() {
  270. $.MsgBox.Alert('提示', '服务器连接超时!');
  271. }
  272. });
  273. }
  274. /*处理论文html代码*/
  275. function paperHtml($da) {
  276. $("#paperName").text($da.name); //名字
  277. $("#pageView").text($da.pageViews); //浏览量
  278. $("#paperAbstract").text($da.summary); //摘要内容
  279. if(!$da.cn4periodical){
  280. $da.cn4periodical=""
  281. }
  282. if(!$da.en4periodical){
  283. $da.en4periodical=""
  284. }
  285. if(!$da.cn4periodical && !$da.en4periodical){
  286. $("#paperJournal").parents("li").hide();
  287. }else{
  288. $("#paperJournal").text($da.cn4periodical +" " + $da.en4periodical);
  289. }
  290. if(!$da.pubDay){
  291. $("#paperVolume").parents("li").hide();
  292. }else{
  293. $("#paperVolume").text($da.pubDay);
  294. }
  295. if($da.keywords != undefined && $da.keywords.length != 0 ){
  296. var subs = new Array();
  297. if($da.keywords.indexOf(',')){
  298. subs = $da.keywords.split(',');
  299. }else{
  300. subs[0] = $da.keywords;
  301. }
  302. if(subs.length>0){
  303. for (var i = 0; i < subs.length; i++)
  304. {
  305. $(".tagList").append('<li><p class="h2Font">'+ subs[i] +'</p></li>');
  306. };
  307. }else{
  308. $(".tagList").hide();
  309. }
  310. }
  311. var weibopic = "http://" + window.location.host + "/images/default-paper.jpg"
  312. var weibotitle = $da.name;
  313. var weibourl = window.location.href;
  314. $("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+encodeURIComponent(weibotitle)+"&url="+encodeURIComponent(weibourl)+"&pic="+encodeURIComponent(weibopic)+"&content=utf-8"+"&ralateUid=6242830109&searchPic=false&style=simple");
  315. }
  316. isAgreeNum()
  317. function isAgreeNum() {
  318. var data = {"id": paperId}
  319. $.ajax({
  320. url:"/ajax/ppaper/agreeCount",
  321. data:data,
  322. dataType: 'json', //数据格式类型
  323. type: 'get', //http请求类型
  324. timeout: 10000,
  325. async: true,
  326. success: function(data) {
  327. if(data.success){
  328. if(userid && userid != "null" && userid != null) {
  329. isAgree(data.data) //文章点赞
  330. } else {
  331. $(".thumbBtn").html("赞 <span>" + data.data + "</span>");
  332. }
  333. }
  334. },
  335. error: function() {
  336. $.MsgBox.Alert('提示',"服务器链接超时");
  337. }
  338. });
  339. }
  340. /*判断论文是否被赞*/
  341. function isAgree(articleAgree) {
  342. var data = {"id": paperId,"uid":userid }
  343. $.ajax({
  344. url:"/ajax/ppaper/agree",
  345. data:data,
  346. dataType: 'json', //数据格式类型
  347. type: 'get', //http请求类型
  348. timeout: 10000,
  349. async: true,
  350. success: function(data) {
  351. if(data.success){
  352. if(data.data){
  353. $(".thumbBtn").html("已赞 <span>"+articleAgree+"</span>");
  354. $(".thumbBtn").addClass("thumbedBtn").css("cursor","auto");
  355. }else{
  356. $(".thumbBtn").html("赞 <span>"+articleAgree+"</span>");
  357. $(".thumbBtn").addClass("thunbgo");
  358. }
  359. }
  360. },
  361. error: function() {
  362. $.MsgBox.Alert('提示',"服务器链接超时");
  363. }
  364. });
  365. }
  366. //论文点击点赞
  367. $('.thumbBlock').on("click",".thunbgo",function(){
  368. if (userid && userid != "null" && userid != null) {
  369. addAgree();
  370. }else{
  371. $.MsgBox.Alert('提示',"请先登录再进行点赞");
  372. $("#mb_btn_ok").val("去登录");
  373. var aele = document.createElement('a');
  374. $("#mb_btnbox").append(aele);
  375. $("#mb_btnbox a").css({
  376. 'display': "block",
  377. 'width': '100%',
  378. 'height': '40px',
  379. 'position': 'absolute',
  380. 'bottom': '-6px',
  381. 'left': '0'
  382. });
  383. aele.setAttribute('href', '../login.html');
  384. }
  385. })
  386. /*点赞*/
  387. function addAgree() {
  388. console.log(paperId)
  389. var data = {"uid": userid,"id": paperId}
  390. $.ajax({
  391. url:"/ajax/ppaper/agree",
  392. data:data,
  393. dataType: 'json', //数据格式类型
  394. type: 'POST', //http请求类型
  395. timeout: 10000,
  396. async: true,
  397. success: function(data) {
  398. if(data.success){
  399. var articleAgreeval = $(".thumbBtn span").text();
  400. $(".thumbBtn").html("已赞 <span>"+(parseInt(articleAgreeval)+1)+"</span>");
  401. $(".thumbBtn").addClass("thumbedBtn").css("cursor","auto");
  402. $(".thumbBtn").removeClass("thunbgo");
  403. }
  404. },
  405. error: function() {
  406. $.MsgBox.Alert('提示',"服务器链接超时");
  407. }
  408. });
  409. }
  410. /*留言模块*/
  411. $(".msgCont").bind({
  412. input: function() {
  413. $(".msgconNum span").text($(this).val().length);
  414. if($(this).val().length <= 0) {
  415. $("#meSendtt").css("background", "#ccc");
  416. } else {
  417. $("#meSendtt").css("background", "#ff9900");
  418. }
  419. }
  420. });
  421. $("#meSendtt").on("click", function() {
  422. article();
  423. })
  424. //查看更多留言
  425. $("#moreArtical").on("click",function(){
  426. vcreateTime = $(".commentList li").last().attr("data-time");
  427. orderKey = $(".commentList li").last().attr("data-key");
  428. message(5,1);
  429. })
  430. //删除留言
  431. $(".commentList").on("click",".messageDel",function(){
  432. var commenid = $(this).attr("data-id");
  433. articledel(commenid)
  434. })
  435. //发布留言
  436. function article() {
  437. $.ajax({
  438. url:"/ajax/leaveWord/paper",
  439. dataType: 'json', //数据格式类型
  440. type: 'POST', //http请求类型
  441. data: {
  442. "paperId": paperId,
  443. "sender": userid,
  444. "content": $(".msgCont").val(),
  445. },
  446. timeout: 10000, //超时设置
  447. success: function(data) {
  448. var $info = data.data || {};
  449. if(data.success && data.data) {
  450. message(5,2);
  451. }
  452. $(".msgCont").val("");
  453. },
  454. error: function() {
  455. $.MsgBox.Alert('提示', '服务器请求失败')
  456. }
  457. });
  458. }
  459. message(5,2);
  460. function message(rows,num) {
  461. if(num==1){
  462. var data = {"paperId": paperId,"createTime": vcreateTime,"orderKey": orderKey,"rows": rows}
  463. }else{
  464. var data = {"paperId": paperId,"rows": rows}
  465. }
  466. $.ajax({
  467. url: "/ajax/leaveWord/ql/paper",
  468. dataType: 'json', //数据格式类型
  469. type: 'GET', //http请求类型
  470. data: data,
  471. timeout: 10000, //超时设置
  472. success: function(data) {
  473. if(data.success) {
  474. if(data.data != ""){
  475. if(num==2){
  476. $(".commentList").html("");
  477. }
  478. if(data.data.length > 4){
  479. $("#moreArtical").removeClass("displayNone");
  480. }else{
  481. $("#moreArtical").addClass("displayNone");
  482. }
  483. for(var i = 0; i < data.data.length; i++) {
  484. var itemlist = '<li class="flexCenter" data-time="" data-key="">';
  485. itemlist += '<a href class="userhref"> <div class="madiaHead useHead useHeadMsg"></div></a>';
  486. itemlist += '<div class="madiaInfo">';
  487. itemlist += '<p><a href class="userhref"><span class="h1Font messageName">张某某</span></a><em class="authiconNew" title="科袖认证专家"></em><span class="commenttime">9月30号 12:00</span></p>';
  488. itemlist += '<p class="h2Font messageContent">sdfsdfs</p>';
  489. itemlist += '<div class="operateSpan"><span class="callBack">回复</span><span class="messageDel">删除</span></div>';
  490. itemlist += '</div></li>';
  491. $itemlist = $(itemlist);
  492. $(".commentList").append($itemlist);
  493. var datalist = data.data[i];
  494. $itemlist.find(".messageName").text(datalist.professor.name);
  495. $itemlist.find(".messageContent").text(datalist.content);
  496. var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
  497. $itemlist.find(".authiconNew").attr("title", userType.title);
  498. $itemlist.find(".authiconNew").addClass(userType.sty);
  499. if(datalist.professor.hasHeadImage==1) {
  500. $itemlist.find(".useHeadMsg").attr("style", "background-image: url(/images/head/" + datalist.professor.id + "_l.jpg);");
  501. }
  502. if(datalist.professor.id!=userid){
  503. $(".messageDel").hide();
  504. }
  505. $itemlist.attr("data-time", datalist.createTime);
  506. $itemlist.attr("data-key", datalist.orderKey);
  507. $itemlist.find(".messageDel").attr("data-id", datalist.id);
  508. $itemlist.find(".userhref").attr("href", "userInforShow.html?professorId="+datalist.professor.id);
  509. var createtime = datalist.createTime;
  510. $itemlist.find(".commenttime").text(commenTime(createtime));
  511. }
  512. }else{
  513. if(num==2){
  514. $(".commentList").html("");
  515. }else{
  516. $("#moreArtical").addClass("displayNone");
  517. }
  518. }
  519. }
  520. },
  521. error: function() {
  522. $.MsgBox.Alert('提示', '服务器请求失败')
  523. }
  524. });
  525. }
  526. //删除自己的留言
  527. function articledel(commenid) {
  528. $.ajax({
  529. url:"/ajax/leaveWord/delete",
  530. dataType: 'json', //数据格式类型
  531. type: 'POST', //http请求类型
  532. data: {
  533. "id": commenid,
  534. },
  535. timeout: 10000, //超时设置
  536. success: function(data) {
  537. if(data.success) {
  538. message(5,2);
  539. }
  540. },
  541. error: function() {
  542. $.MsgBox.Alert('提示', '服务器请求失败')
  543. }
  544. });
  545. }
  546. //相关文章信息
  547. function relevantarticalList(id,num){
  548. var data = {"keys":experarray,"professorId":id,"paperId":paperId,"rows":10} ;
  549. $.ajax({
  550. "url" : "/ajax/paper/ralateArticles",
  551. "type" : "GET" ,
  552. "dataType" : "json",
  553. "data" :data,
  554. //"async":false,
  555. "traditional": true, //传数组必须加这个
  556. "success" : function(data) {
  557. console.log(data);
  558. if (data.success && data.data!=""){
  559. $("#abutartical").parent().parent().removeClass("displayNone");
  560. var itemlist = '';
  561. $("#abutartical").html("");
  562. var dataStr=data.data;
  563. if(dataStr.length > 0){
  564. $("#patentList,.patentPageCode").show();
  565. $(".patentPage").hide();
  566. var itemlist = '';
  567. $("#patentList").html("");
  568. for(var i = 0; i < dataStr.length; i++) {
  569. var itemlist = '<li class="flexCenter">';
  570. itemlist += '<a target="_blank" href="patentShow.html?patentId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead patenthead"></div>';
  571. itemlist += '<div class="centercon centercon2">';
  572. itemlist += '<p class="h1font ellipsisSty">'+ dataStr[i].name +'</p>';
  573. itemlist += '<p class="h1font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  574. itemlist += '<p class="h2font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  575. itemlist += '</div></a></li>';
  576. $itemlist = $(itemlist);
  577. $("#patentList").append($itemlist);
  578. }
  579. }
  580. }
  581. },
  582. "error":function(){
  583. $.MsgBox.Alert('提示','链接服务器超时')
  584. }
  585. });
  586. }
  587. //您可能感兴趣的论文
  588. paperInterestingList()
  589. function paperInterestingList(){
  590. $.ajax({
  591. "url" : "/ajax/ppaper/ralatePapers",
  592. "type" : "GET" ,
  593. "dataType" : "json",
  594. "data" :{
  595. "paperId":paperId
  596. },
  597. //"async":false,
  598. "traditional": true, //传数组必须加这个
  599. "success" : function(data) {
  600. if(data.success) {
  601. var dataStr=data.data
  602. if(dataStr.length > 0){
  603. $("#interPaper").show();
  604. var itemlist = '';
  605. $("#paperList").html("");
  606. for(var i = 0; i < dataStr.length; i++) {
  607. var moreInf=""
  608. if(!dataStr[i].cn4periodical){
  609. dataStr[i].cn4periodical="";
  610. }
  611. if(!dataStr[i].en4periodical){
  612. dataStr[i].en4periodical="";
  613. }
  614. if(!dataStr[i].pubDay){
  615. dataStr[i].pubDay="";
  616. }
  617. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay;
  618. var itemlist = '<li class="flexCenter">';
  619. itemlist += '<a target="_blank" href="paperShow.html?paperId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead paperhead"></div>';
  620. itemlist += '<div class="centercon centercon2">';
  621. itemlist += '<p class="h1font ellipsisSty">'+ dataStr[i].name +'</p>';
  622. itemlist += '<p class="h1font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  623. itemlist += '<p class="h2font ellipsisSty">期刊:'+ moreInf +'</p>';
  624. itemlist += '</div></a></li>';
  625. $itemlist = $(itemlist);
  626. $("#paperList").append($itemlist);
  627. } }
  628. }
  629. },
  630. "error":function(){
  631. $.MsgBox.Alert('提示','链接服务器超时')
  632. }
  633. });
  634. }
  635. //浏览量
  636. function pageViewsVal() {
  637. $.ajax({
  638. "url": "/ajax/ppaper/incPageViews",
  639. "type": "POST",
  640. "dataType": "json",
  641. "data": {
  642. "id": paperId
  643. },
  644. "success": function(data) {
  645. console.log(data);
  646. if(data.success) {}
  647. },
  648. "error": function() {
  649. $.MsgBox.Alert('提示', '链接服务器超时')
  650. }
  651. });
  652. }
  653. //纠错反馈
  654. $(".correctSubmit").on("click",function(){
  655. var cntCon=$(this).siblings(".correctCon").val();
  656. var cntUser="";
  657. if(userid && userid != null && userid != "null") {
  658. cntUser = userid;
  659. }
  660. if(cntCon.length>500){
  661. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  662. return;
  663. }else{
  664. $.ajax({
  665. "url": "/ajax/feedback/error/paper",
  666. "type": "POST",
  667. "dataType": "json",
  668. "async": true,
  669. "data": {
  670. "id": paperId,
  671. "cnt":cntCon,
  672. "user":cntUser
  673. },
  674. "success": function(data) {
  675. if(data.success) {
  676. backSuccessed();
  677. }
  678. },
  679. "error": function() {
  680. $.MsgBox.Alert('提示', '链接服务器超时')
  681. }
  682. });
  683. }
  684. })
  685. })