
	<style type="text/css">
	   body{background-color: #F4F4F4;}
        .listbox{overflow: hidden;background-color: #f4f4f4;position: relative;margin-top: 5px;margin-bottom: 10px;}
        .todayTJ{background-color: #fff;  padding: 12px 0px 6px 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;}
        .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;}
	</style>
</head>
<body>
	<div>
		<div class="listbox">
			<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><span><?php echo $v['score'].$score_name;?></span><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></li>				

				<?php
					}
				?>
			</ul>
		</div>
	</div>
	<script>
	jQuery(document).ready(function($) {
		var page = 2;
        var empty = false;
        var loading = false;
		$(window).bind('scroll',function(event){
             if($(document).height() - $(window).height()-$(window).scrollTop()<=0){
                if(loading){
                    return false;
                }
                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\">积分抽奖"+data[i].cate+"</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>