portal html css js resource

patentShow.js 21KB

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