portal html css js resource

patentShow.js 21KB

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