portal html css js resource

patentShow.js 21KB

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