{include file="public/mall_top" /}
{include file="public/mall_header" /}



<style type="text/css">
#box { background: #FFF; width: 238px; height: 410px; margin: -390px 0 0 0; display: block; border: solid 4px #D93600; position: absolute; z-index: 999; opacity: .5 }
#infscr-loading { display: none; }
</style>
<script src="{$Think.config.url_domain_root}static/home/js/search_goods.js"></script>

<div class="nch-container wrapper">
  <div class="ncp-category">
    <ul>
      <input type="hidden" id="sc_id" value="{$Think.param.gc_id}"/>
      <li><a class="" href="{:url('Promotion/index')}">所有分类</a></li>
      <?php foreach ($goods_class as $k=>$v){?>
      <li><a class="{if condition="$Think.param.gc_id eq $v.gc_id"}selected{/if}" href="{:url('Promotion/index',['gc_id'=>$v.gc_id])}"}'><?php echo $v['gc_name'];?></a></li>
      <?php } ?>
    </ul>
  </div>
  <div id="promotionGoods">
      <?php foreach($goods_list as $goods_info) { ?>
      <div class="item">
          <div class="scope">
              <dl class="goods">
                  <dt class="goods-thumb"> <a title="<?php echo $goods_info['goods_name'];?>" target="_blank" href="<?php echo $goods_info['goods_url'];?>"><img src="<?php echo $goods_info['image_url_240'];?>" /></a> </dt>
                  <dd class="goods-name"><span><strong><?php echo $goods_info['xianshi_title'];?></strong></span> <a target="_blank" href="<?php echo $goods_info['goods_url'];?>"><?php echo $goods_info['goods_name'];?></a></dd>
              </dl>
              <div class="goods-price"><span class="sale">促销价<em><?php echo dsPriceFormatForList($goods_info['xianshi_price']);?></em>元</span><span class="depreciate"><i class="icon-long-arrow-down"></i>直降：¥<?php echo $goods_info['down_price'];?></span></div>
              <div class="goods-buy"><a href="javascript:void(0);" nctype="add_cart" data-param="{goods_id:<?php echo $goods_info['goods_id'];?>}" class="btn">立即抢购</a> <span class="raty" data-score="<?php echo $goods_info['evaluation_good_star'];?>" style="width: 100px;"></span> <span class="mt5"><a href="<?php echo url('store/index',array('store_id'=>$goods_info['store_id']));?>"><?php echo $goods_info['store_name'];?></a></span> </div>
              <ul class="goodseval">
                  <?php if (is_array($goodsevallist[$goods_info['goods_id']])) { ?>
                  <?php foreach($goodsevallist[$goods_info['goods_id']] as $k=>$v){ ?>
                  <li>
                      <div class="user-avatar"> <img src="<?php echo getMemberAvatarForID($v['geval_frommemberid']);?>">  </div>
                      <div class="eval"><i class="icon-quote-left"></i><?php echo $v['geval_content'];?><i class="icon-quote-right"></i></div>
                  </li>
                  <?php } ?>
                  <?php } ?>
              </ul>
          </div>
      </div>
      <?php } ?>

  </div>
</div>

{include file="public/mall_server" /}
{include file="public/mall_footer" /}
<script src="{$Think.config.url_domain_root}static/plugins/jquery.masonry.js"></script>
<script src="{$Think.config.url_domain_root}static/plugins/jquery.infinitescroll.js"></script>
<script src="{$Think.config.url_domain_root}static/plugins/js/jquery.raty/jquery.raty.min.js"></script>
<script>
var $container = $('#promotionGoods');
$container.masonry({
    columnWidth: 305,
    itemSelector: '.item'
});
$(function(){
    $container.infinitescroll({
        navSelector : '#page-more',
        nextSelector : '#page-more a',
        itemSelector : '.item',
        loading: {
            selector:'#page-nav',
            img: '{$Think.config.url_domain_root}static/home/images/loading.gif',
            msgText:'努力加载中...',
            maxPage : '{$total_page}',
    finishedMsg : '没有记录了',
        finished : function() {
        $('.raty').raty({
            path: "{$Think.config.url_domain_root}static/plugins/js/jquery.raty/img",
            readOnly: true,
            width: 100,
            score: function() {
                return $(this).attr('data-score');
            }
        });
    }
}
},function(newElements){
        var $newElems = $(newElements);
        $container.masonry('appended', $newElems, true);
    });

    $('.raty').raty({
        path: "{$Think.config.url_domain_root}static/plugins/js/jquery.raty/img",
        readOnly: true,
        width: 100,
        score: function() {
            return $(this).attr('data-score');
        }
    });
});
</script>