Merge branch 'develop' into bugfix
Showing
9 changed files
with
72 additions
and
27 deletions
@@ -3,7 +3,6 @@ | @@ -3,7 +3,6 @@ | ||
3 | * @author: xuqi<qi.xu@yoho.cn> | 3 | * @author: xuqi<qi.xu@yoho.cn> |
4 | * @date: 2015/10/20 | 4 | * @date: 2015/10/20 |
5 | */ | 5 | */ |
6 | - | ||
7 | var $ = require('yoho.zepto'), | 6 | var $ = require('yoho.zepto'), |
8 | Swiper = require('yoho.iswiper'), | 7 | Swiper = require('yoho.iswiper'), |
9 | lazyLoad = require('yoho.zeptolazyload'); | 8 | lazyLoad = require('yoho.zeptolazyload'); |
@@ -244,6 +244,7 @@ function search(opt) { | @@ -244,6 +244,7 @@ function search(opt) { | ||
244 | lazyLoad($('.lazy')); | 244 | lazyLoad($('.lazy')); |
245 | 245 | ||
246 | filter.registerCbFn(search); | 246 | filter.registerCbFn(search); |
247 | + | ||
247 | // loading.initLoadingMask(); | 248 | // loading.initLoadingMask(); |
248 | 249 | ||
249 | //导航栏点击逻辑说明: | 250 | //导航栏点击逻辑说明: |
@@ -273,7 +274,6 @@ $listNav.delegate('li', 'tap', function() { | @@ -273,7 +274,6 @@ $listNav.delegate('li', 'tap', function() { | ||
273 | 274 | ||
274 | $pre.removeClass('active'); | 275 | $pre.removeClass('active'); |
275 | $this.addClass('active'); | 276 | $this.addClass('active'); |
276 | - | ||
277 | filter.showFilter(); | 277 | filter.showFilter(); |
278 | } | 278 | } |
279 | } else { | 279 | } else { |
1 | .discount-page { | 1 | .discount-page { |
2 | - background-color: #f0f0f0; | 2 | + background-color: #fff; |
3 | 3 | ||
4 | .swiper-container { | 4 | .swiper-container { |
5 | width: 100%; | 5 | width: 100%; |
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | 23 | ||
24 | .banner-top-single{ | 24 | .banner-top-single{ |
25 | width: 100%; | 25 | width: 100%; |
26 | - height: 240rem / $pxConvertRem; | 26 | + height: 200rem / $pxConvertRem; |
27 | img { | 27 | img { |
28 | display: block; | 28 | display: block; |
29 | height: 100%; | 29 | height: 100%; |
@@ -32,6 +32,7 @@ | @@ -32,6 +32,7 @@ | ||
32 | } | 32 | } |
33 | 33 | ||
34 | .list-nav { | 34 | .list-nav { |
35 | + border:1px solid #e6e6e6; | ||
35 | > li { | 36 | > li { |
36 | float: left; | 37 | float: left; |
37 | width: 25%; | 38 | width: 25%; |
@@ -50,9 +51,14 @@ | @@ -50,9 +51,14 @@ | ||
50 | } | 51 | } |
51 | 52 | ||
52 | .active > a { | 53 | .active > a { |
53 | - border-bottom: 2px solid #000; | ||
54 | color: #000; | 54 | color: #000; |
55 | - | 55 | + .spanTest{ |
56 | + width: auto; | ||
57 | + height: 100%; | ||
58 | + border-bottom: 2px solid #000; | ||
59 | + display: inline-block; | ||
60 | + box-sizing:border-box; | ||
61 | + } | ||
56 | .iconfont { | 62 | .iconfont { |
57 | color: #999; | 63 | color: #999; |
58 | 64 |
1 | +{{> filter}} |
@@ -7,13 +7,13 @@ | @@ -7,13 +7,13 @@ | ||
7 | <ul id="list-nav" class="list-nav clearfix"> | 7 | <ul id="list-nav" class="list-nav clearfix"> |
8 | <li class="new active"> | 8 | <li class="new active"> |
9 | <a href="javascript:void(0);"> | 9 | <a href="javascript:void(0);"> |
10 | - 最新 | 10 | + <span class="spanTest">最新</span> |
11 | <span class="iconfont cur"></span> | 11 | <span class="iconfont cur"></span> |
12 | </a> | 12 | </a> |
13 | </li> | 13 | </li> |
14 | <li class="price"> | 14 | <li class="price"> |
15 | <a href="javascript:void(0);"> | 15 | <a href="javascript:void(0);"> |
16 | - 价格 | 16 | + <span class="spanTest">价格</span> |
17 | <span class="icon"> | 17 | <span class="icon"> |
18 | <i class="iconfont up"></i> | 18 | <i class="iconfont up"></i> |
19 | <i class="iconfont down cur"></i> | 19 | <i class="iconfont down cur"></i> |
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | </li> | 22 | </li> |
23 | <li class="discount"> | 23 | <li class="discount"> |
24 | <a href="javascript:void(0);"> | 24 | <a href="javascript:void(0);"> |
25 | - 折扣 | 25 | + <span class="spanTest">折扣</span> |
26 | <span class="icon"> | 26 | <span class="icon"> |
27 | <i class="iconfont up"></i> | 27 | <i class="iconfont up"></i> |
28 | <i class="iconfont down cur"></i> | 28 | <i class="iconfont down cur"></i> |
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | </li> | 31 | </li> |
32 | <li class="filter"> | 32 | <li class="filter"> |
33 | <a href="javascript:void(0);"> | 33 | <a href="javascript:void(0);"> |
34 | - 筛选 | 34 | + <span class="spanTest">筛选</span> |
35 | <span class="iconfont"></span> | 35 | <span class="iconfont"></span> |
36 | </a> | 36 | </a> |
37 | </li> | 37 | </li> |
@@ -203,20 +203,9 @@ class SearchController extends AbstractAction | @@ -203,20 +203,9 @@ class SearchController extends AbstractAction | ||
203 | 203 | ||
204 | // 转换排序方式 | 204 | // 转换排序方式 |
205 | $page = $this->get('page', 1); | 205 | $page = $this->get('page', 1); |
206 | - $order = $this->get('order', 0); | 206 | + $orderVal = $this->get('order', 0); |
207 | $type = $this->get('type', ''); | 207 | $type = $this->get('type', ''); |
208 | - switch ($type) { | ||
209 | - case 'price': | ||
210 | - $order = ($order == 0) ? 's_p_desc' : 's_p_asc'; | ||
211 | - break; | ||
212 | - case 'discount': | ||
213 | - $order = ($order == 0) ? 'p_d_desc' : 'p_d_asc'; | ||
214 | - break; | ||
215 | - case 'newest': | ||
216 | - default: | ||
217 | - $order = ($order == 0) ? 's_t_desc' : 's_t_asc'; | ||
218 | - break; | ||
219 | - } | 208 | + $order = Helpers::transOrder($orderVal, $type); |
220 | 209 | ||
221 | $data = array(); | 210 | $data = array(); |
222 | // 查询品类或品牌数据 | 211 | // 查询品类或品牌数据 |
@@ -258,6 +247,56 @@ class SearchController extends AbstractAction | @@ -258,6 +247,56 @@ class SearchController extends AbstractAction | ||
258 | } | 247 | } |
259 | 248 | ||
260 | /** | 249 | /** |
250 | + * Ajax异步获取筛选数据 | ||
251 | + * @return array 筛选数据 | ||
252 | + */ | ||
253 | + public function filterAction() | ||
254 | + { | ||
255 | + if ($this->isAjax()) { | ||
256 | + // 过滤请求参数 | ||
257 | + $condition = filter_input_array(INPUT_GET, array( | ||
258 | + 'query' => FILTER_DEFAULT, | ||
259 | + 'brand' => FILTER_VALIDATE_INT, | ||
260 | + 'sort' => FILTER_DEFAULT, | ||
261 | + 'msort' => FILTER_VALIDATE_INT, | ||
262 | + 'misort' => FILTER_VALIDATE_INT, | ||
263 | + 'color' => FILTER_VALIDATE_INT, | ||
264 | + 'size' => FILTER_VALIDATE_INT, | ||
265 | + 'price' => FILTER_VALIDATE_INT, | ||
266 | + 'discount' => FILTER_DEFAULT, | ||
267 | + 'gender' => FILTER_DEFAULT, | ||
268 | + 'p_d' => FILTER_DEFAULT,), false); | ||
269 | + | ||
270 | + if (isset($condition['sort'])) { | ||
271 | + $condition['sort'] = rawurldecode($condition['sort']); | ||
272 | + } | ||
273 | + if (isset($condition['discount'])) { | ||
274 | + $condition['p_d'] = rawurldecode($condition['discount']); | ||
275 | + unset($condition['discount']); | ||
276 | + } | ||
277 | + if (isset($condition['gender'])) { | ||
278 | + $condition['gender'] = rawurldecode($condition['gender']); | ||
279 | + } | ||
280 | + | ||
281 | + $data = array(); | ||
282 | + $listData = SearchData::searchByCondition($condition); | ||
283 | + // 处理返回的数据 | ||
284 | + if (isset($listData['data']) && isset($listData['data']['filter'])) { | ||
285 | + $data['filter'] = ListProcess::getFilterData($listData['data']['filter']); | ||
286 | + } | ||
287 | + $listData = array(); | ||
288 | + | ||
289 | + if (empty($data)) { | ||
290 | + echo ' '; | ||
291 | + } else { | ||
292 | + $this->_view->display('filter', $data); | ||
293 | + } | ||
294 | + } else { | ||
295 | + echo ' '; | ||
296 | + } | ||
297 | + } | ||
298 | + | ||
299 | + /** | ||
261 | * 模糊搜索指定字符 | 300 | * 模糊搜索指定字符 |
262 | * | 301 | * |
263 | * @return array 模糊搜索的结果 | 302 | * @return array 模糊搜索的结果 |
-
Please register or login to post a comment