Authored by Rock Zhang

首页数据,楼层代码构建

1 {{> layout/page_footer}} 1 {{> layout/page_footer}}
2 -<script src="http://172.16.6.248:8000/static/js/sea.js?nowrap"></script> 2 +<script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
3 <script> 3 <script>
4 seajs.config({ 4 seajs.config({
5 - base: 'http://172.16.6.248:8000' 5 + base: 'http://localhost:8000/'
6 }); 6 });
7 </script> 7 </script>
8 {{> layout/use}} 8 {{> layout/use}}
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 }()); 22 }());
23 })(document, window); 23 })(document, window);
24 </script> 24 </script>
25 - <link rel="stylesheet" href="http://172.16.6.248:8088/css/index.css"> 25 + <link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
26 </head> 26 </head>
27 <body {{#if isPassportPage}}class=passport-body{{/if}}> 27 <body {{#if isPassportPage}}class=passport-body{{/if}}>
28 {{> layout/page_header}} 28 {{> layout/page_header}}
@@ -17,6 +17,6 @@ class BoysController extends AbstractAction @@ -17,6 +17,6 @@ class BoysController extends AbstractAction
17 print_r($channelData); 17 print_r($channelData);
18 18
19 $this->_view->assign('title', 'YOHO!有货'); 19 $this->_view->assign('title', 'YOHO!有货');
20 - $this->_view->display('boys', compact('channelData')); 20 + $this->_view->display('index', compact('channelData'));
21 } 21 }
22 } 22 }
1 <?php 1 <?php
2 2
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 -use LibModels\Wap\Home\IndexData as Index; 4 +use LibModels\Wap\Home\IndexData;
  5 +use Plugin\Helpers;
5 /** 6 /**
6 * 女生首页 7 * 女生首页
7 */ 8 */
@@ -10,392 +11,150 @@ class GirlsController extends AbstractAction @@ -10,392 +11,150 @@ class GirlsController extends AbstractAction
10 11
11 public function indexAction() 12 public function indexAction()
12 { 13 {
13 - $data = array(  
14 - 'headerDownload' => array(  
15 - 'img' => 'http://img11.static.yhbimg.com/adpic/2015/02/28/18/01d83bfad41c8fca8fd1ad334216d7d733.jpg?imageView/2/w/640/h/480',  
16 - 'url' => 'http://www.baidu.com'  
17 - ),  
18 - 'homeHeader' => array(  
19 - 'bgColor' => '#FF88AE',  
20 - 'searchUrl' => ''  
21 - ),  
22 - 'searchUrl' => '',  
23 - 'sideNav' => array(  
24 - array(  
25 - 'textCn' => '男生',  
26 - 'textEn' => 'Boys',  
27 - 'icon' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
28 - 'url' => ''  
29 - ),  
30 - array(  
31 - 'textCn' => '女生',  
32 - 'textEn' => 'GIRLS',  
33 - 'icon' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
34 - 'url' => ''  
35 - ),  
36 - array(  
37 - 'textCn' => '潮童',  
38 - 'textEn' => 'KIDS',  
39 - 'icon' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
40 - 'url' => ''  
41 - ),  
42 - array(  
43 - 'textCn' => '创意生活',  
44 - 'textEn' => 'LIFE STYLE',  
45 - 'icon' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
46 - 'url' => ''  
47 - ),  
48 - array(  
49 - 'textCn' => '逛',  
50 - 'textEn' => 'TRENDFINDER',  
51 - 'icon' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
52 - 'subNav' => array(  
53 - 'list' => array(  
54 - array(  
55 - 'textCn' => '逛',  
56 - 'textEn' => 'TrendFinder',  
57 - 'back' => true,  
58 - 'bgColor' => '#fd307f'  
59 - ),  
60 - array(  
61 - 'textCn' => '查看全部',  
62 - 'url' => ''  
63 - ),  
64 - array(  
65 - 'textCn' => '只看男生',  
66 - 'textEn' => 'Boys',  
67 - 'url' => ''  
68 - ),  
69 - array(  
70 - 'textCn' => '只看女生',  
71 - 'textEn' => 'Girls',  
72 - 'url' => '',  
73 - 'isSelect' => true  
74 - )  
75 -  
76 - )  
77 - )  
78 - )  
79 -  
80 - ),  
81 - 'content' => array(  
82 - 'bannerTop' => array(  
83 - 'list' => array(  
84 - array(  
85 - 'url' => '',  
86 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'  
87 - ),  
88 - array(  
89 - 'url' => '',  
90 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'  
91 - ),  
92 - array(  
93 - 'url' => '',  
94 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg'  
95 - )  
96 - )  
97 - ),  
98 - 'iconsEnter' => array(  
99 - 'list' => array(  
100 - array(  
101 - 'url' => '',  
102 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
103 - 'text' => '新品到着'  
104 - ),  
105 - array(  
106 - 'url' => '',  
107 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
108 - 'text' => '全球优选'  
109 - ),  
110 - array(  
111 - 'url' => '',  
112 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
113 - 'text' => '明星潮牌'  
114 - ),  
115 - array(  
116 - 'url' => '',  
117 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
118 - 'text' => '全部品类'  
119 - ),  
120 - array(  
121 - 'url' => '',  
122 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
123 - 'text' => '逛'  
124 - ),  
125 - array(  
126 - 'url' => '',  
127 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
128 - 'text' => '搭配指南'  
129 - ),  
130 - array(  
131 - 'url' => '',  
132 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
133 - 'text' => '潮品推荐'  
134 - ),  
135 - array(  
136 - 'url' => '',  
137 - 'img' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',  
138 - 'text' => '折扣精选'  
139 - )  
140 - )  
141 - ),  
142 - 'hotCategory' => array(  
143 - 'img' => 'http://img11.static.yhbimg.com/adpic/2015/02/28/18/01d83bfad41c8fca8fd1ad334216d7d733.jpg?imageView/2/w/640/h/480',  
144 - 'url' => 'http://www.baidu.com',  
145 - 'list' => array(  
146 - array(  
147 - 'textCn' => '打底衫',  
148 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
149 - 'url' => ''  
150 - ),  
151 - array(  
152 - 'textCn' => '打底衫',  
153 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
154 - 'url' => ''  
155 - ),  
156 - array(  
157 - 'textCn' => '打底衫',  
158 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
159 - 'url' => ''  
160 - ),  
161 - array(  
162 - 'textCn' => '打底衫',  
163 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
164 - 'url' => ''  
165 - ),  
166 - array(  
167 - 'textCn' => '打底衫',  
168 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
169 - 'url' => ''  
170 - ),  
171 - array(  
172 - 'textCn' => '打底衫',  
173 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
174 - 'url' => ''  
175 - ),  
176 - array(  
177 - 'textCn' => '打底衫',  
178 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
179 - 'url' => ''  
180 - ),  
181 - array(  
182 - 'textCn' => '打底衫',  
183 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
184 - 'url' => ''  
185 - ),  
186 - array(  
187 - 'textCn' => '打底衫',  
188 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
189 - 'url' => ''  
190 - )  
191 - )  
192 - ),  
193 - 'hotBrandsScroll' => array(  
194 - 'name' => '热门品牌',  
195 - 'list' => array(  
196 - array(  
197 - 'textCn' => 'Moussy',  
198 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
199 - 'url' => ''  
200 - ),  
201 - array(  
202 - 'textCn' => 'Moussy',  
203 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
204 - 'url' => ''  
205 - ),  
206 - array(  
207 - 'textCn' => 'Moussy',  
208 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
209 - 'url' => ''  
210 - ),  
211 - array(  
212 - 'textCn' => 'Moussy',  
213 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
214 - 'url' => ''  
215 - ),  
216 - array(  
217 - 'textCn' => 'Moussy',  
218 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
219 - 'url' => ''  
220 - ),  
221 - array(  
222 - 'textCn' => 'Moussy',  
223 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
224 - 'url' => ''  
225 - ),  
226 - array(  
227 - 'textCn' => 'Moussy',  
228 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
229 - 'url' => ''  
230 - ),  
231 - array(  
232 - 'textCn' => 'Moussy',  
233 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
234 - 'url' => ''  
235 - ),  
236 - array(  
237 - 'textCn' => 'Moussy',  
238 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
239 - 'url' => ''  
240 - )  
241 - )  
242 - ),  
243 - 'hotBrands' => array(  
244 - 'name' => '热门品牌',  
245 - 'more' => 'www.baidu.com',  
246 - 'brands' => array(  
247 - array(  
248 - 'name' => 'Front Row Shop',  
249 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
250 - 'url' => ''  
251 - ),  
252 - array(  
253 - 'name' => 'dress lab',  
254 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
255 - 'url' => ''  
256 - ),  
257 - array(  
258 - 'name' => 'DEVIL NUT',  
259 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
260 - 'url' => ''  
261 - ),  
262 - array(  
263 - 'name' => 'casselini',  
264 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
265 - 'url' => ''  
266 - ),  
267 - array(  
268 - 'name' => 'haso',  
269 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
270 - 'url' => ''  
271 - ),  
272 - array(  
273 - 'name' => 'EVISU',  
274 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
275 - 'url' => ''  
276 - )  
277 - )  
278 - ),  
279 - 'trendColloaction' => array(  
280 - 'name' => '潮人 ▪ 搭配',  
281 - 'more' => '',  
282 - 'leftspan' => array(  
283 - 'url' => '',  
284 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg'  
285 - ),  
286 - 'rightspan' => array(  
287 - 'url' => '',  
288 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg'  
289 - ),  
290 - 'recommendlist' => array(  
291 - array(  
292 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
293 - 'url' => ''  
294 - ),  
295 - array(  
296 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
297 - 'url' => ''  
298 - ),  
299 - array(  
300 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
301 - 'url' => ''  
302 - ),  
303 - array(  
304 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
305 - 'url' => ''  
306 - ),  
307 - array(  
308 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
309 - 'url' => ''  
310 - )  
311 - )  
312 - ),  
313 - 'trendTopics' => array(  
314 - 'name' => '潮品 ▪ 话题',  
315 - 'more' => '',  
316 - 'list' => array(  
317 - array(  
318 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
319 - 'url' => '',  
320 - 'title' => '现代裁剪',  
321 - 'time' => '2月13日 12:34'  
322 - ),  
323 - array(  
324 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
325 - 'url' => '',  
326 - 'title' => '现代裁剪',  
327 - 'time' => '2月13日 12:34'  
328 - ),  
329 - array(  
330 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
331 - 'url' => '',  
332 - 'title' => '现代裁剪',  
333 - 'time' => '2月13日 12:34'  
334 - )  
335 - )  
336 - ),  
337 - 'goodsCategory' => array(  
338 - 'name' => '经典裤装',  
339 - 'more' => '',  
340 - 'banner' => array(  
341 - 'list' => array(  
342 - array(  
343 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
344 - 'url' => ''  
345 - )  
346 - )  
347 - ),  
348 - 'list' => array(  
349 - array(  
350 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
351 - 'url' => '',  
352 - 'textCn' => '手表'  
353 - ),  
354 - array(  
355 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
356 - 'url' => '',  
357 - 'textCn' => '烛台'  
358 - ),  
359 - array(  
360 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
361 - 'url' => '',  
362 - 'textCn' => '围巾'  
363 - ),  
364 - array(  
365 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
366 - 'url' => '',  
367 - 'textCn' => '盘子'  
368 - ),  
369 - array(  
370 - 'img' => 'http://img.alicdn.com/imgextra/i1/2086467111/TB2CsqHdXXXXXaDXpXXXXXXXXXX_!!2086467111.jpg',  
371 - 'url' => '',  
372 - 'textCn' => '耳机'  
373 - )  
374 - )  
375 - )  
376 - 14 + $data = array(
  15 + 'headerDownload' => $this->getHeaderDownload(),
  16 + 'homeHeader' => array(
  17 + 'bgColor' => '#FF88AE',
  18 + 'searchUrl' => ''
  19 + ),
  20 + 'searchUrl' => '',
  21 + 'sideNav' => array(),
  22 + 'content' => array()
  23 + );
377 24
  25 + $sideDatas = IndexData::getHomeChannels();
  26 + if($sideDatas['code'] == 200)
  27 + {
  28 + $data['sideNav'] = $sideDatas['data'];
  29 + }
378 30
  31 + // 频道数据
  32 + $channelData = IndexData::getUserChannelData(0, '2,3', '201504091403002');
  33 + $channels = array();
  34 + if($channelData['code'] == 200)
  35 + {
  36 + $content = array();
  37 + $bannerTop = array();
  38 + $iconsEnter = array();
  39 + $singleImage = array();
  40 + $hotCategory = array();
  41 + $hotBrandsScroll = array();
  42 + $trendColloaction = array();
  43 + $trendTopics = array();
  44 + $goodsCategory = array();
  45 + $recommend_content_two = array();
  46 + $small_pic = array();
379 47
  48 + foreach ($channelData['data']['list'] as $key => $val) {
  49 + switch ($val['template_name']) {
  50 + case 'focus': // 焦点图
  51 + $oneFocus = array();
  52 + foreach ($val['data'] as &$one) {
  53 + $one['img'] = Helpers::getImageUrl($one['src'], 750, 364, 1);
  54 + }
  55 + $oneFocus['list'] = $val['data'];
  56 + $bannerTop[] = $oneFocus;
  57 + break;
  58 + case 'app_icon_list': // 图标列表
  59 + $oneIcon = array();
  60 + foreach ($val['data'] as &$one) {
  61 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  62 + }
  63 + $oneIcon['list'] = $val['data'];
  64 + $iconsEnter[] = $oneIcon;
  65 + break;
  66 + case 'single_image': // 单图片
  67 + $oneImage = array();
  68 + foreach ($val['data'] as &$one) {
  69 + $one['img'] = Helpers::getImageUrl($one['src'], 750, 364, 1);
  70 + }
  71 + $oneImage['list'] = $val['data'];
  72 + $singleImage[] = $oneImage;
  73 + break;
  74 + case 'recommend_content_five': // 带标题的12个小图推荐
  75 + $oneHot = array();
  76 + foreach ($val['data']['list'] as &$one) {
  77 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  78 + }
  79 + $oneHot = $val['data'];
  80 + $hotCategory[] = $oneHot;
  81 + break;
  82 + case 'app_hot_brands': // 推荐品牌
  83 + $oneHotBrand = array();
  84 + foreach ($val['data']['list'] as &$one) {
  85 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  86 + }
  87 + $oneHotBrand = $val['data'];
  88 + $hotBrandsScroll[] = $oneHotBrand;
  89 + break;
  90 + case 'trendsetter_collocation': // 潮人·搭配
  91 + $oneTrendSetter = array();
  92 + foreach ($val['data']['article'] as &$one) {
  93 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  94 + }
  95 + foreach ($val['data']['recommend_collocation'] as &$one) {
  96 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  97 + }
  98 + $oneTrendSetter = $val['data'];
  99 + $trendColloaction[] = $oneTrendSetter;
  100 + break;
  101 + case 'trendgoods_topic': // 潮品·话题
  102 + $oneTopic = array();
  103 + foreach ($val['data']['list'] as &$one) {
  104 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  105 + }
  106 + $oneTopic = $val['data'];
  107 + $trendTopics[] = $oneTopic;
  108 + break;
  109 + case 'recommend_content_one': // 一张大图一个大的推荐和4个小图推荐
  110 + $oneGoodCategory = array();
  111 + foreach ($val['data']['big_image'] as &$one) {
  112 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  113 + }
  114 + foreach ($val['data']['list'] as &$one) {
  115 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  116 + }
  117 + $oneGoodCategory = $val['data'];
  118 + $goodsCategory[] = $oneGoodCategory;
  119 + break;
  120 + case 'recommend_content_two': // 一张大图和6个小图推荐
  121 + $oneRecoContTwo = array();
  122 + foreach ($val['data']['big_image'] as &$one) {
  123 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  124 + }
  125 + foreach ($val['data']['list'] as &$one) {
  126 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  127 + }
  128 + $oneRecoContTwo = $val['data'];
  129 + $recommend_content_two[] = $oneRecoContTwo;
  130 + break;
  131 + case 'small_pic': // 小图片
  132 + $oneSmallPic = array();
  133 + foreach ($val['data'] as &$one) {
  134 + $one['img'] = Helpers::getImageUrl($one['src'], 186, 203, 1);
  135 + }
  136 + $oneSmallPic = $val['data'];
  137 + $small_pic[] = $oneSmallPic;
  138 + break;
  139 + default:
  140 + break;
  141 + }
380 142
381 - ), 143 + $content[$key] = array(
  144 + 'bannerTop' => $bannerTop,
  145 + 'iconsEnter' => $iconsEnter,
  146 + 'hotCategory' => $hotCategory,
  147 + 'hotBrandsScroll' => $hotBrandsScroll,
  148 + 'trendColloaction' => $trendColloaction,
  149 + 'trendTopics' => $trendTopics,
  150 + 'goodsCategory' => $goodsCategory
  151 + );
  152 + }
382 153
383 - // 频道数据  
384 - $channelData = Index::getUserChannelData(0, '2,3', '201504091403002'); 154 + $data['content'] = $content;
  155 + }
385 156
386 - echo '<pre>';  
387 - print_r($channelData);  
388 -  
389 $this->_view->assign('title', 'YOHO!有货'); 157 $this->_view->assign('title', 'YOHO!有货');
390 $this->_view->display('index', $data); 158 $this->_view->display('index', $data);
391 -  
392 - // // 频道数据  
393 - // $channelData = Index::getUserChannelData(0, '2,3', '201504091403002');  
394 -  
395 - // echo '<pre>';  
396 - // print_r($channelData);  
397 -  
398 - // $this->_view->assign('title', 'YOHO!有货');  
399 - // $this->_view->display('girls', compact('channelData'));  
400 } 159 }
401 } 160 }
@@ -198,7 +198,7 @@ class BackController extends AbstractAction @@ -198,7 +198,7 @@ class BackController extends AbstractAction
198 $result = BackData::validateMobileCode($phoneNum, $code, $areaCode); 198 $result = BackData::validateMobileCode($phoneNum, $code, $areaCode);
199 if($result['code'] === 200) 199 if($result['code'] === 200)
200 { 200 {
201 - $result['data'] = '/passport/back/password?phoneNum='.$phoneNum.'&token='.$result['token'].'&areaCode='.$areaCode; 201 + $result['data'] = '/passport/back/password?phoneNum='.$phoneNum.'&token='.$result['data']['token'].'&areaCode='.$areaCode;
202 } 202 }
203 203
204 $this->echoJson($result); 204 $this->echoJson($result);