You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

2 lines
6.4 KiB

  1. /** PTNovelSearch-v4.1.2 LPPL License By http://www.ptcms.com/ */
  2. ;function vote(e){$.ajax(__ADD_VOTE,{type:"post",dataType:"json",data:{novelid:__NOVEL_ID,num:e},beforeSend:function(){null==loading&&(loading=layer.open({type:2}))},complete:function(){null!=loading&&(layer.close(loading),loading=null)},success:function(e){if("-1000"==e.code)window.location.href=e.data.redirect;else if(e.code)layer.open({content:e.msg,skin:"msg",time:2,end:function(){e.data.redirect&&(window.location.href=e.data.redirect)}});else{layer.open({content:"推荐成功",skin:"msg",time:2});var t=$(".num-vote");t.text(parseInt(t.text())+parseInt(e.data.num))}},error:function(){layer.alert("推荐失败,请刷新页面后重试!",{icon:2})}})}function star(e){$.ajax(__ADD_STAR,{type:"post",dataType:"json",data:{novelid:__NOVEL_ID,star:e},beforeSend:function(){null==loading&&(loading=layer.open({type:2}))},complete:function(){null!=loading&&(layer.close(loading),loading=null)},success:function(t){if("-1000"==t.code)window.location.href=t.data.redirect;else if(t.code)layer.open({content:t.msg,skin:"msg",time:2,end:function(){t.data.redirect&&(window.location.href=t.data.redirect)}});else{var n=$(".num-star-people");n.text(parseInt(n.text())+1);var o=$(".num-avg-star");o.text((parseInt(o.data("star-score"))+e)/(parseInt(o.data("star-num"))+1)),layer.open({content:"操作成功!",skin:"msg",time:2})}},error:function(){layer.open({content:"评分失败,请刷新页面后重试!",skin:"msg",time:2})}})}function reward(e){$.ajax(__ADD_REWARD,{type:"post",dataType:"json",data:{novelid:__NOVEL_ID,num:e},beforeSend:function(){null==loading&&(loading=layer.open({type:2}))},complete:function(){null!=loading&&(layer.close(loading),loading=null)},success:function(e){"-1000"==e.code?window.location.href=e.data.redirect:e.code?layer.open({content:e.msg,skin:"msg",time:2,end:function(){e.data.redirect&&(window.location.href=e.data.redirect)}}):layer.open({content:"操作成功!",skin:"msg",time:2})},error:function(){layer.open({content:"打赏失败,请刷新页面后重试!",skin:"msg",time:2})}})}function voteTicket(e){$.ajax(__ADD_VOTE_TICKET,{type:"post",dataType:"json",data:{novelid:__NOVEL_ID,num:e},beforeSend:function(){null==loading&&(loading=layer.open({type:2}))},complete:function(){null!=loading&&(layer.close(loading),loading=null)},success:function(e){"-1000"==e.code?window.location.href=e.data.redirect:e.code?layer.open({content:e.msg,skin:"msg",time:2,end:function(){e.data.redirect&&(window.location.href=e.data.redirect)}}):layer.open({content:"操作成功!",skin:"msg",time:2})},error:function(){layer.open({content:"打赏失败,请刷新页面后重试!",skin:"msg",time:2})}})}$(".pt-open").click(function(){$(".pt-book-intro").removeClass("compulsory-row-three"),$(this).hide()}),$(".pt-star-btn").click(function(){$(".pt-star-box").show()}),$(".pt-tj-btn").click(function(){$(".pt-tj-box").show()}),$(".btn-interactive-vote").click(function(){$(".pt-interactive-vote-box").show()}),$(".btn-interactive-reward").click(function(){$(".pt-interactive-reward-box").show()}),$(".pt-pop-grade .pt-close").click(function(){$(".pt-pop-grade").hide(),$(".pt-pop-grade .pt-square").css({border:"0.01rem solid #D5D5D5",color:"#626267"}),$(".pt-submit").css({"background-color":"#D5D5D5"})}),$(".pt-pop-grade .pt-square").click(function(){$(this).css({border:"0.01rem solid #FF5555",color:"#FF5555"}),$(this).siblings().css({border:"0.01rem solid #D5D5D5",color:"#626267"}),$(".pt-submit").css({"background-color":"#FF5555"}),$(this).parents(".pt-pop-grade").data("value",$(this).data("value"))}),$(".pt-pop-grade .pt-submit").click(function(){var e=$(this).parents(".pt-pop-grade").data("value");if(!e)return!1;switch($(".pt-pop-grade .pt-square").css({border:"0.01rem solid #D5D5D5",color:"#626267"}),$(".pt-submit").css({"background-color":"#D5D5D5"}),$(this).parents(".pt-pop-grade").data("type")){case"vote":vote(e);break;case"star":star(e);break;case"interactive-vote":voteTicket(e);break;case"interactive-reward":reward(e);break;default:layer.open({content:"页面参数异常!",skin:"msg",time:2})}$(this).parents(".pt-pop-grade").removeData("value"),$(".pt-pop-grade").hide()});var loading=null;$(".btn-mark").click(function(){var e,t=0;"收藏"==$(".mark-title:eq(0)").text()?(e=__ADD_MARK,t=1):(e=__DEL_MARK,t=-1),$.ajax(e,{type:"post",dataType:"json",data:{novelid:__NOVEL_ID},beforeSend:function(){null==loading&&(loading=layer.open({type:2}))},complete:function(){null!=loading&&(layer.close(loading),loading=null)},success:function(e){if("-1000"==e.code)window.location.href=e.data.redirect;else if(e.code)layer.open({content:e.msg,skin:"msg",time:2,end:function(){e.data.redirect&&(window.location.href=e.data.redirect)}});else{layer.open({content:"操作成功!",skin:"msg",time:2});var n=$(".num-mark");n.text(parseInt(n.text())+t),t>0?$(".mark-title").text("取消收藏"):$(".mark-title").text("收藏")}},error:function(){layer.open({content:"收藏失败,请刷新页面后重试!",skin:"msg",time:2})}})}),$(".comment-btn-up,.comment-btn-down").click(function(){var e=$(this);return e.hasClass("active")||e.parent().hasClass("disable")?(layer.open({content:"操作失败,您已经评价过了!",skin:"msg",time:2}),!1):void $.ajax(__RATING_COMMENT,{type:"post",dataType:"json",data:{comment_id:e.parents(".pt-comment-cont").data("comment-id"),type:"novel",type_id:__NOVEL_ID,action:e.hasClass("comment-btn-down")?"bad":"good"},beforeSend:function(){null==loading&&(loading=layer.open({type:2}))},complete:function(){null!=loading&&(layer.close(loading),loading=null)},success:function(t){"-1000"==t.code?window.location.href=t.data.redirect:t.code?layer.open({content:t.msg,skin:"msg",time:2,end:function(){t.data.redirect&&(window.location.href=t.data.redirect)}}):(e.addClass("active"),e.find("img").attr("src",e.find("img").attr("src").replace(".png","_hover.png")),e.parent().addClass("disable"),e.find(".number").text(parseInt(e.find(".number").text())+1),layer.open({content:"操作成功",skin:"msg",time:2}))},error:function(){layer.alert("操作失败,请刷新页面后重试!",{icon:2})}})}),$(".pt-interactive-vote-box .ticket_select button").click(function(){var e=parseInt($(this).siblings("span").text()),t=parseInt($(".pt-interactive-vote-box .total").text());$(this).hasClass("minus")?e>1&&$(this).siblings("span").text(e-1):$(this).hasClass("plus")&&e<t&&$(this).siblings("span").text(e+1)}),$(".pt-interactive-reward-box .pt-submit").click(function(){console.log(this)});