
	<style type="text/css">
        body{background-color: #F4F4F4;}
               .topcredit{border-bottom:1px solid #F4F4F4;background-color: #fff;overflow: hidden;}
        .leftcre{padding: 14px 0px 7px 10px;border-bottom: 1px solid #ECECEC;}
        .rightcre{padding:9px 0px 10px 0px;border-bottom: 1px solid #ECECEC;}
        .rightcre a {width: 49%;display: inline-block; text-align: center;color: #ADADAD; padding: 4px 0px 1px 0px;}
        .myjf{font-size: 16px;width: 48%; display: inline-block;text-align: center;}
        .leftcre img{ width: 16px; margin-top: 3px;margin-right: 3px;}
        .rightcre span{vertical-align: top;}
        .rightcre a:nth-child(1){border-right: 1px solid #ECECEC;}
        .rightcre a img{width: 16px;margin-top: 3px;margin-right: 8px;}
        .leftcre  span{color: #F4A619;vertical-align: top;}
       .option{overflow: hidden;background-color: #fff;padding-top: 15px;padding-bottom: 10px; margin-top: 8px;border-top: 1px solid #ECECEC;border-bottom: 1px solid #ECECEC;}
        .option li{float: left;width: 25%;}
        .option li a img{width: 40px;text-align: center;display: block;margin: 0px auto;padding-bottom: 8px;}
        .option li a p{color: #333;text-align: center;font-size: 13px;}

  .listbox{overflow: hidden;background-color: #f4f4f4;position: relative;}
        .todayTJ{background-color: #fff;  padding: 15px 0px 9px 0px;margin-bottom: 4px;border-bottom: 1px solid #ECECEC;}
        .todayTJ img{width: 16px;margin-left: 10px;}
        .todayTJ span{color: #ADADAD;font-size: 12px;vertical-align: top;}

        .listbox ul{overflow: hidden;background-color:#F4F4F4;padding-left: 6px;}
        .listbox ul li{overflow: hidden;float: left;margin-bottom: 5px;background-color: #fff;position: relative;padding: 6px;}
        .listbox ul li a img{width: 100%;}
        .listbox ul li:nth-child(even){margin-left: 5px;}
        .shopname{color: #000;text-overflow:ellipsis;overflow:hidden; white-space:nowrap;font-size: 13px;}
        .shopmsg{font-size: 12px;color: #ADADAD;}       
        .shopmsg span:nth-child(2){color: #9D9D9D;float: right;}       
        .righttop{font-size: 12px;padding: 1px 12px;border-radius: 10px; display: inline-block; margin-top: 4px;margin-bottom: 4px;}
        .righttop1{color: #3EC381;border: 1px solid #3EC381;}
        .righttop2{color: #BE91D4;border: 1px solid #BE91D4;}
        .righttop3{color: #F4B251;border: 1px solid #F4B251;}
        
        .xyjf{display: inline-block;float: right; color: #ED7978!important;margin-top: 4px;}

        /*没有商品的时候*/
        .exchange{text-align: center;}
        .exchange img{width: 50%;margin-top: 220px;margin-bottom: 45px;}
        .exchange h2{color: #F44336;margin-bottom: 15px;}
        .exchange p{color: #9E9E9E;}
        .exchange span{color: #4CAF50;}
        .exchange p:nth-child(3){margin-bottom: 15px;}      
	</style>
</head>
<body>
	<div>
		<div>
			<div class="topcredit">
				<div class="leftcre">
                     <div style="width:50%;display:inline-block;text-align: center;">
                        <img src="<?php echo sasset_url('images/myjf.png');?>" alt="">
                        <span>我的<?php echo $score_name;?></span>
                    </div>
                    <span class="myjf">
                        <?php 
                            if($user->uid){
                                echo $user->getScore().$score_name;
                            }else{
                                echo '请登录';
                            }
                        ?>
                    </span>
				</div>
				<div class="rightcre">
					<a id="exchange" href="<?php echo site_url('scorefront/goods/exchange');?>"><img src="<?php echo sasset_url('images/pen.png');?>" alt=""><span>兑换记录</span></a>
					<a href="<?php echo MOCUZ_DIR;?>/index.php?mod=my_wallet&type=detail"><img src="<?php echo sasset_url('images/box.png');?>" alt=""><span>赚取积分</span></a>
				</div>
			</div>
			<ul class="option">
				<li><a href="<?php echo site_url('scorefront/goods/goodsType/3');?>"><img src="<?php echo sasset_url('images/credit_cj.png')?>" alt=""><p>积分抽奖</p></a></li>
				<li><a href="<?php echo site_url('scorefront/goods/goodsType/2');?>"><img src="<?php echo sasset_url('images/good_xn.png')?>" alt=""><p>虚拟商品</p></a></li>
				<li><a href="<?php echo site_url('scorefront/goods/goodsType/1');?>"><img src="<?php echo sasset_url('images/good_sw.png')?>" alt=""><p>实物商品</p></a></li>
				<li><a href="<?php echo site_url('scorefront/goods/goodsType/0');?>"><img src="<?php echo sasset_url('images/allshop.png')?>" alt=""><p>全部商品</p></a></li>
			</ul>
		</div>

		<div class="listbox">
            <div class="todayTJ">
                <img src="<?php echo sasset_url('images/todayTJ.png');?>" alt="">
                <span>今日推荐</span>
            </div>
            <?php 
                if(empty($goods)){
            ?>
            <div class="exchange">
                <img src="<?php echo sasset_url('images/400.png');?>" alt="">
                <p>暂无商品</p>
            </div>
            <?php
                }else{
            ?>
            <ul id="showlist">
                <?php foreach ($goods as $v) {
                ?>
                <li><a href="<?php echo site_url('scorefront/goods/deltails/'.$v['id']);?>"><img src="<?php echo $v['piclist'];?>" alt=""><p class="shopname"><?php echo $v['name']?></p><p class="shopmsg"><span>剩余<span class="shopnum"><?php echo $v['num'];?></span></span></p></a><span class="<?php
                        if($v['type'] == 2) {
                            echo 'righttop2';
                        }else
                        {
                            if($v['c_cate'] == 1){echo 'righttop3';}
                            if($v['c_cate'] == 2){echo 'righttop1';}                           
                        }

                    ?> righttop"><?php if($v['type'] == 2){echo "积分抽奖";}else{echo $v['cate'];}?></span><span class="xyjf"><?php echo $v['score']?><?php echo $score_name;?></span></li>
                <?php                   
                }
                ?>
            </ul>            
            <?php 
                }
            ?>


		</div>
	</div>
	
	<script>
	var page = 2;
	var empty = false;
	var loading = false;

		$(window).bind('scroll',function(event){
			if(loading){
				return false;
			}
			

            if($(document).height() - $(window).height()-$(window).scrollTop()<=0){
            	loading = true;
                $.ajax({
                	url: '<?php echo site_url("scorefront/goods/checkmod/".$mod);?>',
                	type: 'POST',
                	dataType: 'json',
                	data: {page: page},
                	success:function (data)
                	{
                		if(empty){
                			return false;
                		}

                		if(data.code == 1)
                		{
                			empty = true;
                			//alert(data.msg);
                			return false;
                		}
                		var str="";
                		for (var i = 0; i < data.length; i++) {
                			str = str + "<li><a href=\"<?php echo site_url('scorefront/goods/deltails');?>/"+data[i].id+"\"><img src=\""+data[i].piclist+"\" alt=\"\"><p class=\"shopname\">"+data[i].name+"</p><p class=\"shopmsg\"><span>"+data[i].score+"<?php echo $score_name;?></span><span>剩余<span class=\"shopnum\">"+data[i].num+"</span></span></p></a><span class=\"";
                                if(data[i].type ==2)
                                {
                                    str = str +"righttop2 righttop\">积分抽奖</span></li>";
                                }
                                else
                                {
                                    if(data[i].c_cate ==2)
                                    {
                                        str = str +"righttop1 righttop\">"+data[i].cate+"</span></li>";
                                    }else
                                    {
                                        str = str +"righttop3 righttop\">"+data[i].cate+"</span></li>";
                                    }

                                }                            
                
                		};
                		$("#showlist").append(str);
                        $('.listbox ul li').css('width',$('.listbox ul').width()/2-17.5);
                		page = page + 1;
                		loading = false;
                        return false;

                	}
                });
                
                
            }
        });
		setTimeout("$('.listbox ul li').css('width',$('.listbox ul').width()/2-17.5 );", 30 )
	</script>
</body>
</html>