$.fn.extend({ common:function(pageid,team_id,type){ var datahtml = ''; if(type==''){ var action='comment'; }else{ var action='commentcate'; } $.post("/ajax/ajaxfront.php?action="+action+"", { pageid : pageid, team_id : team_id, type:type, } , function(data){ if(data['result']==1) { $("#curpage").val(pageid); $.each(data['data'], function(i, item){ datahtml = datahtml + '
'+item['username']+''+item['add_time']+'
'+ '
'+ '
'+ item['content']+''+ '
'; if(item['reply']!=null && item['reply_time']!=null) { datahtml = datahtml + '
'+ '[ 客服回复 ]'+ ''+item['reply_time']+''+ '
'+ '
'+ ''+item['reply']+ '
'; } datahtml = datahtml + '
'; }); $("#inner_cmt_box").html(datahtml); } else { } },'json'); }, firstbtn:function(team_id,totalpage,type){ //更改标识为1 $.fn.common(1,team_id,type); $('.pager').children('span').removeclass("po de"); $('#last,#next').addclass("po"); $('#first,#prev').addclass("de"); }, prevbtn:function(team_id,totalpage,type){ var pageid = parseint($("#curpage").val())-1; pageid = (pageid<=0)?1:pageid; $.fn.common(pageid,team_id,type); if(pageid==1) { $('.pager').children('span').removeclass("po de"); $('#first,#prev').addclass("de"); $('#last,#next').addclass("po"); }else{ $('.pager').children('span').removeclass("po de"); $('.pager').children('span').addclass("po"); } }, nextbtn:function(team_id,totalpage,type){ var pageid = parseint($("#curpage").val())+1; pageid = (pageid>=totalpage)?totalpage:pageid; $.fn.common(pageid,team_id,type); if(pageid==totalpage) { $('.pager').children('span').removeclass("po de"); $('#last,#next').addclass("de"); $('#first,#prev').addclass("po"); }else{ $('.pager').children('span').removeclass("po de"); $('.pager').children('span').addclass("po"); } }, lastbtn:function(team_id,totalpage,type){ this.common(totalpage,team_id,type); $('.pager').children('span').removeclass("po de"); $('#last,#next').addclass("de"); $('#first,#prev').addclass("po"); } }); /***评价分页面处理***/ $("#last").on("click",function(){ $.fn.lastbtn(team_id,totalpage,type); }); $("#next").on("click",function(){ $.fn.nextbtn(team_id,totalpage,type); }); $("#prev").on("click",function(){ $.fn.prevbtn(team_id,totalpage,type); }); $("#first").on("click",function(){ $.fn.firstbtn(team_id,totalpage,type); }); /***************/