micro_mall_xcx/pages/goods/search/index.wxml
2023-10-26 23:20:48 +08:00

50 lines
2.3 KiB
Plaintext

<view class="search-page">
<t-search t-class-input-container="t-class__input-container" t-class-input="t-search__input" value="{{searchValue}}" leftIcon="" placeholder="请输入关键词" bind:submit="handleSubmit" focus>
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
</t-search>
<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" wx:if="{{historyWords.length > 0}}">
<view class="search-item" hover-class="hover-history-item" wx:for="{{historyWords}}" bind:tap="handleHistoryTap" bindlongpress="deleteCurr" data-index="{{index}}" wx:key="*this">
{{item.historySearchContent}}
</view>
</view>
<view wx:else class="search-item">
暂无数据
</view>
</view>
<view class="popular-wrap">
<view class="search-header">
<text class="search-title">搜索推荐</text>
</view>
<view class="search-content" wx:if="{{popularWords.length > 0}}">
<view class="search-item" hover-class="hover-history-item" wx:for="{{popularWords}}" data-value="{{item.title}}" bind:tap="handleRecTap" data-index="{{index}}" wx:key="*this">
{{item.title}}
</view>
</view>
<view wx:else class="search-item">
暂无数据
</view>
</view>
<!-- <view class="popular-wrap">
<view class="search-header">
<text class="search-title">热门搜索</text>
</view>
<view class="search-content">
<view wx:if="{{popularWords.length > 0}}">
<view class="search-item" hover-class="hover-history-item" wx:for="{{popularWords}}" bind:tap="handleHistoryTap" data-index="{{index}}" wx:key="*this">
{{item.searchTerm}}
</view>
</view>
<view wx:else class="search-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>