<import src="./templates/search-guide/index.wxml" />

<view class="search-container">
  <!-- 导航栏 -->
  <free-capsule-bar />

  <!-- 搜索框 -->
  <search-input
    value="{{ value }}"
    focus="{{ focus }}"
    placeholder="王者荣耀"
    bind:search="onSearch"
    bind:change="onChange"
    bind:clear="onClear"
  />

  <!-- 搜索引导页 -->
  <view wx:if="{{ showGuidePage }}">
    <template is="search-guide-history" data="{{ searchHistoryList }}" />
    <!-- <template is="search-guide-hot" data="{{ searchHotList }}" /> -->
  </view>

  <!-- 搜索结果 -->
  <view wx:else>
    <block wx:if="{{ !recommendList || recommendList.length === 0 }}">
      <free-empty image="search" description="抱歉没有找到({{ value  }}),给您推荐其他热销商品" />
    </block>
    <block wx:else>
      <goods-list data="{{ recommendList }}" />
    </block>
  </view>
</view>
