<extend name="Public:pinduoduobase" />
<block name="content">    
<link rel="stylesheet" href="__PUBLIC__/pinduoduo/assets/css/subject.css">
<div id="main">
<section id="index-content">
	<?php if(!empty($subject['banner'])){ ?>
	<div class="subject-banner" >
		<img src="<?php echo C('SITE_URL'); ?>/Uploads/image/{$subject.banner}" width="100%" />
    </div>
	<?php } ?>
	<div id="subject-goods-list" class="main-view tuan subject-single-goods">
		<div class="base-list-wrapper" id="tuan_list">
			<volist name="list" id="d">
			<div class="subject-goods-list-item-0" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
				<div class="single-list-item" >
				    <div class="goods-image">
				        <img src="{$fan_ly_image}" class="scrollLoading" data-echo="__UPLOAD__/{$d.image}" >
				        
				    </div>
				    <p class="goods-name" data-log="">{$d.name}</p>
				    <div class="detail">
				        <img src="data:image/png;base64, ">
				        <a class="group-desc">
				            {$d.pin_count}人团
				        </a>
				        <a class="sale-price">
				            <i>￥</i>{$d.pinprice}
				        </a>
				        <del class="normal-price">
				            单买价￥{$d.danprice}
				        </del>
				    </div>
				    <div class="core" data-log="">
				        <span>去开团</span>
				        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAASBAMAAACdhyI/AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURf///0xpcf///////////////////////////////////////////+nkmRIAAAAMdFJOUx0AA9zdqt4eH6mPHIvMvyYAAABaSURBVAjXYxCsFgQCBvFkRhBVdsYARK05cxjIZVA9A+IyCMWAuAyCYC6DIJjLIAjmAinNM2ccgIJzzhxhBCtxAGs4wgjW7gA27AjIsDYQR5BBIgVskWADyFoA69EgN3WDDasAAAAASUVORK5CYII=">
				    </div>
				</div>
			</div>
			</volist>
			
		</div>
		
		
	</div>
</section>
</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>
<include file="Widget:pin_notify" />
<include file="Public:foot_lazy" />
<style>
.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('Subject/index',array('id' => $subject_id))}";
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: 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;
					bindImgEvent();
				} else if(result.code == 0) {
					$('#center_pullup').remove();
				}
				
			}
		}
	);
}
$(function(){
	$(window).scroll( function() { 
		loaddata();
	});
})

</script>
</block>
