<extend name="Public:pinduoduobase" />
<block name="content">    
<link rel="stylesheet" href="__PUBLIC__/pinduoduo/assets/css/likes_d0bf6c65ee1a3c99ec3fcea913d20f11.css">

<div class="container no-footer" id="likes">
	<section id="like-list">
		<div class="base-list-wrapper" id="tuan_list">
			
			<volist name="list" id="d">
			<div class="like-list-item-0" >
				<div class="like-item">
					<div class="like-item-goods-img" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
						<?php if(!empty($d['fan_image'])){ ?>
						<img src="/Uploads/image/{$d.fan_image}" />
						<?php } else { ?>
						<img src="{$d.image}" />
						<?php } ?>
						
					</div>
					<div class="like-item-goods-text" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
						<div class="like-item-goods-name">{$d.name}</div>
						<div class="like-item-goods-count">已卖<?php echo $d['seller_count']+$d['virtual_count']; ?>件</span></div>
					</div>
					<div class="like-item-goods-bottom">
						<div class="like-item-goods-line"></div>
						<div class="like-item-goods-price">￥{$d.danprice}</div>
						<div class="like-item-goods-start" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">立即购买</div>
						<div class="like-item-goods-cancel" onclick="del_fav(this,{$d.goods_id})">取消收藏</div>
					</div>
				</div>
			</div>
			</volist>
			
		</div>
	</section>
</div>

<include file="Widget:pin_notify" />
<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:50px;"></div>
<include file="Public:foot_pinduoduo" />
<style>
.like-item-goods-start{
	border:1px solid #ff6699;
	background-color: #ff6699;
}
.like-item-goods-price{
	color:#ff6699;
}
.container{background-color:#fff;}
.coupon-tabbar .coupon-tab { 
	width:49%;
}
.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('User/myfavgoods')}";
var req_step = 1;

function del_fav(obj,goods_id)
{

	$.ajax({
			url:"index.php?s=/User/fav_toggle",
			type:'get',
			data:{goods_id:goods_id},
			dataType:'json',
			success:function(ret){
				$(obj).parent().parent().parent().remove();
			}
		})
		return false;
}
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: cur_url, 
			type:'post',
			data:{page:_pa},
			dataType: 'json', 
			success: function(result){

				if(result.code == 1)
				{
					$('#tuan_list').append(result.html);
					$('#center_pullup').hide();
					_pa++;
					is_can_next = 1;
				} else if(result.code == 0) {
					$('#center_pullup').remove();
				}
				
			}
		}
	);
}
$(function(){
	$(window).scroll( function() { 
		loaddata();
	});
})

</script>
</block>
