<wxs module="g_filter" src="g_filter.wxs"></wxs>
<view wx:if="{{openSearchModal}}">
  <view class="search-modal">
    <view class="search-bar">
      <form bindsubmit="submitSearch">
        <input autoFocus class="search-input" name="word" placeholder="请输入商品关键字" bindconfirm="submitSearch" bindinput="getInput"></input>
        <button class="search-btn" formType="submit">
          <image class="wh100 search-img" src="{{url}}/miniapp/images/sea.png"></image>
        </button>
      </form>
    </view>
    <view class="search-hot">
      <view class="hot-title">热门搜索</view>
      <block wx:if="{{hotWords.length>0}}">
        <view class="hot-row" wx:for="{{hotWords}}" wx:key="{{index}}">
          <view bindtap="searchHotWord" class="hot-item" data-word="{{item}}" wx:for="{{item}}" wx:key="{{index}}">{{item}}</view>
        </view>
      </block>
    </view>
		<view class="search-hot">
		  <view class="hot-title flex jc_sb ai_c">
				<text>历史搜索</text>
				<text class="iconfont icon-shanchu xc-ash" bindtap="clearSearchRecord" wx:if="{{searchRecord.length != 0}}"></text>
			</view>
		  <block wx:if="{{searchRecord.length>0}}">
		    <view class="hot-row flex flex-wrap" wx:key="{{index}}">
		      <view class="hot-item history ellipsis-1" bindtap="searchHotWord" data-word="{{item}}" wx:for="{{searchRecord}}" wx:key="{{index}}">{{item}}</view>
		    </view>
		  </block>
			<view wx:else class="fs24">暂无历史搜索记录</view>
		</view>
  </view>
</view>