Authored by ccbikai

Merge branch 'develop' into bugfix

... ... @@ -3,7 +3,6 @@
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/20
*/
var $ = require('yoho.zepto'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.zeptolazyload');
... ...
... ... @@ -244,6 +244,7 @@ function search(opt) {
lazyLoad($('.lazy'));
filter.registerCbFn(search);
// loading.initLoadingMask();
//导航栏点击逻辑说明:
... ... @@ -273,7 +274,6 @@ $listNav.delegate('li', 'tap', function() {
$pre.removeClass('active');
$this.addClass('active');
filter.showFilter();
}
} else {
... ...
... ... @@ -2,7 +2,7 @@
position: absolute;
left: 0;
right: 0;
top: 0;
top: 2px;
}
.filter-mask {
... ...
.good-info {
float: left;
width: 44%;
width: 46.4%;
height: 486rem / $pxConvertRem;
margin: 28rem / $pxConvertRem 3% 0;
margin: 28rem / $pxConvertRem 0 0 2.4%;
.tag-container {
... ...
.discount-page {
background-color: #f0f0f0;
background-color: #fff;
.swiper-container {
width: 100%;
... ... @@ -23,7 +23,7 @@
.banner-top-single{
width: 100%;
height: 240rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
img {
display: block;
height: 100%;
... ... @@ -32,6 +32,7 @@
}
.list-nav {
border:1px solid #e6e6e6;
> li {
float: left;
width: 25%;
... ... @@ -50,9 +51,14 @@
}
.active > a {
border-bottom: 2px solid #000;
color: #000;
.spanTest{
width: auto;
height: 100%;
border-bottom: 2px solid #000;
display: inline-block;
box-sizing:border-box;
}
.iconfont {
color: #999;
... ...
... ... @@ -3,7 +3,7 @@
.swiper-container {
width: 100%;
height: 200rem / $pxConvertRem;
height: 310rem / $pxConvertRem;
img {
height: 100%;
... ...
{{> filter}}
\ No newline at end of file
... ...
... ... @@ -7,13 +7,13 @@
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
最新
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
价格
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
... ... @@ -22,7 +22,7 @@
</li>
<li class="discount">
<a href="javascript:void(0);">
折扣
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
... ... @@ -31,7 +31,7 @@
</li>
<li class="filter">
<a href="javascript:void(0);">
筛选
<span class="spanTest">筛选</span>
<span class="iconfont">&#xe613;</span>
</a>
</li>
... ...
... ... @@ -203,20 +203,9 @@ class SearchController extends AbstractAction
// 转换排序方式
$page = $this->get('page', 1);
$order = $this->get('order', 0);
$orderVal = $this->get('order', 0);
$type = $this->get('type', '');
switch ($type) {
case 'price':
$order = ($order == 0) ? 's_p_desc' : 's_p_asc';
break;
case 'discount':
$order = ($order == 0) ? 'p_d_desc' : 'p_d_asc';
break;
case 'newest':
default:
$order = ($order == 0) ? 's_t_desc' : 's_t_asc';
break;
}
$order = Helpers::transOrder($orderVal, $type);
$data = array();
// 查询品类或品牌数据
... ... @@ -258,6 +247,56 @@ class SearchController extends AbstractAction
}
/**
* Ajax异步获取筛选数据
* @return array 筛选数据
*/
public function filterAction()
{
if ($this->isAjax()) {
// 过滤请求参数
$condition = filter_input_array(INPUT_GET, array(
'query' => FILTER_DEFAULT,
'brand' => FILTER_VALIDATE_INT,
'sort' => FILTER_DEFAULT,
'msort' => FILTER_VALIDATE_INT,
'misort' => FILTER_VALIDATE_INT,
'color' => FILTER_VALIDATE_INT,
'size' => FILTER_VALIDATE_INT,
'price' => FILTER_VALIDATE_INT,
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
if (isset($condition['sort'])) {
$condition['sort'] = rawurldecode($condition['sort']);
}
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
unset($condition['discount']);
}
if (isset($condition['gender'])) {
$condition['gender'] = rawurldecode($condition['gender']);
}
$data = array();
$listData = SearchData::searchByCondition($condition);
// 处理返回的数据
if (isset($listData['data']) && isset($listData['data']['filter'])) {
$data['filter'] = ListProcess::getFilterData($listData['data']['filter']);
}
$listData = array();
if (empty($data)) {
echo ' ';
} else {
$this->_view->display('filter', $data);
}
} else {
echo ' ';
}
}
/**
* 模糊搜索指定字符
*
* @return array 模糊搜索的结果
... ...