Authored by 阿达

当搜索不到时,隐藏部分filter

@@ -21,270 +21,272 @@ @@ -21,270 +21,272 @@
21 {{/if}} 21 {{/if}}
22 {{/ checkedConditions}} 22 {{/ checkedConditions}}
23 23
24 - {{#if channel}}  
25 - <div class="channel section">  
26 - <span class="title">频道:</span> 24 + {{#if ../goods}}
  25 + {{#if channel}}
  26 + <div class="channel section">
  27 + <span class="title">频道:</span>
27 28
28 - <div class="attr-content clearfix">  
29 - {{#each channel}}  
30 - <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">  
31 - {{name}}  
32 - </a>  
33 - {{/each}}  
34 - </div>  
35 - </div>  
36 - {{/if}}  
37 -  
38 - {{#if gender}}  
39 - <div class="channel section">  
40 - <span class="title">性别:</span>  
41 -  
42 - <div class="attr-content clearfix">  
43 - {{#each gender}}  
44 - <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">  
45 - {{name}}  
46 - </a>  
47 - {{/each}} 29 + <div class="attr-content clearfix">
  30 + {{#each channel}}
  31 + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">
  32 + {{name}}
  33 + </a>
  34 + {{/each}}
  35 + </div>
48 </div> 36 </div>
49 - </div>  
50 - {{/if}} 37 + {{/if}}
51 38
52 - {{#if sort}}  
53 - <div class="sort section">  
54 - <span class="title">分类:</span> 39 + {{#if gender}}
  40 + <div class="channel section">
  41 + <span class="title">性别:</span>
55 42
56 - <div class="attr-content">  
57 - <ul class="sort-pre clearfix">  
58 - {{#each sort}}  
59 - <li data-id="{{id}}">  
60 - <span class="attr {{#if checked}}checked{{/if}}">  
61 - {{name}}  
62 - <div class="sort-up-icon"></div>  
63 - </span>  
64 - </li>  
65 - {{/each}}  
66 - </ul>  
67 -  
68 - <div class="sort-sub-wrap">  
69 - {{#each sort}}  
70 - <ul class="sort-sub clearfix hide">  
71 - {{#each sub}}  
72 - <li class="attr {{#if checked}}checked{{/if}}">  
73 - <a href="{{href}}">{{name}}</a>  
74 - </li>  
75 - {{/each}}  
76 - </ul> 43 + <div class="attr-content clearfix">
  44 + {{#each gender}}
  45 + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">
  46 + {{name}}
  47 + </a>
77 {{/each}} 48 {{/each}}
78 </div> 49 </div>
79 </div> 50 </div>
80 - </div>  
81 - {{/if}}  
82 -  
83 - {{! 小分类}}  
84 - {{#if misort}}  
85 - <div class="misort section">  
86 - <span class="title">品类:</span> 51 + {{/if}}
87 52
88 - <div class="attr-content clearfix">  
89 - {{#each misort}}  
90 - <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">  
91 - {{name}}  
92 - </a>  
93 - {{/each}} 53 + {{#if sort}}
  54 + <div class="sort section">
  55 + <span class="title">分类:</span>
  56 +
  57 + <div class="attr-content">
  58 + <ul class="sort-pre clearfix">
  59 + {{#each sort}}
  60 + <li data-id="{{id}}">
  61 + <span class="attr {{#if checked}}checked{{/if}}">
  62 + {{name}}
  63 + <div class="sort-up-icon"></div>
  64 + </span>
  65 + </li>
  66 + {{/each}}
  67 + </ul>
  68 +
  69 + <div class="sort-sub-wrap">
  70 + {{#each sort}}
  71 + <ul class="sort-sub clearfix hide">
  72 + {{#each sub}}
  73 + <li class="attr {{#if checked}}checked{{/if}}">
  74 + <a href="{{href}}">{{name}}</a>
  75 + </li>
  76 + {{/each}}
  77 + </ul>
  78 + {{/each}}
  79 + </div>
  80 + </div>
94 </div> 81 </div>
95 - </div>  
96 - {{/if}} 82 + {{/if}}
  83 +
  84 + {{! 小分类}}
  85 + {{#if misort}}
  86 + <div class="misort section">
  87 + <span class="title">品类:</span>
97 88
98 - {{# brand}}  
99 - <div class="brand section">  
100 - <span class="title">品牌:</span>  
101 -  
102 - <div class="attr-content">  
103 - <ul class="default clearfix">  
104 - {{# default}}  
105 - <li class="attr {{#if checked}}checked{{/if}}">  
106 - <a href="{{href}}" title="{{name}}">{{name}}</a>  
107 - </li>  
108 - {{/ default}}  
109 - </ul>  
110 -  
111 - <div class="brand-opt">  
112 - {{#if showMore}}  
113 - <span id="brand-more" class="brand-more">  
114 - <em>更多</em>  
115 - <i class="iconfont">&#xe60b;</i>  
116 - </span>  
117 - {{/if}}  
118 -  
119 - {{#if showMulti}}  
120 - <span id="brand-multi" class="multi-select">多选 +</span>  
121 - {{/if}} 89 + <div class="attr-content clearfix">
  90 + {{#each misort}}
  91 + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">
  92 + {{name}}
  93 + </a>
  94 + {{/each}}
122 </div> 95 </div>
  96 + </div>
  97 + {{/if}}
123 98
124 - <div class="brand-panel hide">  
125 - <div class="panel-head clearfix">  
126 - <p class="brands-index">  
127 - {{#each brandIndex}}  
128 - <span data-index="{{index}}">{{name}}</span>  
129 - {{/each}}  
130 - </p>  
131 -  
132 - <div class="brand-search">  
133 - <input id="brand-search-input" type="text">  
134 - <span class="btn">  
135 - <i class="iconfont">&#xe60f;</i> 99 + {{# brand}}
  100 + <div class="brand section">
  101 + <span class="title">品牌:</span>
  102 +
  103 + <div class="attr-content">
  104 + <ul class="default clearfix">
  105 + {{# default}}
  106 + <li class="attr {{#if checked}}checked{{/if}}">
  107 + <a href="{{href}}" title="{{name}}">{{name}}</a>
  108 + </li>
  109 + {{/ default}}
  110 + </ul>
  111 +
  112 + <div class="brand-opt">
  113 + {{#if showMore}}
  114 + <span id="brand-more" class="brand-more">
  115 + <em>更多</em>
  116 + <i class="iconfont">&#xe60b;</i>
136 </span> 117 </span>
137 - </div> 118 + {{/if}}
  119 +
  120 + {{#if showMulti}}
  121 + <span id="brand-multi" class="multi-select">多选 +</span>
  122 + {{/if}}
138 </div> 123 </div>
139 124
140 - <div class="panel-body">  
141 - <div class="ul-scroll">  
142 - <ul class="check-container clearfix">  
143 - {{# brandsShow}}  
144 - <li class="attr {{#if checked}}checked{{/if}}" data-index="{{index}}" data-key="{{key}}">  
145 - <a href="{{href}}">  
146 - <span class="iconfont checkbox {{#if checked}}checked{{/if}}" data-id="{{id}}">  
147 - {{#if checked}}  
148 - &#xe613;  
149 - {{else}}  
150 - &#xe612;  
151 - {{/if}}  
152 - </span>  
153 - <span title="{{name}}">{{name}}</span>  
154 - </a>  
155 - </li>  
156 - {{/ brandsShow}}  
157 - </ul> 125 + <div class="brand-panel hide">
  126 + <div class="panel-head clearfix">
  127 + <p class="brands-index">
  128 + {{#each brandIndex}}
  129 + <span data-index="{{index}}">{{name}}</span>
  130 + {{/each}}
  131 + </p>
  132 +
  133 + <div class="brand-search">
  134 + <input id="brand-search-input" type="text">
  135 + <span class="btn">
  136 + <i class="iconfont">&#xe60f;</i>
  137 + </span>
  138 + </div>
  139 + </div>
  140 +
  141 + <div class="panel-body">
  142 + <div class="ul-scroll">
  143 + <ul class="check-container clearfix">
  144 + {{# brandsShow}}
  145 + <li class="attr {{#if checked}}checked{{/if}}" data-index="{{index}}" data-key="{{key}}">
  146 + <a href="{{href}}">
  147 + <span class="iconfont checkbox {{#if checked}}checked{{/if}}" data-id="{{id}}">
  148 + {{#if checked}}
  149 + &#xe613;
  150 + {{else}}
  151 + &#xe612;
  152 + {{/if}}
  153 + </span>
  154 + <span title="{{name}}">{{name}}</span>
  155 + </a>
  156 + </li>
  157 + {{/ brandsShow}}
  158 + </ul>
  159 + </div>
158 </div> 160 </div>
159 - </div>  
160 161
161 - <div class="btns">  
162 - <button id="brand-multi-ok" class="multi-select-ok dis">确定</button>  
163 - <button class="multi-select-cancel">取消</button> 162 + <div class="btns">
  163 + <button id="brand-multi-ok" class="multi-select-ok dis">确定</button>
  164 + <button class="multi-select-cancel">取消</button>
  165 + </div>
164 </div> 166 </div>
165 </div> 167 </div>
166 </div> 168 </div>
167 - </div>  
168 - {{/ brand}} 169 + {{/ brand}}
169 170
170 - {{#if price}}  
171 - <div class="price section">  
172 - <span class="title">价格:</span> 171 + {{#if price}}
  172 + <div class="price section">
  173 + <span class="title">价格:</span>
173 174
174 - <div class="attr-content clearfix">  
175 - {{# price}}  
176 - <a class="attr{{#if checked}} checked{{/if}}" href="{{href}}">{{name}}</a>  
177 - {{/ price}} 175 + <div class="attr-content clearfix">
  176 + {{# price}}
  177 + <a class="attr{{#if checked}} checked{{/if}}" href="{{href}}">{{name}}</a>
  178 + {{/ price}}
178 179
179 - <div class="ud-price-range">  
180 - ¥  
181 - <input type="text" class="min limit" value="{{customPrice.min}}">  
182 - <span class="price-sep">-</span>  
183 - <input type="text" class="max limit" value="{{customPrice.max}}"> 180 + <div class="ud-price-range">
  181 + ¥
  182 + <input type="text" class="min limit" value="{{customPrice.min}}">
  183 + <span class="price-sep">-</span>
  184 + <input type="text" class="max limit" value="{{customPrice.max}}">
184 185
185 - <button class="price-sure hide">确定</button> 186 + <button class="price-sure hide">确定</button>
  187 + </div>
186 </div> 188 </div>
187 </div> 189 </div>
188 - </div>  
189 - {{/if}} 190 + {{/if}}
190 191
191 - {{#if discount}}  
192 - <div class="price section">  
193 - <span class="title">折扣:</span> 192 + {{#if discount}}
  193 + <div class="price section">
  194 + <span class="title">折扣:</span>
194 195
195 - <div class="attr-content clearfix">  
196 - {{# discount}}  
197 - <a class="attr{{#if checked}} checked{{/if}}" href="{{href}}">¥{{name}}</a>  
198 - {{/ discount}} 196 + <div class="attr-content clearfix">
  197 + {{# discount}}
  198 + <a class="attr{{#if checked}} checked{{/if}}" href="{{href}}">¥{{name}}</a>
  199 + {{/ discount}}
  200 + </div>
199 </div> 201 </div>
200 - </div>  
201 - {{/if}} 202 + {{/if}}
202 203
203 204
204 - {{#if color}}  
205 - <div class="color section">  
206 - <span class="title">颜色:</span> 205 + {{#if color}}
  206 + <div class="color section">
  207 + <span class="title">颜色:</span>
207 208
208 - <div class="attr-content clearfix">  
209 - {{# color}}  
210 - <a class="attr{{#if checked}} checked{{/if}}" href="{{href}}">  
211 - {{#if checked}}  
212 - <span class="color-block">  
213 - <i class="sub-color-block" style="background: {{rgb}}"></i>  
214 - </span>  
215 - {{^}}  
216 - <i class="color-block" style="background: {{rgb}}"></i>  
217 - {{/if}}  
218 - {{name}}  
219 - </a>  
220 - {{/ color}} 209 + <div class="attr-content clearfix">
  210 + {{# color}}
  211 + <a class="attr{{#if checked}} checked{{/if}}" href="{{href}}">
  212 + {{#if checked}}
  213 + <span class="color-block">
  214 + <i class="sub-color-block" style="background: {{rgb}}"></i>
  215 + </span>
  216 + {{^}}
  217 + <i class="color-block" style="background: {{rgb}}"></i>
  218 + {{/if}}
  219 + {{name}}
  220 + </a>
  221 + {{/ color}}
  222 + </div>
221 </div> 223 </div>
222 - </div>  
223 - {{/if}} 224 + {{/if}}
224 225
225 - <div class="size section {{#unless size}}hide{{/unless}}" {{#if size}}data-load="true"{{/if}}>  
226 - <span class="title">尺码:</span> 226 + <div class="size section {{#unless size}}hide{{/unless}}" {{#if size}}data-load="true"{{/if}}>
  227 + <span class="title">尺码:</span>
227 228
228 - <div class="attr-content clearfix">  
229 - {{# size}}  
230 - <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>  
231 - {{/ size}} 229 + <div class="attr-content clearfix">
  230 + {{# size}}
  231 + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>
  232 + {{/ size}}
  233 + </div>
232 </div> 234 </div>
233 - </div>  
234 -  
235 - {{#if seniorChose}}  
236 - <div class="senior section">  
237 - <span class="title">高级选项:</span>  
238 235
239 - <div class="attr-content">  
240 - <ul class="clearfix senior-attr-wrap">  
241 - {{#each seniorChose}}  
242 - <li class="attr{{#unless sub}} no-sub{{/unless}}"> 236 + {{#if seniorChose}}
  237 + <div class="senior section">
  238 + <span class="title">高级选项:</span>
  239 +
  240 + <div class="attr-content">
  241 + <ul class="clearfix senior-attr-wrap">
  242 + {{#each seniorChose}}
  243 + <li class="attr{{#unless sub}} no-sub{{/unless}}">
  244 + {{#if sub}}
  245 + {{name}}
  246 + <span class="iconfont">&#xe60b;</span>
  247 +
  248 + <div class="senior-up-icon"></div>
  249 + {{^}}
  250 + <a href="{{url}}">{{name}}</a>
  251 + {{/if}}
  252 + </li>
  253 + {{/each}}
  254 + </ul>
  255 +
  256 + <div class="senior-sub-wrap">
  257 + {{#each seniorChose}}
243 {{#if sub}} 258 {{#if sub}}
244 - {{name}}  
245 - <span class="iconfont">&#xe60b;</span>  
246 -  
247 - <div class="senior-up-icon"></div>  
248 - {{^}}  
249 - <a href="{{url}}">{{name}}</a>  
250 - {{/if}}  
251 - </li>  
252 - {{/each}}  
253 - </ul>  
254 -  
255 - <div class="senior-sub-wrap">  
256 - {{#each seniorChose}}  
257 - {{#if sub}}  
258 - <div class="senior-sub hide" data-attr="{{attr}}">  
259 - <div class="senior-baffle"></div>  
260 - <div class="senior-content">  
261 - {{#if showMulti}}  
262 - <span class="multi-select">多选 +</span>  
263 - {{/if}}  
264 - <ul class="clearfix check-container">  
265 - {{#each sub}}  
266 - <li class="attr {{#if checked}}checked{{/if}}">  
267 - <a href="{{href}}">  
268 - {{#if checked}}  
269 - <span class="iconfont checkbox checked" data-id="{{id}}">&#xe613;</span>  
270 - {{^}}  
271 - <span class="iconfont checkbox" data-id="{{id}}">&#xe612;</span>  
272 - {{/if}}  
273 - <span>{{name}}</span>  
274 - </a>  
275 - </li>  
276 - {{/each}}  
277 - </ul>  
278 - <div class="btns">  
279 - <button class="multi-select-ok dis">确定</button>  
280 - <button class="multi-select-cancel">取消</button> 259 + <div class="senior-sub hide" data-attr="{{attr}}">
  260 + <div class="senior-baffle"></div>
  261 + <div class="senior-content">
  262 + {{#if showMulti}}
  263 + <span class="multi-select">多选 +</span>
  264 + {{/if}}
  265 + <ul class="clearfix check-container">
  266 + {{#each sub}}
  267 + <li class="attr {{#if checked}}checked{{/if}}">
  268 + <a href="{{href}}">
  269 + {{#if checked}}
  270 + <span class="iconfont checkbox checked" data-id="{{id}}">&#xe613;</span>
  271 + {{^}}
  272 + <span class="iconfont checkbox" data-id="{{id}}">&#xe612;</span>
  273 + {{/if}}
  274 + <span>{{name}}</span>
  275 + </a>
  276 + </li>
  277 + {{/each}}
  278 + </ul>
  279 + <div class="btns">
  280 + <button class="multi-select-ok dis">确定</button>
  281 + <button class="multi-select-cancel">取消</button>
  282 + </div>
281 </div> 283 </div>
282 </div> 284 </div>
283 - </div>  
284 - {{/if}}  
285 - {{/each}} 285 + {{/if}}
  286 + {{/each}}
  287 + </div>
286 </div> 288 </div>
287 </div> 289 </div>
288 - </div> 290 + {{/if}}
289 {{/if}} 291 {{/if}}
290 </div> 292 </div>