<!--{assign var="menu_id" value="coupon"}-->
<!--{include file="<!--{$oetplpath}-->block_header.tpl"}-->
<style type="text/css">
  body{background:#f7f7f7;}
</style>
<div class="oe_ntop">
  <i class="iconfont" onclick="goBack();">&#xe616;</i>
  <p>优惠券</p>
  <label f="but_open_sx">筛选<em class="iconfont">&#xe623;</em></label>
</div>

<div class="oe_coupon_list" id="json_data">
  <!--{if empty($coupon)}-->
  <h6 class="oe_nodata">没有符合条件的信息</h6>
  <!--{else}-->
  <!--{foreach $coupon as $volist}-->
  <dl onclick="goUrl('<!--{$oefile}-->&c=<!--{$c}-->&a=detail&id=<!--{$volist.coupid}-->');">

    <dt> 
	  <img src="<!--{$volist.logourl}-->" />
      <p class="p_1">
	    满<span> <!--{doubleval($volist.fullamount)}--> </span>减 
	    <span> <!--{doubleval($volist.cost)}--> </span>
	  </p>
      <p class="p_2"><span>立刻领取</span></p>
	  <p class="p_3">领取人数：<span><!--{$volist.salenums}--></span></p>
      <div class="clear"></div>
    </dt>

	<dd>
      <p>
	    数量：<span><!--{$volist.nums}--></span>&nbsp;&nbsp;
		剩余：<span><!--{$volist.nums-$volist.salenums}--></span>
		<label><!--{$volist.shopname}--> </label>
	  </p>
    </dd>

  </dl>
  <!--{/foreach}-->
  <div class="clear"></div>
  <!--{/if}-->
</div>

<!--{if $pagecount > 1}-->
<div class="oe_page" id="page_more_btn">点击加载下一页</div>
<!--{/if}-->
<input type="hidden" name="page" id="page" value="2" />
<input type="hidden" name="reqs_url" id="reqs_url" value="<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json" />
<input type="hidden" name="s_order" id="s_order" />
<input type="hidden" name="s_catid" id="s_catid" />
<input type="hidden" name="s_area1" id="s_area1" />
<input type="hidden" name="s_area2" id="s_area2" />
<input type="hidden" name="s_area3" id="s_area3" />
<input type="hidden" name="s_area4" id="s_area4" />

<script type="text/javascript">
$(function(){
	//加载下一页
	$("#page_more_btn").bind("click", function(){
		_oeGetListData();
	});

	//打开筛选
	$("[f='but_open_sx']").bind("click", function(){
		$('#sx_box').show();$('#sx_box').animate({ left: '0px' }, '100');
	});

	//关闭筛选
	$("[f='but_close_sx']").bind("click", function(){
		$('#sx_box').animate({left: '1024px' }, '300', function(){
			$('#sx_box').hide();
		});
	});

});
function _getPageList($first) {
	if (typeof($first) == "undefined") {
		$first = "";
	}
	$s_order = $("#s_order").val();
	$s_catid = $("#s_catid").val();
	$s_area1 = $("#s_area1").val();
	$s_area2 = $("#s_area2").val();
	$s_area3 = $("#s_area3").val();
	$s_area4 = $("#s_area4").val();
	$_urlitems = "s_catid="+$s_catid+"&s_area1="+$s_area1+"&s_area2="+$s_area2+"&s_area3="+$s_area3+"&s_area4="+$s_area4+"&s_order="+$s_order+"";
	$_url = "<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json&"+$_urlitems;
	$("#reqs_url").val($_url);
	_oeGetListData($_url, $first);
}
</script>

<div class="oe_shade" id="sx_box" style="left:1024px;display:none;">
  <input type="hidden" name="sx_catid" id="sx_catid" value="" />
  <input type="hidden" name="sx_areaid" id="sx_areaid" value="" />
  <div class="oe_topser">
    <i class="iconfont" f="but_close_sx">&#xe616;</i>
    <p>筛选条件</p>
  </div>
  <div class="oe_topsearch">
    <dl>
	  <dt>分类</dt>
	  <dd>
        <span f="but_select_cat" data-id="0" class="current">全部</span>
		<!--{assign var="couponcatlist" value=vo_list("mod={couponcat} where={v.parentid='0'}")}-->
		<!--{foreach $couponcatlist as $val}-->
        <span f="but_select_cat" data-id="<!--{$val.catid}-->"><!--{$val.catname}--></span>
		<!--{/foreach}-->
        <div class="clear"></div>
      </dd>
    </dl>
    <dl>
	  <dt>地区</dt>
	  <dd>
        <span f="but_select_area" data-id="0" class="current">全部</span>
		<!--{assign var="distlist" value=vo_list("mod={area} where={v.parentid='<!--{$s_area2}-->'}")}-->
		<!--{foreach $distlist as $val}-->
        <span f="but_select_area" data-id="<!--{$val.areaid}-->"><!--{$val.areaname}--></span>
		<!--{/foreach}-->
        <div class="clear"></div>
      </dd>
    </dl>
    <div class="oe_topsearch_btn"><span f="but_select_sx">完成</span></div>
  </div>
  <script type="text/javascript">
  $(function(){

	$("[f='but_select_cat']").bind("click", function(){
		$_catid = $(this).attr("data-id");
		$("#sx_catid").val($_catid);
		$("[f='but_select_cat']").removeClass("current");
		$(this).addClass("current");
	});

	$("[f='but_select_area']").bind("click", function(){
		$_distid = $(this).attr("data-id");
		$("#sx_areaid").val($_distid);
		$("[f='but_select_area']").removeClass("current");
		$(this).addClass("current");
	});
	
	//完成筛选
	$("[f='but_select_sx']").bind("click", function(){
		$("#s_catid").val($("#sx_catid").val());
		$("#s_area3").val($("#sx_areaid").val())
		$('#sx_box').animate({left: '1024px' }, '600', function(){
			$('#sx_box').hide();
		});
		_getPageList(1);
	});

  });
  </script>
</div>
</body>
</html>