<extend name="Public:pinduoduobase" />
<block name="content">    
<link rel="stylesheet" href="__PUBLIC__/pinduoduo/assets/css/tuanbonus.css">
<div id="main">
	<div class="list-myorder">
		<ul class="ul-product" id="order_list">
			<?php foreach($list as $val){ ?>
			<li>
				<span class="pic">
					<img src="<?php echo $val['avatar']; ?>">
				</span>
				<div class="text">
					<span class="pro-name">昵称：<?php echo $val['uname']; ?></span>
					<div class="pro-pric"><span>关注时间：</span><?php echo $val['create_time'];?></div>
					<div class="pro-pric"><span>推荐上级：</span><?php echo $val['parent_name']; ?></div>
				</div>
			</li>
			<?php } ?>
		</ul>
	</div>
	
</div>

<div class="center" id="center_pullup" style="display:none;">
	 <span><img class="img_rotate" src="__PUBLIC__/pinduoduo/assets/img/pull_loading_8eba142.png"/>
	 </span><span class="orders_text"></span>
</div>
<div style="height:49px;"></div>
<include file="Public:foot_pinduoduo" />
<style>

.list-myorder {
  margin: 10px 15px 10px 15px;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  box-shadow: 0 2px 2px rgb(230,230,230);
  font-size: 14px;
}
.list-myorder .ul-product {
  margin: 5px 15px;
  line-height: 1.2;
}
.list-myorder li {
  padding: 10px 0;
  list-style: none;
  border-bottom: 1px dotted #ccc;
  overflow: hidden;
}
.list-myorder .pic {
  float: left;
  width: 70px;
  height: 70px;
  margin-right: 10px;
  padding: 1px;
  border: 1px solid #ccc;
  border-radius: 3px;
}
.list-myorder .pic img {
  width: 100%;
  height: 100%;
}
.list-myorder .text {
  overflow: hidden;
  font-size: 14px;
}
.list-myorder .pro-name {
  color: #333;
  font-size: 14px;
}
.list-myorder .pro-pric {
  margin-top: 5px;
  color: #333;
  font-size: 14px;
}
.list-myorder .pro-pric span {
  font-size: 14px;
  color: #999;
}
.list-myorder .pro-pric {
  margin-top: 5px;
  color: #333;
  font-size: 14px;
}
.list-myorder .pro-pric span {
  font-size: 14px;
  color: #999;
}

.center {
    width: 170px;
    margin: 0 auto;
    text-align: center;
}
.img_rotate {
    width: 30px;
    height: 30px;
    margin-top: 7px;
    margin-right: 5px;
    -webkit-animation: loading 1s linear 0s infinite;
}

@-webkit-keyframes loading {
    0% {
        -webkit-transform: rotate(0);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}
.orders_text {
    line-height: 45px;
    font-weight: 700;
    font-size: 15px;
}

</style>
<script>
var offset = 0;
var _pa = 2;
var is_can_next = 1;
var cur_url = "{:U('Spike/index')}";
var type = "{$type}";
var req_step = 1;


function loaddata()
{ 
	var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());     //浏览器的高度加上滚动条的高度 

	if ($(document).height() <= totalheight+200)     //当文档的高度小于或者等于总的高度的时候，开始动态加载数据
	{ 
		if(is_can_next == 1)//加载数据
		{
			is_can_next = 0;
			nextpage();
		}
	} 
}

function nextpage()
{	
	$('#center_pullup').show();
	$.ajax(
		{ 
			url: "{:U('tuanbonus/tuanyuan')}", 
			type:'get',
			data:{page:_pa,type:type},
			dataType: 'json', 
			success: function(result){
				
				if(result.code == 1)
				{
					$('#order_list').append(result.html);
					$('#center_pullup').hide();
					
					_pa++;
					is_can_next = 1;
				} else if(result.code == 0) {
					$('#center_pullup').hide();
					is_can_next = 0;
					$('#center_pullup').remove();
				}
			}
		}
	);
}
$(function(){
	nextpage();
	$(window).scroll( function() { 
		loaddata();
	});
})

</script>
</block>
