Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
7 changed files
with
66 additions
and
25 deletions
@@ -272,7 +272,6 @@ $listNav.delegate('li', 'tap', function() { | @@ -272,7 +272,6 @@ $listNav.delegate('li', 'tap', function() { | ||
272 | 272 | ||
273 | $pre.removeClass('active'); | 273 | $pre.removeClass('active'); |
274 | $this.addClass('active'); | 274 | $this.addClass('active'); |
275 | - | ||
276 | filter.showFilter(); | 275 | filter.showFilter(); |
277 | } | 276 | } |
278 | } else { | 277 | } else { |
1 | .newarrival-page { | 1 | .newarrival-page { |
2 | - background-color: #f0f0f0; | 2 | + background-color: #fff; |
3 | 3 | ||
4 | .swiper-container { | 4 | .swiper-container { |
5 | width: 100%; | 5 | width: 100%; |
6 | - height: 200rem / $pxConvertRem; | 6 | + height: 310rem / $pxConvertRem; |
7 | 7 | ||
8 | img { | 8 | img { |
9 | height: 100%; | 9 | 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%; |
@@ -39,12 +40,13 @@ | @@ -39,12 +40,13 @@ | ||
39 | line-height: 33px; | 40 | line-height: 33px; |
40 | text-align: center; | 41 | text-align: center; |
41 | font-size: 14px; | 42 | font-size: 14px; |
43 | + color: #999; | ||
42 | } | 44 | } |
43 | 45 | ||
44 | a { | 46 | a { |
45 | - display: block; | 47 | + display: inline-block; |
46 | box-sizing: border-box; | 48 | box-sizing: border-box; |
47 | - width: 100%; | 49 | + width: auto; |
48 | height: 100%; | 50 | height: 100%; |
49 | color: #999; | 51 | color: #999; |
50 | } | 52 | } |
@@ -52,15 +54,14 @@ | @@ -52,15 +54,14 @@ | ||
52 | .active > a { | 54 | .active > a { |
53 | border-bottom: 2px solid #000; | 55 | border-bottom: 2px solid #000; |
54 | color: #000; | 56 | color: #000; |
55 | - | ||
56 | - .iconfont { | ||
57 | - color: #999; | ||
58 | - | 57 | + box-sizing:border-box; |
58 | + } | ||
59 | + .active > .iconfont { | ||
60 | + color: #000; | ||
59 | &.cur { | 61 | &.cur { |
60 | color: #000; | 62 | color: #000; |
61 | } | 63 | } |
62 | } | 64 | } |
63 | - } | ||
64 | 65 | ||
65 | .filter .iconfont { | 66 | .filter .iconfont { |
66 | font-size: 12px; | 67 | font-size: 12px; |
1 | +{{> filter}} |
@@ -22,8 +22,8 @@ | @@ -22,8 +22,8 @@ | ||
22 | <li class="filter"> | 22 | <li class="filter"> |
23 | <a href="javascript:void(0);"> | 23 | <a href="javascript:void(0);"> |
24 | 筛选 | 24 | 筛选 |
25 | - <span class="iconfont"></span> | ||
26 | </a> | 25 | </a> |
26 | + <span class="iconfont"></span> | ||
27 | </li> | 27 | </li> |
28 | </ul> | 28 | </ul> |
29 | 29 |
@@ -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