Girls.php
3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
use Action\AbstractAction;
use LibModels\Wap\Home\IndexData;
use Plugin\Helpers;
use Plugin\FloorProcess;
/**
* 女生首页
*/
class GirlsController extends AbstractAction
{
public function indexAction()
{
$data = array(
'headerDownload' => $this->getHeaderDownload(),
'homeHeader' => array(
'bgColor' => '#FF88AE',
'searchUrl' => ''
),
'searchUrl' => '',
'sideNav' => array(),
'content' => array()
);
$sideDatas = IndexData::getHomeChannels();
if($sideDatas['code'] == 200)
{
$data['sideNav'] = $sideDatas['data'];
}
// 频道数据
$channelData = IndexData::getUserChannelData(0, '2,3', '201504091403002');
$channels = array();
if($channelData['code'] == 200)
{
$content = array();
$bannerTop = array();
$iconsEnter = array();
$singleImage = array();
$hotCategory = array();
$hotBrandsScroll = array();
$trendColloaction = array();
$trendTopics = array();
$goodsCategory = array();
$recommend_content_two = array();
$small_pic = array();
foreach ($channelData['data']['list'] as $val) {
$template = $val['template_name'];
$floorData = $val['data'];
switch ($template) {
case 'focus': // 焦点图
$oneFocus = FloorProcess::$template($floorData);
$bannerTop[] = $oneFocus;
break;
case 'app_icon_list': // 图标列表
$oneIcon = FloorProcess::$template($floorData);
$iconsEnter[] = $oneIcon;
break;
case 'single_image': // 单图片
$oneImage = FloorProcess::$template($floorData);
$singleImage[] = $oneImage;
break;
case 'recommend_content_five': // 带标题的12个小图推荐
$oneHot = FloorProcess::$template($floorData);
$hotCategory[] = $oneHot;
break;
case 'app_hot_brands': // 推荐品牌
$oneHotBrand = FloorProcess::$template($floorData);
$hotBrandsScroll[] = $oneHotBrand;
break;
case 'trendsetter_collocation': // 潮人·搭配
$oneTrendSetter = FloorProcess::$template($floorData);
$trendColloaction[] = $oneTrendSetter;
break;
case 'trendgoods_topic': // 潮品·话题
$oneTopic = FloorProcess::$template($floorData);
$trendTopics[] = $oneTopic;
break;
case 'recommend_content_one': // 一张大图一个大的推荐和4个小图推荐
$oneGoodCategory = FloorProcess::$template($floorData);
$goodsCategory[] = $oneGoodCategory;
break;
case 'recommend_content_two': // 一张大图和6个小图推荐
$oneRecoContTwo = FloorProcess::$template($floorData);
$recommend_content_two[] = $oneRecoContTwo;
break;
case 'small_pic': // 小图片
$oneSmallPic = FloorProcess::$template($floorData);
$small_pic[] = $oneSmallPic;
break;
default:
break;
}
}
$content = array(
'bannerTop' => $bannerTop,
'iconsEnter' => $iconsEnter,
'hotCategory' => $hotCategory,
'hotBrandsScroll' => $hotBrandsScroll,
'trendColloaction' => $trendColloaction,
'trendTopics' => $trendTopics,
'goodsCategory' => $goodsCategory
);
$data['content'] = $content;
}
echo '<pre>';
print_r($data);exit;
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('index', $data);
}
}