Authored by fei.hong

Merge branch 'bind' into 'develop'

频道选择页更改

1. 增加yohood频道
2. 频道选择项可配置

See merge request !30
... ... @@ -817,7 +817,7 @@
},
...
],
totalNum: 20
}
... ... @@ -1262,7 +1262,7 @@
name: '黄色',
colorNum:10,
sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割
},
...
],
... ... @@ -1283,7 +1283,7 @@
'id' : '',
'preferenceUrl' :'',
}
### 评价列表页面
### 评价列表页面
{
'comments':{
'list' : [
... ... @@ -1375,5 +1375,7 @@
'entitle' : 'LIFESTYLE',
}
],
'showYohood' : true/false
'showYohood' : true/false,
'yohoodHref' : '/yohood'
}
... ...
... ... @@ -67,5 +67,17 @@ class IndexData
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/home', $param);
}
/**
* 获取频道选择页数据
*
* @return array
*/
public static function channelData()
{
$param = Yohobuy::param();
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/entrance/getEntrance',$param,3600);
}
}
... ...
... ... @@ -2,6 +2,16 @@
width: 100%;
overflow: hidden;
margin: 0 auto;
#yohood {
background-color: transparent;
background-image: image-url('yohood.png');
background-size: 40%;
background-repeat: no-repeat;
background-position-x: 26%;
background-position-y: 36%;
border: none;
border-bottom: 4px solid #fff;
}
.index-header {
box-sizing: border-box;
padding: 0 20rem / $pxConvertRem;
... ...
... ... @@ -23,7 +23,7 @@
<a href="{{href}}" class="list-item">{{title}} <span class="lighter">{{entitle}}</span> <span class="iconfont right-icon">&#xe614;</span></a>
{{/channelList}}
{{#showYohood}}
<a href="/yohood" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="{{yohoodHref}}" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a>
{{/showYohood}}
</div>
</div>
... ...
... ... @@ -23,16 +23,16 @@ class IndexController extends AbstractAction
// 设置浏览器缓存5分钟
$this->setExpires(300);
}
$result = Index\HomeModel::getChannel();
$result['background'] = Index\HomeModel::getBgImage();
$result['channelPage'] = true;
$result['showDownloadApp'] = true;
$result['searchUrl'] = Helpers::url('', null, 'search');
$result['pageFooter'] = true;
// 渲染模板
$this->_view->display('index', array(
'background' => Index\HomeModel::getBgImage(),
'channelPage' => true,
'showDownloadApp'=>true,
'searchUrl' => Helpers::url('', null, 'search'),
'pageFooter' => true,
));
$this->_view->display('index', $result);
}
/**
* 设置升级公告路由
*
... ...
... ... @@ -10,7 +10,7 @@ use Configs\CacheConfig;
/**
* 首页相关的模板数据模型
*
*
* @name HomeModel
* @package models
* @copyright yoho.inc
... ... @@ -52,7 +52,7 @@ class HomeModel
/**
* 选择频道
*
*
* @return void
*/
public static function goSwitchChannel()
... ... @@ -70,7 +70,7 @@ class HomeModel
/**
* 设置选择的频道保存到浏览器COOKIE
*
*
* @param string $cookie
* @return void
*/
... ... @@ -81,7 +81,7 @@ class HomeModel
/**
* 获取频道选择页的背景图片
*
*
* @return string | false
*/
public static function getBgImage()
... ... @@ -122,7 +122,7 @@ class HomeModel
/**
* 获取男生,女生底部banner
*
*
* @return string | false
*/
public static function getBottomBanner($channel)
... ... @@ -164,7 +164,7 @@ class HomeModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($cache, $result);
Cache::set($cache, $result);
}
}
... ... @@ -173,7 +173,7 @@ class HomeModel
/**
* 获取男生首页的楼层数据
*
*
* @return array | false
*/
public static function getBoysFloor()
... ... @@ -204,13 +204,13 @@ class HomeModel
Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result);
}
}
return $result;
}
/**
* 获取女生首页的楼层数据
*
*
* @return array | false
*/
public static function getGirlsFloor()
... ... @@ -247,7 +247,7 @@ class HomeModel
/**
* 获取潮童首页的楼层数据
*
*
* @return array | false
*/
public static function getKidsFloor()
... ... @@ -284,7 +284,7 @@ class HomeModel
/**
* 获取创意生活首页的楼层数据
*
*
* @return array | false
*/
public static function getLifestyleFloor()
... ... @@ -319,4 +319,53 @@ class HomeModel
return $result;
}
/**
* 获取频道选择页数据
*
* @return array
*/
public static function getChannel(){
$result = array();
$result['showYohood'] = false;
$data = IndexData::channelData();
$channelList = array();
if(isset($data['data']['list'])){
foreach($data['data']['list'] as $key => $value){
switch ($value['channel_id']) {
case 5:
$result['showYohood'] = true;
$result['yohoodHref'] = '/yohood';
break;
case 1:
$channelList[$key]['href'] = '/boys';
$channelList[$key]['title'] = '男生';
$channelList[$key]['entitle'] = 'BOYS';
break;
case 2:
$channelList[$key]['href'] = '/girls';
$channelList[$key]['title'] = '女生';
$channelList[$key]['entitle'] = 'GIRLS';
break;
case 3:
$channelList[$key]['href'] = '/kids';
$channelList[$key]['title'] = '潮童';
$channelList[$key]['entitle'] = 'KIDS';
break;
case 4:
$channelList[$key]['href'] = '/lifestyle';
$channelList[$key]['title'] = '创意生活';
$channelList[$key]['entitle'] = 'LIFESTYLE';
break;
default:
break;
}
}
$result['channelList'] = $channelList;
}
return $result;
}
}
... ...