
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>晒单分享 - {wc:$webname}</title>     
    <meta content="app-id=518966501" name="apple-itunes-app" />     
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0"/>
    <meta content="yes" name="apple-mobile-web-app-capable" />     
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />     
    <meta content="telephone=no" name="format-detection" />
    <link href="{G_TEMPLATES_CSS}/mobile/comm.css?" rel="stylesheet" type="text/css" />
	<link href="{G_TEMPLATES_CSS}/mobile/single.css?" rel="stylesheet" type="text/css" />
	<script src="{G_TEMPLATES_JS}/mobile/jquery190.js" language="javascript" type="text/javascript"></script>
	<script id="pageJS" data="{G_TEMPLATES_JS}/mobile/postlist.js" language="javascript" type="text/javascript"></script>
	
<link rel="stylesheet" href="{G_TEMPLATES_CSS}/mobile/top.css">
</head>
<body>
<div class="h5-1yyg-v1">
    
<!-- 栏目页面顶部 -->

{wc:templates "mobile/index","header"}


<!-- 内页顶部 -->

    
    <div id="navBox" class="g-snav m_listNav">
        <div class="g-snav-lst z-sgl-crt"><a href="javascript:;" class="gray9">最新晒单</a><b></b></div>
        <div class="g-snav-lst"><a href="javascript:;" class="gray9">人气晒单</a><b></b></div>
        <div class="g-snav-lst"><a href="javascript:;" class="gray9">评论最多</a></div>
    </div>

    <!-- 晒单列表 -->
    <section>	
		<div class="cSingleCon" id="loadingPicBlock">
		    <div id="postBox10" class="cSingleCon2"></div>
        </div>
		<div id="postLoading" class="loading loading2"><b></b>正在加载</div>
        <a id="btnLoadMore" class="loading" href="javascript:;" style="display:none;">点击加载更多</a>
		<a id="btnLoadMore2" class="loading"  style="display:none;">没有数据</a>
        <a id="btnLoadMore3" class="loading"  style="display:none;">已经到底了</a>
    </section> 
	<input id="urladdress" value="" type="hidden" />
    <input id="pagenum" value="" type="hidden" />
{wc:templates "mobile/index","footer"}

<script language="javascript" type="text/javascript">
window.onload=function(){
	sdajax('new');
}
function sdajax(parm){	
	$("#urladdress").val('');
	$("#pagenum").val('');
	$.getJSON('{WEB_PATH}/mobile/shaidan/shaidanajax/'+parm,function(data){	
		$("#postLoading").hide();
		if(data[0].sum){
			var fg=parm.split("/");
				$("#urladdress").val(fg[0]);
				$("#pagenum").val(data[0].page);
			for(var i=0;i<data.length;i++){
				var pic=data[i].sd_photolist.split(";");
				var t=new Date(data[i].sd_time);
				var div='<div class="cSingleInfo"><dl class="fl">';
					div+='<a href="{WEB_PATH}/mobile/mobile/userindex/'+data[i].sd_userid+'">';
					div+='<img src="{G_UPLOAD_PATH}/'+data[i].pic+'">';
					div+='<b></b></a></dl><div class="cSingleR m-round">';
					div+='<ul><li><em class="blue" id="'+data[i].sd_userid+'">'+data[i].user+'</em>';
					div+='<span><strong class="c9">：</strong>'+data[i].sd_title+'</span> ';
					div+='<h5>'+data[i].time+'</h5></li>';
					div+='<li><p>'+data[i].sd_content+'</p></li>';
					div+='<li class="maxImg"  id="'+data[i].sd_id+'">';
					for(var x=0;x<pic.length-1;x++){
						div+='<img src="{G_UPLOAD_PATH}/'+pic[x]+'">';
					}
					div+='</li>';
					div+='<li><dd><s></s><strong>'+data[i].sd_zhan+'</strong>人羡慕嫉妒</dd>';
					div+='<dd><i></i><strong>'+data[i].sd_ping+'</strong>条评论</dd>';
					div+='</li></ul><b class="z-arrow"></b></div></div>';
				$(".cSingleCon2").append(div);
			}
			if(data[0].page<=data[0].sum){
				$("#btnLoadMore").css('display','block');
				$("#btnLoadMore2").css('display','none');
				$("#btnLoadMore3").css('display','none');
			}else if(data[0].page>data[0].sum){
				$("#btnLoadMore").css('display','none');
				$("#btnLoadMore2").css('display','none');
				$("#btnLoadMore3").css('display','block');
			}
		}else{
			$("#btnLoadMore").css('display','none');
			$("#btnLoadMore2").css('display','block');	
			$("#btnLoadMore3").css('display','none');			
		}
	})
}
$(function(){
	$("#navBox div").click(function(){
		$(".cSingleCon2 div").remove();
		e=$(this).index();
		$("#navBox div").removeClass('z-sgl-crt').eq(e).addClass('z-sgl-crt');
		switch(e){
			case 0:
			sdajax('new');
			break;
			case 1:
			sdajax('renqi');
			break;
			case 2:
			sdajax('pinglun');
			break;
		}
	});
	//加载更多
	$("#btnLoadMore").click(function(){		
		var url=$("#urladdress").val(),
			page=$("#pagenum").val();
		sdajax(url+'/'+page);
	});
	//返回顶部
	$(window).scroll(function(){
		if($(window).scrollTop()>50){
			$("#btnTop").show();
		}else{
			$("#btnTop").hide();
		}
	});
	$("#btnTop").click(function(){
		$("body").animate({scrollTop:0},10);
	});
	//跳转页面
	var gt='.cSingleInfo .maxImg';
	$(document).on('click',gt,function(){
		var id=$(this).attr('id');
		if(id){
			window.location.href="{WEB_PATH}/mobile/shaidan/detail/"+id;
		}			
	});
	$(document).on('click','.cSingleInfo .blue',function(){
		var id=$(this).attr('id');
		if(id){
			window.location.href="{WEB_PATH}/mobile/mobile/userindex/"+id;
		}	
	});	
})
</script>

</div>
</body>
</html>