{extend name="Public:base" /}
   
{block name="body"}
<div class="page " id="topicdetailhtml">
  <style type="text/css">
   .aui-card-list-content-padded img{
   
   width:auto;
   
   }
   p#content-area{line-height:25px;}
        .search-input {
            height: 1.6rem;
            line-height: 1.6rem;
            background: #f5f5f5;
            border-radius: 30px;
            position: relative;
            font-family:"iconfont" !important;
            text-align: left;
            padding-left: 1.5rem;
            color: #999999;
        }
        .search-input:after {
            position: absolute;
            left: 0;
            padding-left: 0.5rem;
            content: "\e662";
        }
        .aui-card-list {
    position: relative;
    margin-bottom: 0;
    background: #ffffff;
}
    </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/groupinfo',array('id'=>$topicinfo['gid']))}"></a>

    
    <div class="aui-title">
				帖子详情
			</div>

    

    
  </header>
<div class="content">
<section class="aui-content grouptopiclist">
        <div class="aui-card-list">
            <div class="aui-card-list-header aui-card-list-user" style="overflow:hidden;">
                <div class="aui-card-list-user-avatar">
                    <img src="{$topicinfo['userhead']}" id="userhead" class="aui-img-round">
                </div>
                <div class="aui-card-list-user-name">
                    <div class="aui-text-info" id="topicinfo-nickname">{$topicinfo['nickname']}</div>
                   
                </div>
                <div class="aui-card-list-user-info text-light" id="info-time">{$topicinfo['create_time']}</div>
            </div>
            <div class="aui-card-list-content-padded aui-padded-t-5 aui-padded-b-15">
                <div class="aui-list-item-title aui-font-size-18 aui-margin-b-10" style="font-weight:bold" id="head-title">{$topicinfo['title']}</div>
                   <p id="content-area">{$topicinfo['content']}</p>
                    
                                
            
                    </div>

        </div>
       
    </section>
    <div class=" aui-content-bg">

<div class="content-title aui-border-b">
<div class="aui-pull-left" style="font-weight:bold;" id="allcomment">全部回帖</div>

</div>


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

        
      
                           
      
              {{ for(var i=0; i< it.length; i++) { }}	
              
    <div class="aui-card-list">
            <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  id="artlist">





        </div>
        <div style="margin-bottom:2.5rem;text-align:center;padding:0.5rem;background:#fff;"  data-url="{:es_url('Wap/allcomment',array('id'=>$topicinfo['id']))}" class="hrefa">查看全部评论</div>

  </div>


<footer class="aui-bar aui-bar-tab ">
        <div class="aui-bar-tab-item aui-padded-l-15 aui-padded-r-15 " onclick="commentadd(this)" style="width: auto;" data-url="{:es_url('Wap/commentadd',array('id'=>$topicinfo['id']))}">
          
            <div class="search-input aui-font-size-14">回复楼主...</div>
        </div>
        
        <div class="aui-bar-tab-item" tapmode="" style="width: 2.2rem;" >
        <a href="{:es_url('Wap/allcomment',array('id'=>$topicinfo['id']))}">
            <div class="aui-badge" style="left:50%" id="commentcount">{$topicinfo['commentcount']}</div>
            <i class="icon icon-xiaoxizhongxin"></i>
              </a>
        </div>
        
         <div class="aui-bar-tab-item "  style="width: 2.2rem;">
             {if condition="$topicinfo['uid'] neq $uid"}
      
      {if condition="$topicinfo['hassc'] eq 1"}
              <a class="btn btn-link  collect-btn" data-url="{:es_url('Wap/sctopic')}" href="javascript:;" data-id="{$topicinfo['id']}"><i class="icon icon-shoucang01-copy aui-text-danger"></i></a>
        
      {else/}
              <a class="btn btn-link  collect-btn" data-url="{:es_url('Wap/sctopic')}" href="javascript:;" data-id="{$topicinfo['id']}"><i class="icon icon-shoucang aui-text-danger"></i></a>
        
      {/if}
      
          {/if}
       
           
        </div>
        <div class="aui-bar-tab-item aui-hide" tapmode="" style="width: 2.2rem;">
            <i class="aui-iconfont icon-share"></i>
        </div>
    </footer>

<script type="text/javascript">
var page = 1;

function commentadd(obj){
	
	var uid = "{$uid}";
	if(uid>0){
		var url = $(obj).data('url');
		
		$.router.loadPage(url);
		
	}else{
		
		$.toast('还未登录');
	}
	
	
}
$('.collect-btn').click(function(){
    
    var url=$(this).data('url');
    var id=$(this).data('id');
  	
    $.post(url,{id:id},function(data){
   	
    if(data.code==1){
   	    if($(".collect-btn").find('i').hasClass('icon-shoucang01-copy')){
   	          
   	          $(".collect-btn").html("<i class='icon icon-shoucang aui-text-danger'></i>");
   	          }else{
   	          
   	           $(".collect-btn").html("<i class='icon icon-shoucang01-copy aui-text-danger'></i>");
   	          
   	          }
   	 $.toast(data.msg);
    
    }else{
    
     $.toast(data.msg);
    }
    
    
    
    });
    
    
    });
function getartlist(page,isAppend){

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

 
 var bodyParam = {
        id:"{$topicinfo['id']}",
        limit:4,
        page:page,
        
    }


 $.post(url, bodyParam, function(ret){

 if (ret.code==0) {

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


}else{

                    $("#artlist").html('');
				    var interText = doT.template($("#artlisttpl").text());
			        $("#artlist").html(interText(ret.data.info));
				

}





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


   
   
   });



}
getartlist(1, false);


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