$(document).ready(function() { loginStatus(); //判断个人是否登录 var userid = $.cookie("userid"); var userName = $.cookie("userName"); var paperId = GetQueryString("paperId"); var hurl = window.location.host; $(".commentList").parent().append('') module.lWord(paperId,2,1); if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){ location.href="http://" + window.location.host + "/e/l.html?id="+paperId; } //分享关注按钮 $('.shareWeixin').hover(function(){$(this).find('.shareCode').stop(true,false).fadeToggle();}); $('.goSpan').hover(function(){$(this).find('.shareCode').stop(true,false).fadeToggle();}); //微信分享 var qrcode = new QRCode(document.getElementById("qrcode"), { width : 100, height : 100 }); function makeCode(){ var elurl = "http://" + hurl + "/e/l.html?id=" + paperId ; qrcode.makeCode(elurl); } makeCode(); ifcollectionAbout(paperId,$("#collectBtn"), 5) getPaperMe(); pageViewLog(paperId,5) if(userid && userid != "null" && userid != null){ $(".ifLoginOn").removeClass("displayNone"); }else{ $(".ifLoginUn").removeClass("displayNone"); $(".ifLoginUn").on('click',".loginGo", function() { quickLog(); operatTab(); closeLog(); }) } //点击收藏按钮 $("#collectBtn").on('click', function() { if(userid && userid != null && userid != "null") { if($(this).is('.icon-collected')){ cancelCollectionAbout(paperId,$(this), 5) } else { collectionAbout(paperId,$(this), 5); } }else{ quickLog(); operatTab(); closeLog(); } }); //关键词标签点击进去搜索 $(".tagList").on("click","li",function(){ var tagText = $(this).find("p").text(); location.href = "searchNew.html?searchContent=" + tagText + "&tagflag=6"; }) //点击进入个人详情页面 $("#aboutAuthors").on("click","li>a",function(){ var oDataId = $(this).attr("data-id"); if(oDataId.substring(0,1)!="#"){ $(this).attr("href","userInforShow.html?professorId="+oDataId); }else{ $(this).attr("href","javascript:void(0)"); } }) $("#aboutAuthors").on("click","li.lastBtn",function(){ $("#aboutAuthors li").css("display","block"); $(this).hide(); }) //点击关注按钮 $("#aboutAuthors").on('click',"span.attenSpan", function() { var pId=$(this).parent().siblings("a").attr("data-id"); if(userid && userid != null && userid != "null") { if($(this).is('.attenedSpan')){ cancelCollectionAbout(pId,$(this),1) } else { collectionAbout(pId,$(this),1); } }else{ quickLog(); operatTab(); closeLog(); } }); /*获取论文信息*/ function getPaperMe() { $.ajax({ "url": "/ajax/ppaper/qo", "type": "GET", "success": function(data) { console.log(data); if(data.success) { paperHtml(data.data); getPaperAuthors(data.data.id) var paperName = data.data.name + "-科袖网"; document.title = paperName; } }, "data": { "id": paperId }, dataType: "json", 'error': function() { $.MsgBox.Alert('提示', '服务器连接超时!'); } }); } /*获取论文作者信息*/ function getPaperAuthors(stritrm) { $.ajax({ "url": "/ajax/ppaper/authors", "type": "GET", "success": function(data) { console.log(data); if(data.success) { if(data.data.length>0){ $("#aboutAuthors .lastBtn span").text(data.data.length); for(var i=0;i' str +='
' str +='
' str +='

'+ showPro.name +'

' str +='

'+ baseInfo +'

' str +='
'; if(showPro.id==userid){ str +='' }else{ str +='
关注
'; } str +=''; var $str=$(str); $("#aboutAuthors .lastBtn").before($str); if(showPro.id!=userid){ ifcollectionAbout(showPro.id,$str.find(".attenSpan"),1); } } } }) }else{ var str=""; str +='
  • ' str +='
    ' str +='
    ' str +='

    '+ data.data[i].name +'

    ' str +='
    '; if(data.data[i].name==userName){ str +='
    是我本人
    ' }else{ str +='
    邀请' str +='
    ' str +='

    打开微信“扫一扫”,
    打开网页后点击屏幕右上角“分享”按钮

    ' str +='
    '; } str +='
  • '; var $str=$(str); $("#aboutAuthors .lastBtn").before($str); } if(data.data.length<5){ $("#aboutAuthors li").css("display","block"); $(".lastBtn").hide(); }else{ $("#aboutAuthors li:lt(3)").css("display","block"); } } //邀请 $('.goSpan').on("mouseenter",".yaoqing",function(){ $(this).find('.shareCode').stop(true,false).fadeIn(); }).on("mouseleave",".yaoqing",function(){ $(this).find('.shareCode').stop(true,false).fadeOut(); }); //邀请作者 var Qcu=document.getElementsByClassName("qrcodeUser"); for(var i=0;i0){ patentRelatedList(subs) for (var i = 0; i < subs.length; i++) { $(".tagList").append('
  • '+ subs[i] +'

  • '); }; }else{ $(".tagList").hide(); } } var weibopic = "http://" + window.location.host + "/images/default-paper.jpg" var weibotitle = $da.name; var weibourl = window.location.href; $("#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"); } isAgreeNum() function isAgreeNum() { var data = {"id": paperId} $.ajax({ url:"/ajax/ppaper/agreeCount", data:data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 timeout: 10000, async: true, success: function(data) { if(data.success){ if(userid && userid != "null" && userid != null) { isAgree(data.data) //文章点赞 } else { $(".thumbBtn").html("赞 " + data.data + ""); } } }, error: function() { $.MsgBox.Alert('提示',"服务器链接超时"); } }); } /*判断论文是否被赞*/ function isAgree(articleAgree) { var data = {"id": paperId,"uid":userid,"uname":$.cookie("userName") } $.ajax({ url:"/ajax/ppaper/agree", data:data, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 timeout: 10000, async: true, success: function(data) { if(data.success){ if(data.data){ $(".thumbBtn").html("已赞 "+articleAgree+""); $(".thumbBtn").addClass("thumbedBtn").css("cursor","auto"); }else{ $(".thumbBtn").html("赞 "+articleAgree+""); $(".thumbBtn").addClass("thunbgo"); } } }, error: function() { $.MsgBox.Alert('提示',"服务器链接超时"); } }); } //论文点击点赞 $('.thumbBlock').on("click",".thunbgo",function(){ if (userid && userid != "null" && userid != null) { addAgree(); }else{ quickLog(); operatTab(); closeLog(); } }) /*点赞*/ function addAgree() { console.log(paperId) var data = {"uid": userid,"id": paperId,"uname":$.cookie("userName")} $.ajax({ url:"/ajax/ppaper/agree", data:data, dataType: 'json', //数据格式类型 type: 'POST', //http请求类型 timeout: 10000, async: true, success: function(data) { if(data.success){ var articleAgreeval = $(".thumbBtn span").text(); $(".thumbBtn").html("已赞 "+(parseInt(articleAgreeval)+1)+""); $(".thumbBtn").addClass("thumbedBtn").css("cursor","auto"); $(".thumbBtn").removeClass("thunbgo"); } }, error: function() { $.MsgBox.Alert('提示',"服务器链接超时"); } }); } //您可能感兴趣的论文 paperInterestingList() function paperInterestingList(){ $.ajax({ "url" : "/ajax/ppaper/ralatePapers", "type" : "GET" , "dataType" : "json", "data" :{ "paperId":paperId }, //"async":false, "traditional": true, //传数组必须加这个 "success" : function(data) { if(data.success) { var dataStr=data.data if(dataStr.length > 0){ $("#interPaper").show(); var itemlist = ''; $("#paperList").html(""); for(var i = 0; i < dataStr.length; i++) { var moreInf="" if(!dataStr[i].cn4periodical){ dataStr[i].cn4periodical=""; } if(!dataStr[i].en4periodical){ dataStr[i].en4periodical=""; } if(!dataStr[i].pubDay){ dataStr[i].pubDay=""; } moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay; var itemlist = '
  • '; itemlist += '
    '; itemlist += '
    '; itemlist += '

    '+ dataStr[i].name +'

    '; itemlist += '

    作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'

    '; itemlist += '

    期刊:'+ moreInf +'

    '; itemlist += '
  • '; $itemlist = $(itemlist); $("#paperList").append($itemlist); } } } }, "error":function(){ $.MsgBox.Alert('提示','链接服务器超时') } }); } //纠错反馈 $(".correctSubmit").on("click",function(){ var cntCon=$(this).siblings(".correctCon").val(); var cntUser=""; if(userid && userid != null && userid != "null") { cntUser = userid; } if(cntCon.length>500){ $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字'); return; }else{ $.ajax({ "url": "/ajax/feedback/error/paper", "type": "POST", "dataType": "json", "async": true, "data": { "id": paperId, "cnt":cntCon, "user":cntUser }, "success": function(data) { if(data.success) { backSuccessed(); } }, "error": function() { $.MsgBox.Alert('提示', '链接服务器超时') } }); } }) function patentRelatedList(array){ $.ajax({ "url":"/ajax/ppatent/assPatents", "type" : "GET" , "dataType" : "json", "data" :{ "kws":array }, "traditional": true, //传数组必须加这个 "success" : function(data) { if(data.success) { var dataStr=data.data if(dataStr.length > 0){ $("#patentrelate").removeClass("displayNone"); for(var i = 0; i < dataStr.length; i++) { var itemlist ='
  • '+ dataStr[i].name +'

  • ' $(".recentlyList").append(itemlist); } } } }, "error":function(){ $.MsgBox.Alert('提示', '链接服务器超时') } }); } })