
<style>
	.express{background:#F4F4F4;}
    .e_title{background-color: #fff;padding: 12px 10px; border-bottom: 1px solid #ECECEC;}
    .e_content{}
    .e_content .e_a{color: #ADADAD;font-size: 12px;}
    .e_title_1{overflow: hidden;}
    .e_title_1 a{display:inner-block;}
    .e_title_1 .e_b{color:  #57B6D2;border: 1px solid #57B6D2; border-radius: 10px; display: block;float: left;padding: 1px 6px; text-align: center; font-size: 11px; margin-right: 10px;margin-top: 3px;}
    .e_title_1 .e_c{font-size: 11px;padding: 1px 6px;border-radius: 10px; display: inline-block; margin-bottom: 4px;color: #3EC381;border: 1px solid #3EC381;}
    .e_title_1 .e_d{font-size: 11px;padding: 1px 6px;border-radius: 10px; display: inline-block; margin-bottom: 4px;color: #BE91D4;border: 1px solid #BE91D4;}
    .e_title_1 .e_e{font-size: 11px;padding: 1px 6px;border-radius: 10px; display: inline-block; margin-bottom: 4px;color: #F4B251;border: 1px solid #F4B251;}
    .e_right{float:right;}
    .e_right a{padding-top: 1px;}
    .e_left{float:left;font-size: 13px;}
</style>

<body class="express">
	<ul id="showlist">
		<?php
			foreach ($exchangeList as $v) {
		?>
        <li class="e_title">
            <div class="e_title_1">
                <p class="e_left"><?php echo $v['name'];?></p>
                <div class="e_right"><a href="#" class="e_b"><?php echo $v['get_type'];?></a><a href="#" class="e_c"><?php echo $v['cate'];?></a>
                </div>
            </div>
            <div class="e_content">
                <p class="e_a">所需<?php echo $score_name;?>：<?php echo $v['score'];?></p>
                <p class="e_a">兑换时间：<?php echo $v['exchange_time'];?></p>
                <?php
                	if($v['c_cate'] == 1)
                	{
                ?>
                <p class="e_a">取货地址：<?php echo $v['address'];?></p>
                <?php		
                	}
                	else
                	{
                ?>
                <p class="e_a">代充账号：<?php echo $v['extra'];?></p>
                <?php
                	}
                ?>
                
            </div>
        </li>		
		<?php
			}
		?>

	<ul/>
    <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/ajaxExchange");?>',
                    type: 'POST',
                    dataType: 'json',
                    data: {page: page},
                    success:function (data)
                    {
                        if(empty){
                            return false;
                        }

                        if(data.code == 1)
                        {
                            empty = true;
                            return false;
                        }
                        var str="";
                        for (var i = 0; i < data.length; i++) {
                            str = str + "<li class=\"e_title\"><div class=\"e_title_1\"><p class=\"e_left\">"+data[i].name+"</p><div class=\"e_right\"><a  class=\"e_b\">"+data[i].get_type+"</a><a class=\"e_c\">"+data[i].cate+"</a></div></div><div class=\"e_content\"><p class=\"e_a\">所需<?php echo $score_name;?>："+data[i].score+"</p><p class=\"e_a\">兑换时间："+data[i].exchange_time+"</p>";
                                if(data[i].cate == 1)
                                {
                                    str = str + "<p class=\"e_a\">取货地址："+data[i].address+"</p>";
                                }
                                else
                                {
                                    str = str + "<p class=\"e_a\">代充账号："+data[i].extra+"</p>";
                                }
                                str = str +"</div></li>";
                        };
                        $("#showlist").append(str);
                        page = page + 1;

                        return false;
                    }
                });
            }
        });

        $('.listbox ul li').css('width',$('.listbox ul').width()/2-5);      
    });

    </script>    
</body>

</html>