search.wxml 1.93 KB
<view class="search-container" style="min-height:{{windowHeight}}px;">
    <view class="top-search">
        <view class="input-bg"></view>
        <input class="search-input" value="{{query}}" confirm-type="search" placeholder="{{placeholder ? placeholder : '店内潮品搜一下'}}"
               bindconfirm="confirmQuery" bindinput="bindQueryInput"
            placeholder-class="placeholder" focus="{{isSearch}}"/>
        <image class="icon" src="../../../static/images/search@2x.png"></image>
    </view>
    <view class="recent-keys" wx:if="{{recentKeys.length > 0 && !searched}}">
        <view class="title">最近搜索
            <image class="delete" src="../../../static/images/delete.png" bindtap="deleteRecent"></image></view>
        <view class="keys">
            <text wx:for="{{recentKeys}}" wx:key="{{item}}"
                  class="key" bindtap="searchRecent" data-key="{{item}}">{{item}}</text>
        </view>
    </view>
    <view hidden="{{!searched}}">
        <view class="fixed-filter">
            <product-list-filter bind:sortchange="sortChange"></product-list-filter>
        </view>
        <view class="no-res" wx:if="{{noResult}}">
            <image class="no-res-img" src="https://cdn.yoho.cn/yoho-brand-shop/assets/img/product/no-search-icon.png"></image>
            <view class="no-res-txt">未搜索到任何相关商品</view>
        </view>
        <view wx:if="{{productList.length > 0}}" class="product-list">
            <view class="activity-title" wx:if="{{activityTitle}}">
                <text>{{activityTitle}}</text>
            </view>
            <product-list list="{{productList}}"
                  show-loading="{{showLoading}}"
                  show-no-more="{{showNoMore}}">
            </product-list>
        </view>
    </view>
    <copyright wx:if="{{searched}}" class="copy-right"></copyright>
    <quick-navigation show-back-top="{{showBackTop}}" bindbacktop="backTop"></quick-navigation>
</view>