<!--components/search-filter/index.wxml-->
<wxs src="../../pages/common.wxs" module="common"></wxs>
<view class='filter-wrapper' catchtouchmove="true">

  

  <i-row i-class='row-filter'>
    <!-- 地区筛选 -->
    <i-col span="12" i-class="col-class">
      <view class="filter-item">
        <text class="{{filter_idx==1?'active':''}}" catchtap='filterTap' data-idx="1">{{selected_titles.region}}</text>
        <image class="search-icon" src="/images/icon-down-select{{filter_idx==1?'ed':''}}.png"></image>
      </view>
    </i-col>
    
    <!-- 排序筛选 -->
    <i-col span="12" i-class="col-class">
      <view class="filter-item" style='position:relative;'>
        <view class='vdivider'></view>
        <text class="{{filter_idx==2?'active':''}}" catchtap='filterTap' data-idx="2">{{selected_titles.order}}</text>
        <image class="search-icon" src="/images/icon-down-select{{filter_idx==2?'ed':''}}.png"></image>
      </view>
    </i-col>
  </i-row>

  <view catchtap='closeFilter' class='filter-content-wrapper' wx:if="{{filter_idx>0}}" catchtouchmove='true'>
    <view class="row-content" catchtap='preventEvent'>
      <scroll-view class="scroll-view" scroll-y="true" style="width: 100%;height: 100%;">
        <!-- 地区选项 - 新版本 - 汪小熊 - 20181212 -->
        <view wx:if="{{filter_idx==1}}" class="region_filter">
          <scroll-view scroll-y='true' class="region_level_wrapper">
            <view wx:for="{{region_level1_datas}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id" bindtap='selectRegionLevel' data-item="{{n}}" data-order='1' class="{{region_selected.level_1==n.id?'active':''}}"> {{n.title}} </view>
          </scroll-view>
          <scroll-view scroll-y='true' class="region_level_wrapper">
            <view wx:for="{{region_level2_datas}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id" bindtap='selectRegionLevel' data-item="{{n}}" data-order='2' class="{{region_selected.level_2==n.id?'active':''}}"> {{n.title}} </view>
          </scroll-view>
          <scroll-view scroll-y='true' class="region_level_wrapper">
            <view wx:for="{{region_level3_datas}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id" bindtap='selectRegionLevel' data-item="{{n}}" data-order='3' class="{{region_selected.level_3==n.id?'active':''}}"> {{n.title}} </view>
          </scroll-view>
        </view>
        
        <!-- 排序筛选 -->
        <view wx:if="{{filter_idx==2}}" class='filter-row' wx:for="{{orders}}" wx:for-index="idx" wx:for-item="n" wx:key="n.id">
          <text bindtap="orderFilter" data-idx="{{n.id}}" data-item="{{n}}" class="{{selected.order==n.value?'seled':''}}">{{n.name}}</text>
          <image wx:if="{{selected.order==n.value}}" class='f-selected' src='/images/icon_filter_selected.png'></image>
        </view>

      </scroll-view>

    </view>
  </view>
</view>