<popup ref="setPopup">
  <view class="b2b-select-store" style="padding-bottom: {{ tabBar.hasTabBar ?  `${tabBar.height}px` : 0}}">
    <view class="select-store-title-box">
      <view class="select-store-title">选择门店</view>
      <button class="select-store-btn-cancel" onTap="handleClose">
        取消
      </button>
    </view>
    <view class="select-store-content">
      <block a:if="{{ stores.length > 0 }}">
        <view class="select-store-location-box">
          <view class="select-store-location">
            <view class="icon-location" />
            {{ city }}
          </view>
          <button
            class="select-store-btn-switch" onTap="handleSwitchCity"
          >
            切换城市
          </button>
        </view>
      </block>
      <adc-flat-list
        a:if="{{ isRenderAdcFlatList }}" ref="setFlatList" class="select-store-list"
        list="{{ stores }}" limit="{{ 10 }}" onFetchData="onFetchNearStores"
        disable-lower-scroll="out-of-bounds" disable-upper-scroll="out-of-bounds"
        scroll-with-animation="{{ true }}" scroll-animation-duration="{{ 300 }}"
        style="{{ stores.length > 5 ? 'height: 60vh;' : '' }}"
      >
        <view
          slot-scope="props" class="select-store-list-item"
          data-id="{{ props.item.storeId }}" onTap="handleSelectStore"
        >
            <view class="select-store-list-item-name">{{ props.item.storeName }}</view>
            <view class="select-store-list-item-addr">{{ props.item.address }}</view>
        </view>
        <view slot="empty">
          <view class="select-store-no-data">
            <view class="select-store-no-data-img" />
            <text class="select-store-no-data-tip">当前城市没有找到门店，换个城市试试吧！</text>
            <button class="select-store-btn-switch" onTap="handleSwitchCity">
              切换城市
            </button>
          </view>
        </view>
      </adc-flat-list>
    </view>
  </view>
</popup>
