search.wxml
5.62 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!--search.wxml-->
<import src="../goodsList/categoryProductListFilter.wxml"/>
<view class="sContainer">
<view class="searchContainer">
<view class="search">
<image class="serachIcon" src="../index/images/home_search@2x.png"></image>
<input class="serachInput" value="{{keyword}}" placeholder="潮流单品搜一下" bindinput="inputChanged" bindfocus="focusChanged" bindconfirm="inputConfirmed" placeholder-class="placeholder" auto-focus/>
</view>
<!-- <text class="cancelButton" bindtap="cancelSearch">取消</text> -->
</view>
<view class="hotKeywordContainer" hidden="{{status == 0 ? false : true}}">
<text class="hotKeyword">热门搜索</text>
<view class="hotKeywordItemContainer">
<block wx:for="{{hotKeyword['data']}}" wx:key="{{index}}">
<view class="hotKeywordItem" bindtap="hotKeywordItemTapped" data-keyword="{{item.content}}">
<text class="hotKeywordTitle">{{item.content}}</text>
</view>
</block>
</view>
</view>
<view class='hotHistorySeparator' hidden="{{(searchHistory.length > 0) ? false : true}}"></view>
<view class="searchHistoryContainer" hidden="{{(searchHistory.length > 0 && status == 0) ? false : true}}">
<text class="hotKeyword">最近搜索</text>
<image class='deleteButton' bindtap='clearSearchHistory' src='./images/rubbish-ic@2x.png'></image>
<view class="hotKeywordItemContainer">
<block wx:for="{{searchHistory}}" wx:key="{{index}}">
<view class="hotKeywordItem" bindtap="hotKeywordItemTapped" data-keyword="{{item}}">
<text class="hotKeywordTitle">{{item}}</text>
</view>
</block>
</view>
</view>
<view class="fuzzySearchContainer" style="height:{{windowHeight-44}}px;" hidden="{{status == 1 ? false : true}}">
<block wx:for="{{fuzzySearch['data']}}" wx:key="{{index}}">
<view class="fuzzySearchItem" bindtap="fuzzySearchItemTapped" data-keyword="{{item.keyword}}">
<text class="fuzzySearchTitle" style="max-width:{{0.6*windowWidth}}px">{{item.keyword}}</text>
<view class="fuzzySearchRight">
<text class="fuzzySearchCount" style="max-width:{{0.3*windowWidth}}px">{{item.count + ' items'}}</text>
<image class="fuzzySearchArrow" src="./images/arrow@2x.png"></image>
</view>
</view>
</block>
</view>
<view hidden="{{status == 2 ? false : true}}">
<view class="fixedFilter">
<FilterComponent id='filterComponent' isResetFilter="{{resetFilter}}" bind:updateProductList="updateProductList" bind:jumpToFilterPage="jumpToFilterPage"></FilterComponent>
</view>
<block wx:if="{{list.data.length == 0}}">
<view class='noContentClass' style='height:{{windowHeight}}px;'>
<image class='nosearch-ic' src="images/nosearch-ic@3x.png"></image>
<view class='noContent'>未搜索到任何相关商品</view>
</view>
</block>
<block wx:elif="{{isChangedQuery}}">
<view class='emptyClass'>
<text class="suggestionText">
没有找到相关商品,为您推荐“{{suggestion_query}}”的搜索结果或者试试
</text>
<block wx:for="{{terms_suggestion}}" wx:key="unique">
<text wx:if="{{suggestion_query != item}}" class="suggestionCell" bindtap="hotKeywordItemTapped"data-keyword="{{item}}">{{item}}</text>
</block>
</view>
<view class="productListContainerForEmpty">
<block wx:for="{{list.data}}" wx:key="{{index}}">
<productListCell item="{{item}}" page-name="searchResult" page-param="{{keyword}}"></productListCell>
</block>
</view>
</block>
<block wx:elif="{{list.data.length < 20 && terms_suggestion.length > 0}}">
<view class='emptyClass'>
<text class="suggestionText">
相关商品太少了,试试
</text>
<block wx:for="{{terms_suggestion}}" wx:key="unique">
<text wx:if="{{suggestion_query != item}}" class="suggestionCell" bindtap="hotKeywordItemTapped"data-keyword="{{item}}">{{item}}</text>
</block>
</view>
<view class="productListContainerForEmpty">
<block wx:for="{{list.data}}" wx:key="{{index}}">
<productListCell item="{{item}}" page-name="searchResult" page-param="{{keyword}}"></productListCell>
</block>
</view>
</block>
<block wx:else>
<view class="productListContainer">
<block wx:for="{{list.data}}" wx:key="{{index}}">
<productListCell item="{{item}}" page-name="searchResult" page-param="{{keyword}}"></productListCell>
</block>
</view>
</block>
<view class="loadMore" wx:if="{{list.data.length > 0 && list.isLoading && !list.endReached}}">
<text class="loadText">加载中...</text>
</view>
<view class="loadMore" wx:if="{{list.endReached}}">
<text class="loadText">没有更多了</text>
</view>
<loading wx:if="{{list.currentPage == 0 && list.isLoading}}">加载中</loading>
</view>
</view>
<quickNavigation id="quickNavigation" isShowIndicator="{{isShowIndicator}}" isShowMenu="{{true}}" bind:backToTop="backToTop" isUnionShare="{{status==2 && keyword && isUnionShare}}" bind:unionShare="unionShare"></quickNavigation>