{extend name="Public:base" /}
   
{block name="body"}
<div class="page " id="mytopichtml">
<link rel="stylesheet" href="__WAPCSS__/light7-swipeout.css">
<script type='text/javascript' src='__WAPJS__/light7-swipeout.js' charset='utf-8'></script>
<style>
.aui-media-list .aui-list-item-inner {

    padding-top: 1rem;
    padding-bottom: 1rem;
}
</style>

<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="swipeout aui-list-item aui-list-item-arrow  hrefa" data-url="{:es_url('Wap/topicdetail')}&id={{=it[i].id}}">
<div class="swipeout-content">      
          
<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>
</div>

  </div>
 <div class="swipeout-actions-left">
       
        <a href="#"  class="aui-bg-success">编辑</a>
        <a href="#" class="aui-bg-danger">删除</a>
      </div>
            </li>
  {{ } }}
        
      
                           
     
    </script>  

<div class="aui-content  content infinite-scroll infinite-scroll-bottom infinite-scroll-mytopichtml">

        <ul class="aui-list aui-media-list list-block" id="artlist" style="margin:0;"></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/getmytopic')}";

 
 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-mytopichtml').scrollTop();


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