search.wxml
1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<view class="searchContainer">
<!-- 头部搜索区域 -->
<view class="header">
<view class="searchInput">
<text class="iconfont icon-search1 searchIcon"></text>
<input type="text" value="{{searchContent}}" placeholder="{{placeholderContent}}" placeholder-class="placeholder" bindinput="handleInputChange"/>
<text class="clear" bindtap="clearSearchContent" hidden="{{!searchContent}}">X</text>
</view>
<text class="cancel">취소</text>
</view>
<block wx:if='{{searchList.length}}'>
<!-- 搜索内容展示 -->
<view class="showSearchContent">
<view class="searchContent">검색 내용: {{searchContent}}</view>
<view class="searchList">
<view class="searchItem" wx:for="{{searchList}}" wx:key="id">
<text class="iconfont icon-search1"></text>
<text class="content">{{item.name}}</text>
</view>
</view>
</view>
</block>
<block wx:else>
<!-- 搜索历史记录 -->
<view class="history" wx:if="{{historyList.length}}">
<view class="title">History</view>
<view class="historyItem" wx:for="{{historyList}}" wx:key="{{item}}">
{{item}}
</view>
<!-- 删除 -->
<text class="iconfont icon-shanchu delete" bindtap="deleteSearchHistory"></text>
</view>
<!-- 热搜榜 -->
<view class="hotContainer">
<view class="title">Hot search list</view>
<!-- 热搜列表 -->
<view class="hotList">
<view class="hotItem" wx:for="{{hotList}}" wx:key="searchWord">
<text class="order">{{index + 1}}</text>
<text>{{item.searchWord}}</text>
<image class="iconImg" wx:if="{{item.iconUrl}}" src="{{item.iconUrl}}"></image>
</view>
</view>
</view>
</block>
</view>