<?php echo $this->fetch('header.html'); ?>
<?php echo $this->fetch('product/breadcrumb_list.html'); ?>
<div style="height:30px; padding-left:40px; margin-bottom:20px;">
<div class="btn-group">
<a href="<?php echo $this->_var['baseurl']; ?>&order=new" class="btn <?php if ($_GET['order'] == ''): ?> btn-danger<?php endif; ?>">默认排序</a><a href="<?php echo $this->_var['baseurl']; ?>&order=hot" class="btn <?php if ($_GET['order'] == 'hot'): ?> btn-danger<?php endif; ?>">热门</a>  <a href="<?php echo $this->_var['baseurl']; ?>&order=new"  class="btn <?php if ($_GET['order'] == 'new'): ?> btn-danger<?php endif; ?>">最新</a> 
</div>

<div class="btn-group">
<a href="<?php echo $this->_var['baseurl']; ?>" class="btn <?php if (get ( 'sprice' ) == 0): ?>btn-success<?php endif; ?>">全部</a>
<?php $_from = $this->_var['price_list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['c']):
?>
<a href="<?php echo R("".$this->_var["baseurl"]."&sprice=".$this->_var["k"]."");?>" class="btn <?php if (get ( 'sprice' ) == $this->_var['k']): ?>btn-success<?php endif; ?>"><?php echo $this->_var['c']; ?></a>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</div>

<?php if ($_GET['tagname']): ?>
<div class="btn-group " style="float:right;">
<a href="javascript:;" class="btn btn-danger">标签</a>
<a href="javascript:;" class="btn btn-success"><?php echo htmlspecialchars($_GET['tagname']); ?></a> 
</div>
<?php endif; ?>
</div>
<div id="container" class="row">
<?php $this->skymvc->loadmodel("category");$this->assign("tag_nav",$_ENV["categoryModel"]->tag_nav(get('catid','i'))); ?>
<?php if ($this->_var['tag_nav']['child']): ?>
<div class="rec_nav box span3 wb-box" >
<div style="border:1px solid #ccc; border-radius:5px; margin-bottom:10px; "> 

<a href="/index.php?m=list&a=default&catid=<?php echo $this->_var['tag_nav']['id']; ?>" class="tab-list-heading" ><i class="icon-star icon-white"></i><?php echo $this->_var['tag_nav']['cname']; ?></a> 
<ul class="tab-list">
<?php $_from = $this->_var['tag_nav']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
<li <?php if ($this->_var['c']['id'] == get ( 'catid' )): ?> class="active"<?php endif; ?>><a href="/index.php?m=list&catid=<?php echo $this->_var['c']['id']; ?>" class="red_f"><?php echo $this->_var['c']['cname']; ?></a></li>
 
<?php if ($this->_var['c']['child']): ?>
<?php $_from = $this->_var['c']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'd');if (count($_from)):
    foreach ($_from AS $this->_var['d']):
?>
<li><a href="/index.php?m=list&a=default&catid=<?php echo $this->_var['d']['id']; ?>" >|__<?php echo $this->_var['d']['cname']; ?></a></li>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
<?php endif; ?>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</ul>
</div>
</div>
<?php endif; ?>

<?php $_from = $this->_var['list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'p');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['p']):
?>
<div class="box span3"  >
<a href="/index.php?m=show&a=default&id=<?php echo $this->_var['p']['id']; ?>" target="_blank"><img <?php if ($this->_var['p']['thumbsinfo']): ?>class="lzImg" json='<?php echo $this->_var['p']['thumbsinfo']; ?>'<?php endif; ?> width="220" title="<?php echo $this->_var['p']['title']; ?>" alt="<?php echo $this->_var['p']['title']; ?>"    src="/<?php if ($this->_var['k'] > 12): ?>images/lazy.jpg<?php else: ?><?php echo $this->_var['p']['imgurl']; ?>.small.jpg<?php endif; ?>" data-original="/<?php echo $this->_var['p']['imgurl']; ?>.small.jpg" /></a>
<p>
<div class="btn-group">
<span class="btn">￥<?php echo $this->_var['p']['price']; ?></span>
<a href="javascript:;" onclick="orderCart_add(<?php echo $this->_var['p']['id']; ?>,1)" class="btn btn-success">加入购物车</a>
</div></p> 

<div class="info"><a   href="/index.php?m=show&a=default&id=<?php echo $this->_var['p']['id']; ?>" target="_blank"><?php echo $this->_var['p']['title']; ?></a>   </div>
</div>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</div>

<div style="clear:both;"></div>
<div ><?php echo $this->_var['pagelist']; ?></div>

  

<script>

 lzImage("lzImg",220);
  
  $(function(){ 
   //$(".box img").lazyload();
   
    var $container=$("#container");
    $container.imagesLoaded(function(){
      $container.masonry({
        itemSelector: '.box'
         
      });
    });
	
	$(window).scroll(function(){
		$(".box").show();
		$container.masonry( 'reload' )
		if($("img[src$='/images/lazy.jpg']").length>0){
			obj=$("img[src$='/images/lazy.jpg']");
			
			len=obj.length;
			
			for(i=0;i<len;i++){
				if(i<12){
					obj.eq(i).attr("src",obj.eq(i).attr("data-original"));
				}
			}
			
			$container.masonry( 'reload' )
		}
		
	}
	)
 
});

</script>

<?php echo $this->fetch('order_cart/fixed-cart.html'); ?>

<?php echo $this->fetch('footer.html'); ?> 


