<!-- 公用 用于页面顶部搜索框  -->

<template name="search">
  <view 
    class="search_space" 
    style="height:{{topsearchheight}}rpx;top:{{headerheight}}rpx;"
  ></view>
  <view   
    style="height:{{topsearchheight}}rpx;top:{{headerheight}}rpx;"
    class="search {{searchshow?'search_focus':''}}"
  >
    <view 
      class="search_input_b"
    >
    </view>
    <view class="search_input_ani">      
      <image        
        style="display: {{(searchshow||keylist.length==0)?'block':'none'}}" 
        class="search_input_ic"
        src="../../img/search.png"
      />
      <view 
        bindtap='searchFocus'  
        style="display: {{searchshow?'none':'inline-block'}}" 
        class="search_input_holder">
        <view
          style="display: {{keylist.length>0&&!searchshow?'flex':'none'}}"
          class="search_input_keys">
          <block  
            wx:for="{{keylist}}" 
            wx:key="{{item}}">
              <view 
                class="key_list_i"
                wx:if="{{index<4}}"
                >
                <view class="key_list_iw">{{item}}</view>
                <view 
                  data-index="{{index}}"
                  catchtap="deletekey"
                  class="key_list_d"><image src="../../img/close2.png"/></view>
              </view>
          </block> 
        </view>
        <view
          style="display: {{keylist.length==0?'inline-block':'none'}}" 
          class="search_input_holderw">
          搜索
        </view>
      </view>

      <input 
        style="display: {{searchshow?'block':'none'}}"         
        class="search_input"  
        placeholder-class="search_input_holder"
        placeholder="搜索"
        confirm-type="search"
        bindblur="inputBlur"
        bindconfirm="inputConfirm"
        focus='{{searchfocus}}'
        value='{{keys}}'
      />        
      <view
        class='cancel_search'
        bindtap='cancelSearch'
      >
        取消
      </view>
    </view>
    <!-- <view 
      class="input_supernatant"
      style="display:{{searchshow?'none':'block'}}"
    >
      <view
        class="inputbind_focus"    
        bindtap='searchFocus'
      >
      </view>
    </view> -->
    <view 
      class="hot_search"
      style="min-height:{{windowh-206}}px"
    >
      <view class="hot_search_t">
        热门搜索
      </view>
      <view  class="hot_search_w">
        <block wx:for="{{brandrecommend}}" wx:key="brand_id">
          <view bindtap="tapHot" class="hot_search_i" data-val = "{{item.brand_name}}">
            {{item.brand_name}}
          </view>
          <!-- <view  bindtap="tapHot" class="hot_search_i" data-val = "劳斯莱斯">
            劳斯莱斯
          </view>
          <view  bindtap="tapHot" class="hot_search_i" data-val = "宾利">
            宾利
          </view>
          <view  bindtap="tapHot" class="hot_search_i" data-val = "法拉利">
            法拉利
          </view>
          <view  bindtap="tapHot" class="hot_search_i" data-val = "兰博基尼">
            兰博基尼
          </view>
          <view  bindtap="tapHot" class="hot_search_i" data-val = "布加迪">
            布加迪
          </view> -->
        </block>
      </view>
    </view>
  </view>
</template>