clientmobile.php 2.24 KB
<?php 
$str = '';
foreach($this->view->fragments as $fragment)
{
	$str .= sprintf('<a href="%s"><img src="%s" alt="" class="look_big_image" source="%s" style="width:105px;height:105px;"/></a>',
			 $fragment['fUrl'].'/yohoshowState/'.$this->view->yohoshowState, 
			 preg_replace('/_\.(\w+)/i','_-0210x0210-1.jpg', $fragment['image']), $fragment['image']);
}
?>
<?php if(!$this->view->isAjax):?>
<?php $this->_extends('layout/default_layout_mobile');?>
<?php $this->_block('main');?>
<div class="mobile-container">
	 <div >
		<img src="<?php echo $this->view->banner;?>" />
	</div>
	<div class="show-list clearfix">
		<?php echo $str;?>
	</div>
    <div class="detail-pagination" offset="<?php echo $this->view->offset;?>"  limit="<?php echo $this->view->limit;?>">
	 </div>
	 <div class="shareBox">
        <div class="appBox">
            <div class="appLogo">
            <img src="http://res.yohoshow.com/res/www/images/show/Icon-120.png" width="60" alt=""></div>
            <div class="sppIntro">
                <h2>SHOW</h2>
                <p>Happy Labelling</p>
                <p>钉住你的衣食住行</p>
            </div>
        </div>
        <a href="<?php echo $this->view->url;?>" class="appDownload download_a">立即体验
            <span class="icon-download"></span>
        </a>
    </div>
</div>  
<?php $this->_js('index.js', array(
    SITE_JS . '/lib/seajs.js',
));?>
<script type="text/javascript">
seajs.use("jquery", function($)
{
    $(window).scroll(function() 
    {
    	var scrollTop = $(document).scrollTop();
    	if(scrollTop >= $(document).height() - $(window).height() - 100)
    	{
        	var offset = parseInt($(".detail-pagination").attr("offset"));
        	var limit = parseInt($(".detail-pagination").attr("limit"));
        	offset = offset+limit;
	        $.ajax
	        ({
		        type:"post",
				url:"<?php echo SITE_MAIN;?>/show/client/isAjax/1/offset/"+offset+"/limit/"+limit+"/rand/" + Math.random(),
				async :false,
				success:function(data)
				{   
					if($.trim(data) != "" )
					{
						$(".detail-pagination").attr("offset", offset);
						$(".show-list").append(data);
					}
				}
		   });
        }
    });
    	        
});
</script>
<?php $this->_endblock();?>
<?php else: ?>
	<?php echo $str;?>
<?php endif;?>