...
|
...
|
@@ -8,7 +8,7 @@ use Plugin\Helpers; |
|
|
use Plugin\Cache;
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
*
|
|
|
* @name SideModel
|
|
|
* @package models/Index
|
|
|
* @copyright yoho.inc
|
...
|
...
|
@@ -20,7 +20,7 @@ class SideModel |
|
|
|
|
|
/**
|
|
|
* 获取左侧边栏数据
|
|
|
*
|
|
|
*
|
|
|
* @param string $guangChoosed 逛默认选中项 "all"表示全部,"boys":只看男生,"girls":只看女生
|
|
|
*/
|
|
|
public static function getLeftNav($guangChoosed = 'all')
|
...
|
...
|
@@ -59,12 +59,21 @@ class SideModel |
|
|
|
|
|
// 如果存在子菜单,就输出子菜单
|
|
|
if (isset($value['sub']) && !empty($value['sub'])) {
|
|
|
$subs = array();
|
|
|
$subs = array(
|
|
|
array(
|
|
|
'textCn' => $group[$groupKey]['textCn'],
|
|
|
'textEn' => $group[$groupKey]['textEn'],
|
|
|
'back' => true,
|
|
|
'isSelect' => false,
|
|
|
'bgColor' => self::getSideTopColor($guangChoosed)
|
|
|
)
|
|
|
);
|
|
|
foreach ($value['sub'] as $oneSub) {
|
|
|
$subs[] = self::formatSideItem($oneSub);
|
|
|
}
|
|
|
|
|
|
$group[$groupKey]['subNav'] = $subs;
|
|
|
$group[$groupKey]['styleClass'] = 'guang';
|
|
|
$group[$groupKey]['subNav']['list'] = $subs;
|
|
|
}
|
|
|
$groupKey++;
|
|
|
|
...
|
...
|
@@ -93,13 +102,65 @@ class SideModel |
|
|
|
|
|
/**
|
|
|
* 获取并生成左侧边栏中逛的数据
|
|
|
*
|
|
|
*
|
|
|
* @param string $guangChoosed 逛默认选中项 "all"表示全部,"boys":只看男生,"girls":只看女生
|
|
|
* @return array
|
|
|
*/
|
|
|
private static function genLeftNavGuang($guangChoosed = 'all')
|
|
|
{
|
|
|
// 判断逛的背景色
|
|
|
$color = self::getSideTopColor($guangChoosed);
|
|
|
|
|
|
return
|
|
|
array(
|
|
|
array(
|
|
|
'textCn' => '逛',
|
|
|
'textEn' => 'TRENDFINDER',
|
|
|
'styleClass' => 'guang',
|
|
|
'subNav' => array(
|
|
|
'list' => array(
|
|
|
0 => array(
|
|
|
'textCn' => '逛',
|
|
|
'textEn' => 'TrendFinder',
|
|
|
'back' => true,
|
|
|
'isSelect' => false,
|
|
|
'bgColor' => $color,
|
|
|
),
|
|
|
1 => array(
|
|
|
'textCn' => '查看全部',
|
|
|
'textEn' => '',
|
|
|
'back' => false,
|
|
|
'isSelect' => ($guangChoosed === 'lifestyle' || $guangChoosed === 'kids') ? true : false,
|
|
|
'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang')
|
|
|
),
|
|
|
2 => array(
|
|
|
'textCn' => '只看男生',
|
|
|
'textEn' => 'Boys',
|
|
|
'back' => false,
|
|
|
'isSelect' => ($guangChoosed === 'boys') ? true : false,
|
|
|
'url' => Helpers::url('', array('gender' => '1,3'), 'guang')
|
|
|
),
|
|
|
3 => array(
|
|
|
'textCn' => '只看女生',
|
|
|
'textEn' => 'Girls',
|
|
|
'back' => false,
|
|
|
'isSelect' => ($guangChoosed === 'girls') ? true : false,
|
|
|
'url' => Helpers::url('', array('gender' => '2,3'), 'guang')
|
|
|
),
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据选择的频道获取逛的背景色
|
|
|
* @param string $guangChoosed 逛默认选中项 "all"表示全部,"boys":只看男生,"girls":只看女生
|
|
|
* @return string color值
|
|
|
*/
|
|
|
private static function getSideTopColor($guangChoosed)
|
|
|
{
|
|
|
// 判断逛的背景色
|
|
|
$color = false;
|
|
|
if ($guangChoosed === 'girls') {
|
|
|
$color = '#FF88AE';
|
...
|
...
|
@@ -109,43 +170,7 @@ class SideModel |
|
|
$color = '#4f4138';
|
|
|
}
|
|
|
|
|
|
return array(
|
|
|
'textCn' => '逛',
|
|
|
'textEn' => 'TRENDFINDER',
|
|
|
'styleClass' => 'guang',
|
|
|
'subNav' => array(
|
|
|
'list' => array(
|
|
|
0 => array(
|
|
|
'textCn' => '逛',
|
|
|
'textEn' => 'TrendFinder',
|
|
|
'back' => true,
|
|
|
'isSelect' => false,
|
|
|
'bgColor' => $color,
|
|
|
),
|
|
|
1 => array(
|
|
|
'textCn' => '查看全部',
|
|
|
'textEn' => '',
|
|
|
'back' => false,
|
|
|
'isSelect' => ($guangChoosed === 'lifestyle' || $guangChoosed === 'kids') ? true : false,
|
|
|
'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang')
|
|
|
),
|
|
|
2 => array(
|
|
|
'textCn' => '只看男生',
|
|
|
'textEn' => 'Boys',
|
|
|
'back' => false,
|
|
|
'isSelect' => ($guangChoosed === 'boys') ? true : false,
|
|
|
'url' => Helpers::url('', array('gender' => '1,3'), 'guang')
|
|
|
),
|
|
|
3 => array(
|
|
|
'textCn' => '只看女生',
|
|
|
'textEn' => 'Girls',
|
|
|
'back' => false,
|
|
|
'isSelect' => ($guangChoosed === 'girls') ? true : false,
|
|
|
'url' => Helpers::url('', array('gender' => '2,3'), 'guang')
|
|
|
),
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
return $color;
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -164,6 +189,9 @@ class SideModel |
|
|
$result['styleClass'] = strtolower($data['sort_name_en']);
|
|
|
$result['url'] = Helpers::getFilterUrl($data['sort_url']);
|
|
|
$result['img'] = Helpers::getImageUrl($data['sort_ico'], 60, 60, 1);
|
|
|
if (isset($data['sort_name_color'])) {
|
|
|
$result['color'] = $data['sort_name_color'];
|
|
|
}
|
|
|
|
|
|
return $result;
|
|
|
}
|
...
|
...
|
|