Authored by 郝肖肖

筛选性别,默认图

... ... @@ -357,7 +357,8 @@ class Helpers
$imgUrl = isset($images['images_url']) ? $images['images_url'] : '';
$cover1 = isset($images['cover_1']) ? $images['cover_1'] : '';
$cover2 = isset($images['cover_2']) ? $images['cover_2'] : '';
$gender = empty($coverChannel) ? self::getGenderByCookie() : $coverChannel;
//如果选择了所有性别,则取当前频道
$gender = empty($coverChannel) || $coverChannel === '1,2,3' ? self::getGenderByCookie() : $coverChannel;
switch ($gender) {
case '1,3':
... ...
... ... @@ -144,6 +144,10 @@ function getPageGoods(info) {
return;
}
if (info.data && coverChannel) {
info.data.coverChannel = coverChannel;
}
searching = true;
$.ajax({
type: 'GET',
... ... @@ -525,6 +529,10 @@ function search(opt) {
ext = {
gender: opt.id
};
if (coverChannel) {
ext.coverChannel = opt.id;
}
break;
case 'brand':
ext = {
... ... @@ -584,6 +592,12 @@ function search(opt) {
//不需要重新加载并且数据请求结束
return;
}
//封面图,defaultOpt对象也有可能包含coverChannel,但defaultOpt优先级高
if (coverChannel) {
setting.coverChannel = coverChannel;
}
$.extend(setting, defaultOpt, {
type: navType,
order: nav.order,
... ... @@ -598,9 +612,7 @@ function search(opt) {
setting.shop_id = shopId;
}
if (coverChannel) {
setting.coverChannel = coverChannel;
}
searching = true;
loading.showLoadingMask();
... ...
... ... @@ -269,8 +269,6 @@ class SearchModel
$gender = '1,2,3';
if (isset($condition['gender']) && !empty($condition['gender'])) {
$gender = $condition['gender'];
} else if (!empty($condition['coverChannel'])) {
$gender = $condition['coverChannel'];
}
// 区别各种列表页面的筛选数据
... ... @@ -337,8 +335,7 @@ class SearchModel
'ageLevel' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,
'students' => FILTER_DEFAULT,
'filter_poolId' => FILTER_DEFAULT,
'coverChannel' => FILTER_DEFAULT
'filter_poolId' => FILTER_DEFAULT
), false);
// 转义分类
... ...
... ... @@ -496,8 +496,7 @@ class IndexController extends AbstractAction
'shop_id' => $shopId,
'gender' => empty($data['gender']) ? '' : $data['gender'],
'channel' => empty($data['channel']) ? '' : $data['channel'],
'brand' => empty($data['brand']) ? '' : $data['brand'],
'coverChannel' => $coverChannel
'brand' => empty($data['brand']) ? '' : $data['brand']
));
$data['filter'] = isset($filter['filter']) ? $filter['filter'] : array();
... ...