<!--{assign var="menu_id" value="activity"}-->
<!--{include file="<!--{$oetplpath}-->block_header.tpl"}-->
<div class="oe_ntop">
  <i class="iconfont" onclick="goBack();">&#xe616;</i>
  <p>商家活动</p>
  <label f="but_open_sx">筛选<em class="iconfont"></em></label>
</div>


<div class="oe_active_rank">
  <dl class="current">
    <dt f="select_menu" data-order="default">综合</dt>
  </dl>

  <dl>
    <dt f="select_menu">预约<i class="iconfont">&#xe624;</i></dt>
    <dd style="display:none;">
      <ul>
        <li f="select_drop_menu" data-order="bespoke_desc">预约从高到低 <i class="iconfont">&#xe61b;</i></li>
        <li f="select_drop_menu" data-order="bespoke_asc">预约从低到高 <i class="iconfont">&#xe61b;</i></li>
      </ul>
    </dd>
  </dl>

  <dl>
    <dt f="select_menu">人气<i class="iconfont">&#xe624;</i></dt>
    <dd style="display:none;">
	  <ul>
        <li f="select_drop_menu" data-order="hits_desc">人气从高到低 <i class="iconfont">&#xe61b;</i></li>
        <li f="select_drop_menu" data-order="hits_asc">人气从低到高 <i class="iconfont">&#xe61b;</i></li>
      </ul>
	</dd>
  </dl>
  
  <dl>
    <dt f="select_menu">价格<i class="iconfont">&#xe624;</i></dt>
    <dd style="display:none;">
      <ul>
        <li f="select_drop_menu" data-order="price_desc">价格从高到低 <i class="iconfont">&#xe61b;</i></li>
        <li f="select_drop_menu" data-order="price_asc">价格从低到高 <i class="iconfont">&#xe61b;</i></li>
      </ul>
    </dd>
  </dl>
  <div class="clear"></div>

</div>
<div class="clear"></div>
<script type="text/javascript">
$(function(){
	
	$("[f='select_menu']").bind("click", function(){
		$order = $(this).attr("data-order");
		if (typeof($order) == "undefined") {
			$order = "";
		}
		$(".oe_active_rank dl").removeClass("current");
		$dl_obj = $(this).parent("dl");
		$dl_obj.addClass("current");

		if ($order == "default") { //综合排序
			$("#s_order").val("");
			$(".oe_active_rank dl dd").hide();
			_getPageList(1);
		}
		else { //其他排序
			$dd_obj = $dl_obj.find("dd");
			if ($dd_obj.css("display") == "block") {
				$dd_obj.hide();
			}
			else {
				$(".oe_active_rank dl dd").hide();
				$dd_obj.show();
			}
		}
	});

	//选择排序
	$("[f='select_drop_menu']").bind("click", function(){
		$_orderby = $(this).attr("data-order");
		$(".oe_active_rank ul li").removeClass("current");
		$(this).addClass("current");
		$("#s_order").val($_orderby);
		$(".oe_active_rank dl dd").hide();
		_getPageList(1);
	});


});
</script>
<div class="oe_active_list" id="json_data">


</div>


<div class="oe_page" id="page_more_btn" style="display:none;">点击加载下一页</div>

<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(){
	
	/*
	$max_width = (WIN_WIDTH-32)/2;
	$(".oe_active_list dl").css({"width":$max_width});
	$(".oe_active_list dl dt img").css({"width":$max_width});
	$(".oe_active_list dl dt img").css({"height":$max_width});
	*/

	_getPageList(1);
});
</script> 
<!--{include file="<!--{$oetplpath}-->block_footer.tpl"}-->

<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="activitycatlist" value=vo_list("mod={activitycat} where={v.parentid='0'}")}-->
		<!--{foreach $activitycatlist 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>