Files
ai_dianshang/miniprogram/pages/goods/search/index.wxml
2025-11-17 14:11:46 +08:00

84 lines
2.4 KiB
Plaintext

<view class="search-page">
<view class="search-input-container">
<t-search
t-class-input-container="t-class__input-container"
t-class-input="t-search__input"
value="{{searchValue}}"
leftIcon=""
placeholder="搜索商品"
bind:submit="handleSubmit"
bind:change="onSearchInput"
bind:focus="onSearchFocus"
bind:blur="onSearchBlur"
bind:clear="onSearchClear"
focus
>
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
</t-search>
<!-- 搜索建议 -->
<view class="search-suggestions" wx:if="{{showSuggestions}}">
<view
class="suggestion-item"
wx:for="{{searchSuggestions}}"
wx:key="*this"
data-suggestion="{{item}}"
bind:tap="onSuggestionTap"
>
<t-icon prefix="wr" name="search" size="32rpx" color="#999" />
<text class="suggestion-text">{{item}}</text>
</view>
</view>
</view>
<view class="search-wrap">
<view class="history-wrap">
<view class="search-header">
<text class="search-title">历史搜索</text>
<text class="search-clear" bind:tap="handleClearHistory">清除</text>
</view>
<view class="search-content">
<view
class="search-item"
hover-class="hover-history-item"
wx:for="{{historyWords}}"
bind:tap="handleHistoryTap"
bindlongpress="deleteCurr"
data-index="{{index}}"
data-historyword="{{item}}"
wx:key="*this"
>
{{item}}
</view>
</view>
</view>
<view class="popular-wrap">
<view class="search-header">
<text class="search-title">热门搜索</text>
</view>
<view class="search-content">
<view
class="search-item"
hover-class="hover-history-item"
wx:for="{{popularWords}}"
bind:tap="handlePopularTap"
data-index="{{index}}"
data-popularword="{{item}}"
wx:key="*this"
>
{{item}}
</view>
</view>
</view>
</view>
<t-dialog
visible="{{dialogShow}}"
content="{{dialog.message}}"
bindconfirm="confirm"
bind:close="close"
confirm-btn="确定"
cancel-btn="{{dialog.showCancelButton ? '取消' : null}}"
t-class-confirm="dialog__button-confirm"
t-class-cancel="dialog__button-cancel"
/>
</view>