brandSearch.ttml
2.7 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
57
58
59
60
61
62
<view class="searchContainer">
<view class="search">
<image class="serachIcon" src="../index/images/home_search@2x.png"></image>
<input class="serachInput" placeholder="搜索结果" bindinput="inputChanged" bindfocus="focusChanged" bindconfirm="inputConfirmed" placeholder-class="placeholder" auto-focus/>
</view>
<text class="cancelButton" bindtap="cancelSearch">取消</text>
</view>
<view class="searchResult">
<block tt:if="{{showResult}}">
<view class='NoResult' tt:if="{{!hasResult}}">无结果</view>
<block tt:for="{{result}}" tt:key="{{index}}" tt:for-item="item">
<view id="{{index == '0-9' ? 'last' : index}}" class='search_sessionTitle'>
<text class='search_sessionText'>{{index == '0-9' ? '0' : index}}</text>
</view>
<block tt:for="{{item}}" tt:key="{{unique}}" tt:for-item="item">
<view class='search_row' tt:if="{{item.type == 2}}" bindtap="search_brandItemTapped" data-brand-item="{{item}}">
<view class='search_rowContent'>
<text class='search_title'>{{item.brand_name}}</text>
<view class='search_new' tt:if="{{item.is_show_new == 'Y'}}">
<text class='search_text'>NEW</text>
</view>
<view class='search_hot' tt:if="{{item.is_hot == 'Y'}}">
<text class='search_text'>HOT</text>
</view>
</view>
<view class='search_spaceLine'/>
</view>
</block>
</block>
</block>
<block tt:else>
<view class="searchHistoryContainer" hidden="{{(searchHistory.length > 0) ? false : true}}">
<text class="hotKeyword">最近搜索</text>
<image class='deleteButton' bindtap='clearSearchHistory' src='../search/images/rubbish-ic@2x.png'></image>
<view class="hotKeywordItemContainer">
<block tt:for="{{searchHistory}}" tt:key="{{index}}">
<view class="hotKeywordItem" bindtap="historyKeywordItemTapped" data-item="{{item}}">
<text class="hotKeywordTitle">{{item.brand_name}}</text>
</view>
</block>
</view>
</view>
<view class='hotHistorySeparator' hidden="{{(searchHistory.length > 0) ? false : true}}"></view>
<view class="hotKeywordContainer">
<text class="hotKeyword">热门搜索</text>
<view class="hotKeywordItemContainer">
<block tt:for="{{hotKeyword['data']}}" tt:key="{{index}}">
<view class="hotKeywordItem" bindtap="hotKeywordItemTapped" data-item="{{item}}">
<text class="hotKeywordTitle">{{item.brandName}}</text>
</view>
</block>
</view>
</view>
</block>
</view>