portal html css js resource

paperShow.js 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  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. patentRelatedList(subs)
  304. for (var i = 0; i < subs.length; i++)
  305. {
  306. $(".tagList").append('<li><p class="h2Font">'+ subs[i] +'</p></li>');
  307. };
  308. }else{
  309. $(".tagList").hide();
  310. }
  311. }
  312. var weibopic = "http://" + window.location.host + "/images/default-paper.jpg"
  313. var weibotitle = $da.name;
  314. var weibourl = window.location.href;
  315. $("#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");
  316. }
  317. isAgreeNum()
  318. function isAgreeNum() {
  319. var data = {"id": paperId}
  320. $.ajax({
  321. url:"/ajax/ppaper/agreeCount",
  322. data:data,
  323. dataType: 'json', //数据格式类型
  324. type: 'get', //http请求类型
  325. timeout: 10000,
  326. async: true,
  327. success: function(data) {
  328. if(data.success){
  329. if(userid && userid != "null" && userid != null) {
  330. isAgree(data.data) //文章点赞
  331. } else {
  332. $(".thumbBtn").html("赞 <span>" + data.data + "</span>");
  333. }
  334. }
  335. },
  336. error: function() {
  337. $.MsgBox.Alert('提示',"服务器链接超时");
  338. }
  339. });
  340. }
  341. /*判断论文是否被赞*/
  342. function isAgree(articleAgree) {
  343. var data = {"id": paperId,"uid":userid }
  344. $.ajax({
  345. url:"/ajax/ppaper/agree",
  346. data:data,
  347. dataType: 'json', //数据格式类型
  348. type: 'get', //http请求类型
  349. timeout: 10000,
  350. async: true,
  351. success: function(data) {
  352. if(data.success){
  353. if(data.data){
  354. $(".thumbBtn").html("已赞 <span>"+articleAgree+"</span>");
  355. $(".thumbBtn").addClass("thumbedBtn").css("cursor","auto");
  356. }else{
  357. $(".thumbBtn").html("赞 <span>"+articleAgree+"</span>");
  358. $(".thumbBtn").addClass("thunbgo");
  359. }
  360. }
  361. },
  362. error: function() {
  363. $.MsgBox.Alert('提示',"服务器链接超时");
  364. }
  365. });
  366. }
  367. //论文点击点赞
  368. $('.thumbBlock').on("click",".thunbgo",function(){
  369. if (userid && userid != "null" && userid != null) {
  370. addAgree();
  371. }else{
  372. $.MsgBox.Alert('提示',"请先登录再进行点赞");
  373. $("#mb_btn_ok").val("去登录");
  374. var aele = document.createElement('a');
  375. $("#mb_btnbox").append(aele);
  376. $("#mb_btnbox a").css({
  377. 'display': "block",
  378. 'width': '100%',
  379. 'height': '40px',
  380. 'position': 'absolute',
  381. 'bottom': '-6px',
  382. 'left': '0'
  383. });
  384. aele.setAttribute('href', '../login.html');
  385. }
  386. })
  387. /*点赞*/
  388. function addAgree() {
  389. console.log(paperId)
  390. var data = {"uid": userid,"id": paperId}
  391. $.ajax({
  392. url:"/ajax/ppaper/agree",
  393. data:data,
  394. dataType: 'json', //数据格式类型
  395. type: 'POST', //http请求类型
  396. timeout: 10000,
  397. async: true,
  398. success: function(data) {
  399. if(data.success){
  400. var articleAgreeval = $(".thumbBtn span").text();
  401. $(".thumbBtn").html("已赞 <span>"+(parseInt(articleAgreeval)+1)+"</span>");
  402. $(".thumbBtn").addClass("thumbedBtn").css("cursor","auto");
  403. $(".thumbBtn").removeClass("thunbgo");
  404. }
  405. },
  406. error: function() {
  407. $.MsgBox.Alert('提示',"服务器链接超时");
  408. }
  409. });
  410. }
  411. /*留言模块*/
  412. $(".msgCont").bind({
  413. input: function() {
  414. $(".msgconNum span").text($(this).val().length);
  415. if($(this).val().length <= 0) {
  416. $("#meSendtt").css("background", "#ccc");
  417. } else {
  418. $("#meSendtt").css("background", "#ff9900");
  419. }
  420. }
  421. });
  422. $("#meSendtt").on("click", function() {
  423. article();
  424. })
  425. //查看更多留言
  426. $("#moreArtical").on("click",function(){
  427. vcreateTime = $(".commentList li").last().attr("data-time");
  428. orderKey = $(".commentList li").last().attr("data-key");
  429. message(5,1);
  430. })
  431. //删除留言
  432. $(".commentList").on("click",".messageDel",function(){
  433. var commenid = $(this).attr("data-id");
  434. articledel(commenid)
  435. })
  436. //发布留言
  437. function article() {
  438. $.ajax({
  439. url:"/ajax/leaveWord/paper",
  440. dataType: 'json', //数据格式类型
  441. type: 'POST', //http请求类型
  442. data: {
  443. "paperId": paperId,
  444. "sender": userid,
  445. "content": $(".msgCont").val(),
  446. },
  447. timeout: 10000, //超时设置
  448. success: function(data) {
  449. var $info = data.data || {};
  450. if(data.success && data.data) {
  451. message(5,2);
  452. }
  453. $(".msgCont").val("");
  454. },
  455. error: function() {
  456. $.MsgBox.Alert('提示', '服务器请求失败')
  457. }
  458. });
  459. }
  460. message(5,2);
  461. function message(rows,num) {
  462. if(num==1){
  463. var data = {"paperId": paperId,"createTime": vcreateTime,"orderKey": orderKey,"rows": rows}
  464. }else{
  465. var data = {"paperId": paperId,"rows": rows}
  466. }
  467. $.ajax({
  468. url: "/ajax/leaveWord/ql/paper",
  469. dataType: 'json', //数据格式类型
  470. type: 'GET', //http请求类型
  471. data: data,
  472. timeout: 10000, //超时设置
  473. success: function(data) {
  474. if(data.success) {
  475. if(data.data != ""){
  476. if(num==2){
  477. $(".commentList").html("");
  478. }
  479. if(data.data.length > 4){
  480. $("#moreArtical").removeClass("displayNone");
  481. }else{
  482. $("#moreArtical").addClass("displayNone");
  483. }
  484. for(var i = 0; i < data.data.length; i++) {
  485. var itemlist = '<li class="flexCenter" data-time="" data-key="">';
  486. itemlist += '<a href class="userhref"> <div class="madiaHead useHead useHeadMsg"></div></a>';
  487. itemlist += '<div class="madiaInfo">';
  488. 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>';
  489. itemlist += '<p class="h2Font messageContent">sdfsdfs</p>';
  490. itemlist += '<div class="operateSpan"><span class="callBack">回复</span><span class="messageDel">删除</span></div>';
  491. itemlist += '</div></li>';
  492. $itemlist = $(itemlist);
  493. $(".commentList").append($itemlist);
  494. var datalist = data.data[i];
  495. $itemlist.find(".messageName").text(datalist.professor.name);
  496. $itemlist.find(".messageContent").text(datalist.content);
  497. var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
  498. $itemlist.find(".authiconNew").attr("title", userType.title);
  499. $itemlist.find(".authiconNew").addClass(userType.sty);
  500. if(datalist.professor.hasHeadImage==1) {
  501. $itemlist.find(".useHeadMsg").attr("style", "background-image: url(/images/head/" + datalist.professor.id + "_l.jpg);");
  502. }
  503. if(datalist.professor.id!=userid){
  504. $(".messageDel").hide();
  505. }
  506. $itemlist.attr("data-time", datalist.createTime);
  507. $itemlist.attr("data-key", datalist.orderKey);
  508. $itemlist.find(".messageDel").attr("data-id", datalist.id);
  509. $itemlist.find(".userhref").attr("href", "userInforShow.html?professorId="+datalist.professor.id);
  510. var createtime = datalist.createTime;
  511. $itemlist.find(".commenttime").text(commenTime(createtime));
  512. }
  513. }else{
  514. if(num==2){
  515. $(".commentList").html("");
  516. }else{
  517. $("#moreArtical").addClass("displayNone");
  518. }
  519. }
  520. }
  521. },
  522. error: function() {
  523. $.MsgBox.Alert('提示', '服务器请求失败')
  524. }
  525. });
  526. }
  527. //删除自己的留言
  528. function articledel(commenid) {
  529. $.ajax({
  530. url:"/ajax/leaveWord/delete",
  531. dataType: 'json', //数据格式类型
  532. type: 'POST', //http请求类型
  533. data: {
  534. "id": commenid,
  535. },
  536. timeout: 10000, //超时设置
  537. success: function(data) {
  538. if(data.success) {
  539. message(5,2);
  540. }
  541. },
  542. error: function() {
  543. $.MsgBox.Alert('提示', '服务器请求失败')
  544. }
  545. });
  546. }
  547. //相关文章信息
  548. function relevantarticalList(id,num){
  549. var data = {"keys":experarray,"professorId":id,"paperId":paperId,"rows":10} ;
  550. $.ajax({
  551. "url" : "/ajax/paper/ralateArticles",
  552. "type" : "GET" ,
  553. "dataType" : "json",
  554. "data" :data,
  555. //"async":false,
  556. "traditional": true, //传数组必须加这个
  557. "success" : function(data) {
  558. console.log(data);
  559. if (data.success && data.data!=""){
  560. $("#abutartical").parent().parent().removeClass("displayNone");
  561. var itemlist = '';
  562. $("#abutartical").html("");
  563. var dataStr=data.data;
  564. if(dataStr.length > 0){
  565. $("#patentList,.patentPageCode").show();
  566. $(".patentPage").hide();
  567. var itemlist = '';
  568. $("#patentList").html("");
  569. for(var i = 0; i < dataStr.length; i++) {
  570. var itemlist = '<li class="flexCenter">';
  571. itemlist += '<a target="_blank" href="patentShow.html?patentId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead patenthead"></div>';
  572. itemlist += '<div class="centercon centercon2">';
  573. itemlist += '<p class="h1font ellipsisSty">'+ dataStr[i].name +'</p>';
  574. itemlist += '<p class="h1font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  575. itemlist += '<p class="h2font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  576. itemlist += '</div></a></li>';
  577. $itemlist = $(itemlist);
  578. $("#patentList").append($itemlist);
  579. }
  580. }
  581. }
  582. },
  583. "error":function(){
  584. $.MsgBox.Alert('提示','链接服务器超时')
  585. }
  586. });
  587. }
  588. //您可能感兴趣的论文
  589. paperInterestingList()
  590. function paperInterestingList(){
  591. $.ajax({
  592. "url" : "/ajax/ppaper/ralatePapers",
  593. "type" : "GET" ,
  594. "dataType" : "json",
  595. "data" :{
  596. "paperId":paperId
  597. },
  598. //"async":false,
  599. "traditional": true, //传数组必须加这个
  600. "success" : function(data) {
  601. if(data.success) {
  602. var dataStr=data.data
  603. if(dataStr.length > 0){
  604. $("#interPaper").show();
  605. var itemlist = '';
  606. $("#paperList").html("");
  607. for(var i = 0; i < dataStr.length; i++) {
  608. var moreInf=""
  609. if(!dataStr[i].cn4periodical){
  610. dataStr[i].cn4periodical="";
  611. }
  612. if(!dataStr[i].en4periodical){
  613. dataStr[i].en4periodical="";
  614. }
  615. if(!dataStr[i].pubDay){
  616. dataStr[i].pubDay="";
  617. }
  618. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay;
  619. var itemlist = '<li class="flexCenter">';
  620. itemlist += '<a target="_blank" href="paperShow.html?paperId=' + dataStr[i].id +'" class="linkhref"><div class="lefthead paperhead"></div>';
  621. itemlist += '<div class="centercon centercon2">';
  622. itemlist += '<p class="h1font ellipsisSty">'+ dataStr[i].name +'</p>';
  623. itemlist += '<p class="h1font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  624. itemlist += '<p class="h2font ellipsisSty">期刊:'+ moreInf +'</p>';
  625. itemlist += '</div></a></li>';
  626. $itemlist = $(itemlist);
  627. $("#paperList").append($itemlist);
  628. } }
  629. }
  630. },
  631. "error":function(){
  632. $.MsgBox.Alert('提示','链接服务器超时')
  633. }
  634. });
  635. }
  636. //浏览量
  637. function pageViewsVal() {
  638. $.ajax({
  639. "url": "/ajax/ppaper/incPageViews",
  640. "type": "POST",
  641. "dataType": "json",
  642. "data": {
  643. "id": paperId
  644. },
  645. "success": function(data) {
  646. console.log(data);
  647. if(data.success) {}
  648. },
  649. "error": function() {
  650. $.MsgBox.Alert('提示', '链接服务器超时')
  651. }
  652. });
  653. }
  654. //纠错反馈
  655. $(".correctSubmit").on("click",function(){
  656. var cntCon=$(this).siblings(".correctCon").val();
  657. var cntUser="";
  658. if(userid && userid != null && userid != "null") {
  659. cntUser = userid;
  660. }
  661. if(cntCon.length>500){
  662. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  663. return;
  664. }else{
  665. $.ajax({
  666. "url": "/ajax/feedback/error/paper",
  667. "type": "POST",
  668. "dataType": "json",
  669. "async": true,
  670. "data": {
  671. "id": paperId,
  672. "cnt":cntCon,
  673. "user":cntUser
  674. },
  675. "success": function(data) {
  676. if(data.success) {
  677. backSuccessed();
  678. }
  679. },
  680. "error": function() {
  681. $.MsgBox.Alert('提示', '链接服务器超时')
  682. }
  683. });
  684. }
  685. })
  686. function patentRelatedList(array){
  687. $.ajax({
  688. "url":"/ajax/ppatent/assPatents",
  689. "type" : "GET" ,
  690. "dataType" : "json",
  691. "data" :{
  692. "kws":array
  693. },
  694. "traditional": true, //传数组必须加这个
  695. "success" : function(data) {
  696. if(data.success) {
  697. var dataStr=data.data
  698. if(dataStr.length > 0){
  699. $("#paperList").show();
  700. for(var i = 0; i < dataStr.length; i++) {
  701. var itemlist ='<li style="min-height:56px;"><a href="patentShow.html?patentId='+dataStr[i].id+'"><p class="h2Font ellipsisSty-2" style="line-height:20px;">'+ dataStr[i].name +'</p></a></li>'
  702. $(".recentlyList").append(itemlist);
  703. }
  704. }
  705. }
  706. },
  707. "error":function(){
  708. plus.nativeUI.toast("服务器链接超时", toastStyle);
  709. }
  710. });
  711. }
  712. })