portal html css js resource

patentShow.js 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  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"),$(".attenSpan").eq(0),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. $.MsgBox.Alert('提示', "请先登录再进行收藏");
  274. $("#mb_btn_ok").val("去登录");
  275. var aele = document.createElement('a');
  276. $("#mb_btnbox").append(aele);
  277. $("#mb_btnbox a").css({
  278. 'display': "block",
  279. 'width': '100%',
  280. 'height': '40px',
  281. 'position': 'absolute',
  282. 'bottom': '-6px',
  283. 'left': '0'
  284. });
  285. aele.setAttribute('href', '../login.html');
  286. }
  287. })
  288. $("body").on("click", ".closeThis", function() {
  289. if($(this).parent().length < 5) {
  290. $(this).parents(".keyResult").siblings("div").show();
  291. }
  292. $(this).parent().remove();
  293. });
  294. $("#release").on("click", function() {
  295. $.MsgBox.Confirm("提示", "确认发布该专利?", $obj.pubPatent);
  296. });
  297. $("#delete").on("click", function() {
  298. $.MsgBox.Confirm("提示", "确认删除该专利?", $obj.delePatent);
  299. });
  300. $(".lastBtn").on("click", function() {
  301. $("#faM li").css("display","block");
  302. $(this).hide();
  303. });
  304. $(".tagList").on("click","li",function() {
  305. location.href = "searchNew.html?searchContent=" + $(this).text() + "&tagflag=5";
  306. });
  307. //点击关注按钮
  308. $("#faM").on('click',"span.attenSpan", function() {
  309. var pId=$(this).parent().siblings("a").attr("data-id");
  310. if(userid && userid != null && userid != "null") {
  311. if($(this).is('.attenedSpan')){
  312. cancelCollectionAbout(pId, $(this),1)
  313. } else {
  314. collectionAbout(pId, $(this),1);
  315. }
  316. }else{
  317. $.MsgBox.Alert("提示", "请先登录再进行关注");
  318. $("#mb_btn_ok").val("去登录");
  319. var aele = document.createElement('a');
  320. $("#mb_btnbox").append(aele);
  321. $("#mb_btnbox a").css({
  322. 'display': "block",
  323. 'width': '100%',
  324. 'height': '40px',
  325. 'position': 'absolute',
  326. 'bottom': '-6px',
  327. 'left': '0'
  328. });
  329. aele.setAttribute('href', '../login.html');
  330. }
  331. });
  332. }
  333. Patent.prototype.pageview = function() {};
  334. Patent.prototype.captiureSubInd = function(subIndu) {
  335. var industrys = $("#" + subIndu + "").find("li");
  336. var industryAll = "";
  337. if(industrys.size() > 0) {
  338. for(var i = 0; i < industrys.size(); i++) {
  339. industryAll += industrys[i].innerText;
  340. industryAll += ',';
  341. };
  342. industryAll = industryAll.substring(0, industryAll.length - 1);
  343. }
  344. return industryAll;
  345. }
  346. Patent.prototype.pubPatent = function() {
  347. var $key = oPent.captiureSubInd("paperSList");
  348. oPent.ajax({
  349. url: "/ajax/ppatent/kw",
  350. data: {
  351. id: GetQueryString("patentId"),
  352. keywords: $key
  353. },
  354. type: "post",
  355. Fun: oPent.pubsucess
  356. });
  357. }
  358. Patent.prototype.pubsucess = function() {
  359. $.MsgBox.Alert('提示', '专利发布成功!');
  360. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  361. location.href = "patentList.html"
  362. }
  363. Patent.prototype.delePatent = function() {
  364. oPent.ajax({
  365. url: "/ajax/ppatent/cAss",
  366. data: {
  367. id: GetQueryString("patentId"),
  368. uid:$.cookie("userid")
  369. },
  370. type: "post",
  371. Fun: oPent.delsucess
  372. });
  373. }
  374. Patent.prototype.delsucess = function() {
  375. location.href = "patentList.html"
  376. }
  377. var oPent = new Patent();
  378. //纠错反馈
  379. $(".footer_tools").hide();
  380. $(".correctSubmit").on("click",function(){
  381. var cntCon=$(this).siblings(".correctCon").val();
  382. var cntUser="";
  383. if(userid && userid != null && userid != "null") {
  384. cntUser = userid;
  385. }
  386. if(cntCon.length>500){
  387. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  388. return;
  389. }else{
  390. $.ajax({
  391. "url": "/ajax/feedback/error/patent",
  392. "type": "POST",
  393. "dataType": "json",
  394. "async": true,
  395. "data": {
  396. "id":GetQueryString("patentId"),
  397. "cnt":cntCon,
  398. "user":cntUser
  399. },
  400. "success": function(data) {
  401. if(data.success) {
  402. console.log(data);
  403. backSuccessed();
  404. }
  405. },
  406. "error": function() {
  407. $.MsgBox.Alert('提示', '链接服务器超时')
  408. }
  409. });
  410. }
  411. })
  412. if( GetQueryString("flag")==1){
  413. $(".feedBack").click(function(){
  414. $("#feedbackBox").fadeToggle();
  415. })
  416. $(".closeFeed").click(function(){
  417. $("#feedbackBox").fadeOut();
  418. })
  419. }else{
  420. var patentId=GetQueryString("patentId");
  421. $(".footer_tools").show();
  422. $("#messagego").show();
  423. $(".thumbBlock").show();
  424. isAgreeNum()
  425. function isAgreeNum() {
  426. var data = {"id": patentId}
  427. $.ajax({
  428. url:"/ajax/ppatent/agreeCount",
  429. data:data,
  430. dataType: 'json', //数据格式类型
  431. type: 'get', //http请求类型
  432. timeout: 10000,
  433. async: true,
  434. success: function(data) {
  435. if(data.success){
  436. if(userid && userid != "null" && userid != null) {
  437. isAgree(data.data) //文章点赞
  438. } else {
  439. $(".thumbBtn").html("赞 <span>" + data.data + "</span>");
  440. }
  441. }
  442. },
  443. error: function() {
  444. $.MsgBox.Alert('提示',"服务器链接超时");
  445. }
  446. });
  447. }
  448. /*判断论文是否被赞*/
  449. function isAgree(articleAgree) {
  450. var data = {"id": patentId,"uid":userid }
  451. $.ajax({
  452. url:"/ajax/ppatent/agree",
  453. data:data,
  454. dataType: 'json', //数据格式类型
  455. type: 'get', //http请求类型
  456. timeout: 10000,
  457. async: true,
  458. success: function(data) {
  459. if(data.success){
  460. if(data.data){
  461. $(".thumbBtn").html("已赞 <span>"+articleAgree+"</span>");
  462. $(".thumbBtn").addClass("thumbedBtn").css("cursor","auto");
  463. }else{
  464. $(".thumbBtn").html("赞 <span>"+articleAgree+"</span>");
  465. $(".thumbBtn").addClass("thunbgo");
  466. }
  467. }
  468. },
  469. error: function() {
  470. $.MsgBox.Alert('提示',"服务器链接超时");
  471. }
  472. });
  473. }
  474. //论文点击点赞
  475. $('.thumbBlock').on("click",".thunbgo",function(){
  476. if (userid && userid != "null" && userid != null) {
  477. addAgree();
  478. }else{
  479. $.MsgBox.Alert('提示',"请先登录再进行点赞");
  480. $("#mb_btn_ok").val("去登录");
  481. var aele = document.createElement('a');
  482. $("#mb_btnbox").append(aele);
  483. $("#mb_btnbox a").css({
  484. 'display': "block",
  485. 'width': '100%',
  486. 'height': '40px',
  487. 'position': 'absolute',
  488. 'bottom': '-6px',
  489. 'left': '0'
  490. });
  491. aele.setAttribute('href', '../login.html');
  492. }
  493. })
  494. /*点赞*/
  495. function addAgree() {
  496. var data = {"uid": userid,"id": patentId}
  497. $.ajax({
  498. url:"/ajax/ppatent/agree",
  499. data:data,
  500. dataType: 'json', //数据格式类型
  501. type: 'POST', //http请求类型
  502. timeout: 10000,
  503. async: true,
  504. success: function(data) {
  505. if(data.success){
  506. var articleAgreeval = $(".thumbBtn span").text();
  507. $(".thumbBtn").html("已赞 <span>"+(parseInt(articleAgreeval)+1)+"</span>");
  508. $(".thumbBtn").addClass("thumbedBtn").css("cursor","auto");
  509. $(".thumbBtn").removeClass("thunbgo");
  510. }
  511. },
  512. error: function() {
  513. $.MsgBox.Alert('提示',"服务器链接超时");
  514. }
  515. });
  516. }
  517. if(userid && userid != "null" && userid != null){
  518. $(".ifLoginOn").removeClass("displayNone");
  519. }else{
  520. $(".ifLoginUn").removeClass("displayNone");
  521. }
  522. /*留言模块*/
  523. limitObj(".msgCont",200)
  524. $("#meSendtt").on("click", function() {
  525. article();
  526. })
  527. //查看更多留言
  528. $("#moreArtical").on("click",function(){
  529. vcreateTime = $(".commentList li").last().attr("data-time");
  530. orderKey = $(".commentList li").last().attr("data-key");
  531. message(5,1);
  532. })
  533. //删除留言
  534. $(".commentList").on("click",".messageDel",function(){
  535. var commenid = $(this).attr("data-id");
  536. articledel(commenid)
  537. })
  538. //发布留言
  539. function article() {
  540. $.ajax({
  541. url:"/ajax/leaveWord/patent",
  542. dataType: 'json', //数据格式类型
  543. type: 'POST', //http请求类型
  544. data: {
  545. "patentId": patentId,
  546. "sender": userid,
  547. "content": $(".msgCont").val(),
  548. },
  549. timeout: 10000, //超时设置
  550. success: function(data) {
  551. var $info = data.data || {};
  552. if(data.success && data.data) {
  553. message(5,2);
  554. }
  555. $(".msgCont").val("");
  556. $(".msgconNum").find("span").text(0);
  557. },
  558. error: function() {
  559. $.MsgBox.Alert('提示', '服务器请求失败')
  560. }
  561. });
  562. }
  563. message(5,2);
  564. function message(rows,num) {
  565. if(num==1){
  566. var data = {"patentId": patentId,"createTime": vcreateTime,"orderKey": orderKey,"rows": rows}
  567. }else{
  568. var data = {"patentId": patentId,"rows": rows}
  569. }
  570. $.ajax({
  571. url: "/ajax/leaveWord/ql/patent",
  572. dataType: 'json', //数据格式类型
  573. type: 'GET', //http请求类型
  574. data: data,
  575. timeout: 10000, //超时设置
  576. success: function(data) {
  577. if(data.success) {
  578. if(data.data != ""){
  579. if(num==2){
  580. $(".commentList").html("");
  581. }
  582. if(data.data.length > 4){
  583. $("#moreArtical").removeClass("displayNone");
  584. }else{
  585. $("#moreArtical").addClass("displayNone");
  586. }
  587. for(var i = 0; i < data.data.length; i++) {
  588. var itemlist = '<li class="flexCenter" data-time="" data-key="">';
  589. itemlist += '<a href class="userhref"> <div class="madiaHead useHead useHeadMsg"></div></a>';
  590. itemlist += '<div class="madiaInfo">';
  591. 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>';
  592. itemlist += '<p class="h2Font messageContent">sdfsdfs</p>';
  593. itemlist += '<div class="operateSpan"><span class="callBack">回复</span><span class="messageDel">删除</span></div>';
  594. itemlist += '</div></li>';
  595. $itemlist = $(itemlist);
  596. $(".commentList").append($itemlist);
  597. var datalist = data.data[i];
  598. $itemlist.find(".messageName").text(datalist.professor.name);
  599. $itemlist.find(".messageContent").text(datalist.content);
  600. var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
  601. $itemlist.find(".authiconNew").attr("title", userType.title);
  602. $itemlist.find(".authiconNew").addClass(userType.sty);
  603. if(datalist.professor.hasHeadImage==1) {
  604. $itemlist.find(".useHeadMsg").attr("style", "background-image: url(/images/head/" + datalist.professor.id + "_l.jpg);");
  605. }
  606. if(datalist.professor.id==userid){
  607. $itemlist.find(".messageDel").show();
  608. }
  609. $itemlist.attr("data-time", datalist.createTime);
  610. $itemlist.attr("data-key", datalist.orderKey);
  611. $itemlist.find(".messageDel").attr("data-id", datalist.id);
  612. $itemlist.find(".userhref").attr("href", "userInforShow.html?professorId="+datalist.professor.id);
  613. var createtime = datalist.createTime;
  614. $itemlist.find(".commenttime").text(commenTime(createtime));
  615. }
  616. }else{
  617. if(num==2){
  618. $(".commentList").html("");
  619. }else{
  620. $("#moreArtical").addClass("displayNone");
  621. }
  622. }
  623. }
  624. },
  625. error: function() {
  626. $.MsgBox.Alert('提示', '服务器请求失败')
  627. }
  628. });
  629. }
  630. //删除自己的留言
  631. function articledel(commenid) {
  632. $.ajax({
  633. url:"/ajax/leaveWord/delete",
  634. dataType: 'json', //数据格式类型
  635. type: 'POST', //http请求类型
  636. data: {
  637. "id": commenid,
  638. },
  639. timeout: 10000, //超时设置
  640. success: function(data) {
  641. if(data.success) {
  642. message(5,2);
  643. }
  644. },
  645. error: function() {
  646. $.MsgBox.Alert('提示', '服务器请求失败')
  647. }
  648. });
  649. }
  650. //您可能感兴趣的论文
  651. paperInterestingList()
  652. function paperInterestingList(){
  653. $.ajax({
  654. "url" : "/ajax/ppatent/ralatePatents",
  655. "type" : "GET" ,
  656. "dataType" : "json",
  657. "data" :{
  658. "patentId":patentId
  659. },
  660. //"async":false,
  661. "traditional": true, //传数组必须加这个
  662. "success" : function(data) {
  663. if(data.success) {
  664. console.log(data);
  665. var dataStr=data.data
  666. if(dataStr.length > 0){
  667. $("#interPatent").show();
  668. var itemlist = '';
  669. $("#patentList").html("");
  670. for(var i = 0; i < dataStr.length; i++) {
  671. var itemlist = '<li>';
  672. itemlist += '<a class="flexCenter" target="_blank" href="patentShow.html?patentId=' + dataStr[i].id +'"><div class="madiaHead patentHead"></div>';
  673. itemlist += '<div class="madiaInfo">';
  674. itemlist += '<p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  675. itemlist += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  676. itemlist += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  677. itemlist += '</div></a></li>';
  678. $itemlist = $(itemlist);
  679. $("#patentList").append($itemlist);
  680. }
  681. }
  682. }
  683. },
  684. "error":function(){
  685. $.MsgBox.Alert('提示','链接服务器超时')
  686. }
  687. });
  688. }
  689. }
  690. //根据关键词查询查找相关论文
  691. function paperRelatedList(array){
  692. $.ajax({
  693. "url" : "/ajax/ppaper/assPapers",
  694. "type" : "GET" ,
  695. "dataType" : "json",
  696. "data" :{
  697. "kws":array
  698. },
  699. //"async":false,
  700. "traditional": true, //传数组必须加这个
  701. "success" : function(data) {
  702. if(data.success) {
  703. console.log(data);
  704. var dataStr=data.data
  705. if(dataStr.length > 0){
  706. $("#paperList").show();
  707. for(var i = 0; i < dataStr.length; i++) {
  708. 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>'
  709. $(".recentlyList").append(itemlist);
  710. }
  711. }
  712. }
  713. },
  714. "error":function(){
  715. $.MsgBox.Alert('提示', '链接服务器超时')
  716. }
  717. });
  718. }
  719. })