Girls.php 3.31 KB
<?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);
		}

}