search.wxml
2.6 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
50
51
52
53
54
55
56
<!--pages/service/renting/search/search.wxml-->
<view class="container">
<view class="head_search_box">
<view class="input">
<image src="../../images/search@2x.png"></image>
<input placeholder='请输入搜索相关内容' bindfocus="inputFocus" bindinput="inputKey" value="{{searchValue}}" bindconfirm="startSearch" placeholder-class='input_size'/>
<!--<view class="iconfont icon-jia1 jia1" catchtap="clearInput"></view>-->
</view>
<view class="search-text" bindtap="startSearch">搜索</view>
</view>
<view class="history_box" wx:if="{{postList.length<=0}}">
<view class="head">
<view class="title">热门搜索</view>
</view>
<view class="history_list {{hot.length === 0?'text-center':''}}">
<text wx:if="{{hot.length === 0}}">暂无热门搜索~</text>
<view wx:elseif wx:for="{{hot}}" wx:key="index" bindtap="clickHot" data-index="{{index}}">{{item.title}}</view>
</view>
</view>
<view class="history_box history" wx:if="{{postList.length<=0}}">
<view class="head">
<view class="title">搜索历史</view>
<view class="clear" bindtap="clearHistory">
<view class="iconfont icon-shanchu"></view>
<text>清空历史记录</text>
</view>
</view>
<view class="history_list {{history.length === 0?'text-center':''}}">
<text wx:if="{{history.length === 0}}">暂无搜索历史~</text>
<view wx:elseif wx:for="{{history}}" wx:key="index" bindtap="clickHistory" data-index="{{index}}">{{item.title}}</view>
</view>
</view>
<!--文章内容-->
<view class='content_box post_box' wx:if="{{postList.length > 0}}">
<!--<view class="no-data" wx:if="{{postList.length === 0}}">暂无内容</view>-->
<view class='content_item' wx:for="{{postList}}" wx:key="index" bindtap='goPostDetail'
data-id="{{item.id}}" data-type="{{item.type}}">
<!--<image src="../../images/lishi@2x.png" class="thumb"></image>-->
<image src="{{item.pic}}" class="thumb"></image>
<view class="lish-right">
<view class="title">{{item.name}}</view>
<view class="time">{{item.time}}</view>
<view class="name-box">
<!--<image src="../../images/avatar@2x.png" class="avatar"></image>-->
<image src="{{item.userPic}}" class="avatar"></image>
<text>{{item.userName}}</text>
</view>
</view>
</view>
</view>
</view>