Authored by fei.hong

Merge branch 'bind' into 'develop'

频道选择页更改

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

See merge request !30
@@ -1375,5 +1375,7 @@ @@ -1375,5 +1375,7 @@
1375 'entitle' : 'LIFESTYLE', 1375 'entitle' : 'LIFESTYLE',
1376 } 1376 }
1377 ], 1377 ],
1378 - 'showYohood' : true/false 1378 + 'showYohood' : true/false,
  1379 + 'yohoodHref' : '/yohood'
1379 } 1380 }
  1381 +
@@ -68,4 +68,16 @@ class IndexData @@ -68,4 +68,16 @@ class IndexData
68 return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/home', $param); 68 return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/home', $param);
69 } 69 }
70 70
  71 + /**
  72 + * 获取频道选择页数据
  73 + *
  74 + * @return array
  75 + */
  76 + public static function channelData()
  77 + {
  78 + $param = Yohobuy::param();
  79 + $param['client_secret'] = Sign::getSign($param);
  80 + return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/entrance/getEntrance',$param,3600);
  81 + }
  82 +
71 } 83 }
@@ -2,6 +2,16 @@ @@ -2,6 +2,16 @@
2 width: 100%; 2 width: 100%;
3 overflow: hidden; 3 overflow: hidden;
4 margin: 0 auto; 4 margin: 0 auto;
  5 + #yohood {
  6 + background-color: transparent;
  7 + background-image: image-url('yohood.png');
  8 + background-size: 40%;
  9 + background-repeat: no-repeat;
  10 + background-position-x: 26%;
  11 + background-position-y: 36%;
  12 + border: none;
  13 + border-bottom: 4px solid #fff;
  14 + }
5 .index-header { 15 .index-header {
6 box-sizing: border-box; 16 box-sizing: border-box;
7 padding: 0 20rem / $pxConvertRem; 17 padding: 0 20rem / $pxConvertRem;
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 <a href="{{href}}" class="list-item">{{title}} <span class="lighter">{{entitle}}</span> <span class="iconfont right-icon">&#xe614;</span></a> 23 <a href="{{href}}" class="list-item">{{title}} <span class="lighter">{{entitle}}</span> <span class="iconfont right-icon">&#xe614;</span></a>
24 {{/channelList}} 24 {{/channelList}}
25 {{#showYohood}} 25 {{#showYohood}}
26 - <a href="/yohood" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a> 26 + <a href="{{yohoodHref}}" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a>
27 {{/showYohood}} 27 {{/showYohood}}
28 </div> 28 </div>
29 </div> 29 </div>
@@ -23,16 +23,16 @@ class IndexController extends AbstractAction @@ -23,16 +23,16 @@ class IndexController extends AbstractAction
23 // 设置浏览器缓存5分钟 23 // 设置浏览器缓存5分钟
24 $this->setExpires(300); 24 $this->setExpires(300);
25 } 25 }
26 - 26 + $result = Index\HomeModel::getChannel();
  27 + $result['background'] = Index\HomeModel::getBgImage();
  28 + $result['channelPage'] = true;
  29 + $result['showDownloadApp'] = true;
  30 + $result['searchUrl'] = Helpers::url('', null, 'search');
  31 + $result['pageFooter'] = true;
27 // 渲染模板 32 // 渲染模板
28 - $this->_view->display('index', array(  
29 - 'background' => Index\HomeModel::getBgImage(),  
30 - 'channelPage' => true,  
31 - 'showDownloadApp'=>true,  
32 - 'searchUrl' => Helpers::url('', null, 'search'),  
33 - 'pageFooter' => true,  
34 - )); 33 + $this->_view->display('index', $result);
35 } 34 }
  35 +
36 /** 36 /**
37 * 设置升级公告路由 37 * 设置升级公告路由
38 * 38 *
@@ -319,4 +319,53 @@ class HomeModel @@ -319,4 +319,53 @@ class HomeModel
319 return $result; 319 return $result;
320 } 320 }
321 321
  322 + /**
  323 + * 获取频道选择页数据
  324 + *
  325 + * @return array
  326 + */
  327 + public static function getChannel(){
  328 + $result = array();
  329 + $result['showYohood'] = false;
  330 +
  331 + $data = IndexData::channelData();
  332 +
  333 + $channelList = array();
  334 + if(isset($data['data']['list'])){
  335 + foreach($data['data']['list'] as $key => $value){
  336 + switch ($value['channel_id']) {
  337 + case 5:
  338 + $result['showYohood'] = true;
  339 + $result['yohoodHref'] = '/yohood';
  340 + break;
  341 + case 1:
  342 + $channelList[$key]['href'] = '/boys';
  343 + $channelList[$key]['title'] = '男生';
  344 + $channelList[$key]['entitle'] = 'BOYS';
  345 + break;
  346 + case 2:
  347 + $channelList[$key]['href'] = '/girls';
  348 + $channelList[$key]['title'] = '女生';
  349 + $channelList[$key]['entitle'] = 'GIRLS';
  350 + break;
  351 + case 3:
  352 + $channelList[$key]['href'] = '/kids';
  353 + $channelList[$key]['title'] = '潮童';
  354 + $channelList[$key]['entitle'] = 'KIDS';
  355 + break;
  356 + case 4:
  357 + $channelList[$key]['href'] = '/lifestyle';
  358 + $channelList[$key]['title'] = '创意生活';
  359 + $channelList[$key]['entitle'] = 'LIFESTYLE';
  360 + break;
  361 + default:
  362 + break;
  363 + }
  364 + }
  365 + $result['channelList'] = $channelList;
  366 + }
  367 +
  368 + return $result;
  369 + }
  370 +
322 } 371 }