{extend name="Public:base" /}
   
{block name="body"}
<div class="page " id="allcommenthtml">

        <header class="aui-bar aui-bar-nav  aui-bar-light ">
 <a class="icon icon-xiangzuojiantou back pull-left  aui-padded-l-10 aui-padded-r-10 aui-text-warning"  href="{:es_url('Wap/topicdetail',array('id'=>$id))}" ></a>

    
    <div class="aui-title" style="color:#000;">
				全部评论
	</div>


  </header>

	  <script id="artlisttpl" type="text/x-dot-template">
         

        
      
                           
      
              {{ for(var i=0; i< it.length; i++) { }}	
              
    <div class="aui-card-list aui-border-b">
            <div class="aui-card-list-header aui-card-list-user">
                <div class="aui-card-list-user-avatar" style="width:1.5rem;">
                    <img src="{{=it[i].userhead}}" class="aui-img-round" >
                </div>
                <div class="aui-card-list-user-name">
                    <div class="aui-text-info aui-font-size-12">{{=it[i].nickname}}</div>
                    <div class="aui-font-size-12 text-light">{{=it[i].floor}}楼</div>
                </div>
                <div class="aui-card-list-user-info text-light ">{{=it[i].create_time}}</div>
            </div>
            <div class="aui-card-list-content-padded aui-padded-t-5 aui-padded-b-15 aui-font-size-12">
             {{=it[i].content}}
            

        
            </div>
            

        </div>
                    
         
   {{ } }}
        
      
                           
     
    </script>  
<div class="content infinite-scroll infinite-scroll-bottom infinite-scroll-allcommenthtml aui-content aui-margin-b-15" data-distance="100" style="position:fixed;">

        <ul class="aui-list aui-media-list"  id="artlist" style="background-size: 100% 0px;">
            
     
          
        </ul>
    </div>

          <div class="zanwujl aui-hide">
      <i class="icon icon-wujilu " style="    font-size: 3rem;"></i>
      
      <div>暂无数据记录</div>
      </div>  

<script type="text/javascript">

function getartlist(page,isAppend){

var url = "{:es_url('Wap/gettopiccomment')}";

 
 var bodyParam = {
        id:"{$id}",
        limit:0,
        page:page,
      
    }
 $.post(url, bodyParam, function(ret){

 if (ret.code==0) {

if(ret.data.status=='error'){

if(page==1){
if($('.zanwujl').hasClass('aui-hide')){
$('.zanwujl').removeClass('aui-hide');
}
$("#artlist").html('');

}
}else{
if(!$('.zanwujl').hasClass('aui-hide')){

$('.zanwujl').addClass('aui-hide');

}
    var interText = doT.template($("#artlisttpl").text());
   	if (!isAppend) {
					$("#artlist").html(interText(ret.data.info));
				} else {
					$("#artlist").append(interText(ret.data.info));
				}
				
			   
				

}





          
           
        
     }else{
    	  $.toast('数据出错');
     
     }

        	

   
   
   });



}

getartlist(1, false);
var current_page=1;

	var oldTop = $('.infinite-scroll-allcommenthtml').scrollTop();


	$('.infinite-scroll-allcommenthtml').on('infinite',debounce(function(){
		
	var newTop = $(this).scrollTop();

	if(newTop-oldTop>0){
		current_page = current_page+1;
	
		getartlist(current_page, true);
		
		oldTop = newTop;
}
	
	
},500));

</script>
  </div>
 {/block}