Merge branch 'bind' into 'develop'
频道选择页更改 1. 增加yohood频道 2. 频道选择项可配置 See merge request !30
Showing
6 changed files
with
97 additions
and
24 deletions
@@ -817,7 +817,7 @@ | @@ -817,7 +817,7 @@ | ||
817 | }, | 817 | }, |
818 | ... | 818 | ... |
819 | ], | 819 | ], |
820 | - | 820 | + |
821 | totalNum: 20 | 821 | totalNum: 20 |
822 | } | 822 | } |
823 | 823 | ||
@@ -1262,7 +1262,7 @@ | @@ -1262,7 +1262,7 @@ | ||
1262 | name: '黄色', | 1262 | name: '黄色', |
1263 | colorNum:10, | 1263 | colorNum:10, |
1264 | sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割 | 1264 | sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割 |
1265 | - | 1265 | + |
1266 | }, | 1266 | }, |
1267 | ... | 1267 | ... |
1268 | ], | 1268 | ], |
@@ -1283,7 +1283,7 @@ | @@ -1283,7 +1283,7 @@ | ||
1283 | 'id' : '', | 1283 | 'id' : '', |
1284 | 'preferenceUrl' :'', | 1284 | 'preferenceUrl' :'', |
1285 | } | 1285 | } |
1286 | -### 评价列表页面 | 1286 | +### 评价列表页面 |
1287 | { | 1287 | { |
1288 | 'comments':{ | 1288 | 'comments':{ |
1289 | 'list' : [ | 1289 | 'list' : [ |
@@ -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 | + |
@@ -67,5 +67,17 @@ class IndexData | @@ -67,5 +67,17 @@ class IndexData | ||
67 | 67 | ||
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 | + | ||
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 | + } | ||
70 | 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"></span></a> | 23 | <a href="{{href}}" class="list-item">{{title}} <span class="lighter">{{entitle}}</span> <span class="iconfont right-icon"></span></a> |
24 | {{/channelList}} | 24 | {{/channelList}} |
25 | {{#showYohood}} | 25 | {{#showYohood}} |
26 | - <a href="/yohood" id="yohood" class="list-item"> <span class="iconfont right-icon"></span></a> | 26 | + <a href="{{yohoodHref}}" id="yohood" class="list-item"> <span class="iconfont right-icon"></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 | * |
@@ -10,7 +10,7 @@ use Configs\CacheConfig; | @@ -10,7 +10,7 @@ use Configs\CacheConfig; | ||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * 首页相关的模板数据模型 | 12 | * 首页相关的模板数据模型 |
13 | - * | 13 | + * |
14 | * @name HomeModel | 14 | * @name HomeModel |
15 | * @package models | 15 | * @package models |
16 | * @copyright yoho.inc | 16 | * @copyright yoho.inc |
@@ -52,7 +52,7 @@ class HomeModel | @@ -52,7 +52,7 @@ class HomeModel | ||
52 | 52 | ||
53 | /** | 53 | /** |
54 | * 选择频道 | 54 | * 选择频道 |
55 | - * | 55 | + * |
56 | * @return void | 56 | * @return void |
57 | */ | 57 | */ |
58 | public static function goSwitchChannel() | 58 | public static function goSwitchChannel() |
@@ -70,7 +70,7 @@ class HomeModel | @@ -70,7 +70,7 @@ class HomeModel | ||
70 | 70 | ||
71 | /** | 71 | /** |
72 | * 设置选择的频道保存到浏览器COOKIE | 72 | * 设置选择的频道保存到浏览器COOKIE |
73 | - * | 73 | + * |
74 | * @param string $cookie | 74 | * @param string $cookie |
75 | * @return void | 75 | * @return void |
76 | */ | 76 | */ |
@@ -81,7 +81,7 @@ class HomeModel | @@ -81,7 +81,7 @@ class HomeModel | ||
81 | 81 | ||
82 | /** | 82 | /** |
83 | * 获取频道选择页的背景图片 | 83 | * 获取频道选择页的背景图片 |
84 | - * | 84 | + * |
85 | * @return string | false | 85 | * @return string | false |
86 | */ | 86 | */ |
87 | public static function getBgImage() | 87 | public static function getBgImage() |
@@ -122,7 +122,7 @@ class HomeModel | @@ -122,7 +122,7 @@ class HomeModel | ||
122 | 122 | ||
123 | /** | 123 | /** |
124 | * 获取男生,女生底部banner | 124 | * 获取男生,女生底部banner |
125 | - * | 125 | + * |
126 | * @return string | false | 126 | * @return string | false |
127 | */ | 127 | */ |
128 | public static function getBottomBanner($channel) | 128 | public static function getBottomBanner($channel) |
@@ -164,7 +164,7 @@ class HomeModel | @@ -164,7 +164,7 @@ class HomeModel | ||
164 | } | 164 | } |
165 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 | 165 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 |
166 | else { | 166 | else { |
167 | - Cache::set($cache, $result); | 167 | + Cache::set($cache, $result); |
168 | } | 168 | } |
169 | } | 169 | } |
170 | 170 | ||
@@ -173,7 +173,7 @@ class HomeModel | @@ -173,7 +173,7 @@ class HomeModel | ||
173 | 173 | ||
174 | /** | 174 | /** |
175 | * 获取男生首页的楼层数据 | 175 | * 获取男生首页的楼层数据 |
176 | - * | 176 | + * |
177 | * @return array | false | 177 | * @return array | false |
178 | */ | 178 | */ |
179 | public static function getBoysFloor() | 179 | public static function getBoysFloor() |
@@ -204,13 +204,13 @@ class HomeModel | @@ -204,13 +204,13 @@ class HomeModel | ||
204 | Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result); | 204 | Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result); |
205 | } | 205 | } |
206 | } | 206 | } |
207 | - | 207 | + |
208 | return $result; | 208 | return $result; |
209 | } | 209 | } |
210 | 210 | ||
211 | /** | 211 | /** |
212 | * 获取女生首页的楼层数据 | 212 | * 获取女生首页的楼层数据 |
213 | - * | 213 | + * |
214 | * @return array | false | 214 | * @return array | false |
215 | */ | 215 | */ |
216 | public static function getGirlsFloor() | 216 | public static function getGirlsFloor() |
@@ -247,7 +247,7 @@ class HomeModel | @@ -247,7 +247,7 @@ class HomeModel | ||
247 | 247 | ||
248 | /** | 248 | /** |
249 | * 获取潮童首页的楼层数据 | 249 | * 获取潮童首页的楼层数据 |
250 | - * | 250 | + * |
251 | * @return array | false | 251 | * @return array | false |
252 | */ | 252 | */ |
253 | public static function getKidsFloor() | 253 | public static function getKidsFloor() |
@@ -284,7 +284,7 @@ class HomeModel | @@ -284,7 +284,7 @@ class HomeModel | ||
284 | 284 | ||
285 | /** | 285 | /** |
286 | * 获取创意生活首页的楼层数据 | 286 | * 获取创意生活首页的楼层数据 |
287 | - * | 287 | + * |
288 | * @return array | false | 288 | * @return array | false |
289 | */ | 289 | */ |
290 | public static function getLifestyleFloor() | 290 | public static function getLifestyleFloor() |
@@ -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 | } |
-
Please register or login to post a comment