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

<header class="aui-bar aui-bar-nav  aui-bar-light ">
 <a class="icon icon-xiangzuojiantou  pull-left  aui-padded-l-10 aui-padded-r-10 aui-text-warning"  href="{:es_url('Wap/ucenter')}" ></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++) { }}	

 <li class="aui-list-item aui-list-item-arrow  hrefa" data-url="{:es_url('Wap/topicdetail')}&id={{=it[i].id}}">
                <div class="aui-media-list-item-inner">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-text">
                            <div class="aui-list-item-title">{{=it[i].title}}</div>
                            
                        </div>
                        <div class="aui-list-item-text aui-ellipsis-2">
                            {{=it[i].descontent}}
                        </div>
                    </div>
                </div>
            </li>
  {{ } }}
        
      
                           
     
    </script>  

<div class="aui-content aui-margin-b-15 content infinite-scroll infinite-scroll-bottom infinite-scroll-myshoucanghtml">
        <ul class="aui-list aui-media-list" id="artlist"></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/getmyshoucang')}";

 
 var bodyParam = {
        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));
				}
   	$('.hrefa').click(function(){
		
		var url = $(this).data('url');
		$.router.loadPage(url);
		
	});	
			   
				

}





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

        	

   
   
   });



}

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

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


	$('.infinite-scroll-myshoucanghtml').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}