Authored by hf

fixes bug to home page

... ... @@ -9,7 +9,9 @@ use Plugin\Helpers;
*/
class FloorProcess
{
private static $guangUrl = 'http://guang.m.yohobuy.com';
/**
* 频道参数
*
... ... @@ -151,7 +153,7 @@ class FloorProcess
$build['textCn'] = $one['title'];
$result['hotCategory']['list'][] = $build;
}
if (isset($data['title']['more_url'])) {
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
... ... @@ -181,8 +183,8 @@ class FloorProcess
$data['is_show_name'] = $data['title']['is_show'];
$data['name'] = $data['title']['title'];
unset($data['title']);
if (isset($data['title']['more_url'])) {
if (isset($data['title']['more_url'])) {
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
... ... @@ -227,12 +229,12 @@ class FloorProcess
{
$result = array();
foreach($data as $key=>&$value){
if($key == 'title'){
foreach ($data as $key => &$value) {
if ($key == 'title') {
$value['more_url'] = Helpers::url('', array('id' => 3, 'gender' => self::$channel[$type]), 'guang');
}
if($key == 'article'){
foreach($value as &$one){
if ($key == 'article') {
foreach ($value as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
}
... ... @@ -240,8 +242,8 @@ class FloorProcess
unset($one['src']);
}
}
if($key == 'recommend_collocation'){
foreach($value as &$one){
if ($key == 'recommend_collocation') {
foreach ($value as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
}
... ... @@ -265,11 +267,11 @@ class FloorProcess
{
$result = array();
foreach($data as $key=>&$value){
if($key == 'title'){
foreach ($data as $key => &$value) {
if ($key == 'title') {
$value['more_url'] = Helpers::url('', array('id' => 4, 'gender' => self::$channel[$type]), 'guang');
}
if($key == 'list'){
if ($key == 'list') {
foreach ($value as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
... ... @@ -316,8 +318,8 @@ class FloorProcess
unset($one['src']);
}
if (isset($data['title']['more_url'])) {
if (isset($data['title']['more_url'])) {
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
... ... @@ -355,8 +357,8 @@ class FloorProcess
$one['img'] = Helpers::getImageUrl($one['src'], 191, 191);
unset($one['src']);
}
if (isset($data['title']['more_url'])) {
if (isset($data['title']['more_url'])) {
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
$result['creativeLife'] = $data;
... ...
{{> layout/header}}
<div class="brand-page yoho-page">
<div class="newbrand-search">
<div class="search-box clearfix">
<a href="/index/search/index" >
<input type="text" class="search-input" placeholder="查找品牌">
<i class="search-icon iconfont">&#xe60f;</i>
</a>
</div>
</div>
<div class="newbrand-search">
<div class="search-box clearfix">
<a href="{{searchUrl}}" >
<input type="text" class="search-input" placeholder="查找品牌">
<i class="search-icon iconfont">&#xe60f;</i>
</a>
</div>
</div>
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
{{# hotBrand}}
<div class="hot-brand">
{{# hotBrand}}
<div class="hot-brand">
<ul class="hot-brand-list clearfix">
{{# list}}
<li>
... ... @@ -28,58 +26,58 @@
</li>
{{/ list}}
</ul>
</div>
{{/ hotBrand}}
</div>
{{/ hotBrand}}
{{# brandList}}
<div class="brand-list bar-{{@index}}">
<div class="title-bar">
<h2 style="position: static;">{{title}}</h2>
</div>
{{# list}}
<p>
<a href="{{url}}">{{name}}
{{# isHot}}
<i class="icon-hot">Hot</i>
{{/ isHot}}
{{# isNew}}
<i class="icon-new">New</i>
{{/ isNew}}
</a>
</p>
{{/ list}}
</div>
{{/ brandList}}
{{# brandList}}
<div class="brand-list bar-{{@index}}">
<div class="title-bar">
<h2 style="position: static;">{{title}}</h2>
</div>
{{# list}}
<p>
<a href="{{url}}">{{name}}
{{# isHot}}
<i class="icon-hot">Hot</i>
{{/ isHot}}
{{# isNew}}
<i class="icon-new">New</i>
{{/ isNew}}
</a>
</p>
{{/ list}}
</div>
{{/ brandList}}
<div id="right-bar" class="right-bar">
<div id="right-bar" class="right-bar">
<div class="con" id="con">
<b>#</b>
<b>A</b>
<b>B</b>
<b>C</b>
<b>D</b>
<b>E</b>
<b>F</b>
<b>G</b>
<b>H</b>
<b>I</b>
<b>J</b>
<b>K</b>
<b>L</b>
<b>M</b>
<b>N</b>
<b>O</b>
<b>P</b>
<b>Q</b>
<b>R</b>
<b>S</b>
<b>T</b>
<b>U</b>
<b>V</b>
<b>W</b>
<b>X</b>
<b>Y</b>
<b>Z</b>
<b>#</b>
<b>A</b>
<b>B</b>
<b>C</b>
<b>D</b>
<b>E</b>
<b>F</b>
<b>G</b>
<b>H</b>
<b>I</b>
<b>J</b>
<b>K</b>
<b>L</b>
<b>M</b>
<b>N</b>
<b>O</b>
<b>P</b>
<b>Q</b>
<b>R</b>
<b>S</b>
<b>T</b>
<b>U</b>
<b>V</b>
<b>W</b>
<b>X</b>
<b>Y</b>
<b>Z</b>
</div>
</div>
</div>
... ...
{{>layout/header}}
{{> layout/header}}
<div class="index-page yoho-page">
<div class="index-container">
<div class="index-header clearfix">
... ... @@ -6,6 +6,7 @@
<form action="{{searchUrl}}" class="index-search">
<a href="javascript:void(0);" class="no-search">取消</a>
<div class="search-box">
<input type="hidden" name="from" value="search">
<input type="text" name="query" placeholder="搜索">
<span class="iconfont clear-text">&#xe623;</span>
<span class="iconfont search-icon">&#xe60f;</span>
... ... @@ -23,5 +24,5 @@
</div>
</div>
</div>
{{>layout/footer}}
{{> layout/footer}}
{{> layout/download_app}}
\ No newline at end of file
... ...
... ... @@ -28,7 +28,8 @@ class BoysController extends AbstractAction
'boysHomePage' => true,
'showFooterTab'=>true,
'maybeLike' => true,
'content' => Index\HomeModel::getBoysFloor()
'content' => Index\HomeModel::getBoysFloor(),
'pageFooter' => true,
));
}
... ...
... ... @@ -28,7 +28,8 @@ class GirlsController extends AbstractAction
'grilsHomePage' => true,
'showFooterTab'=>true,
'maybeLike' => true,
'content' => Index\HomeModel::getGirlsFloor()
'content' => Index\HomeModel::getGirlsFloor(),
'pageFooter' => true,
));
}
... ...
... ... @@ -23,6 +23,7 @@ class IndexController extends AbstractAction
'channelPage' => true,
'showDownloadApp'=>true,
'searchUrl' => Helpers::url('', null, 'search'),
'pageFooter' => true,
));
}
... ...
... ... @@ -28,7 +28,8 @@ class KidsController extends AbstractAction
'kidsHomePage' => true,
'showFooterTab'=>true,
'maybeLike' => true,
'content' => Index\HomeModel::getKidsFloor()
'content' => Index\HomeModel::getKidsFloor(),
'pageFooter' => true,
));
}
... ...
... ... @@ -28,7 +28,8 @@ class LifestyleController extends AbstractAction
'lifestyleHomePage' => true,
'showFooterTab'=>true,
'maybeLike' => true,
'content' => Index\HomeModel::getLifestyleFloor()
'content' => Index\HomeModel::getLifestyleFloor(),
'pageFooter' => true,
));
}
... ...
... ... @@ -44,7 +44,7 @@ class SearchController extends AbstractAction
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$query = isset($condition['query']) ? strtolower(trim($condition['query'])) : null;
$query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
unset($condition['discount']);
... ... @@ -90,16 +90,15 @@ class SearchController extends AbstractAction
// 跳转到品牌商品列表页
if ($domain !== null) {
$url = Helpers::url('', array(
'from' => 'search',
'query' => $query,
'gender' => $condition['gender']
), $domain);
$url = Helpers::url('', array(
'from' => 'search',
'query' => $query,
'gender' => $condition['gender']
), $domain);
$this->go($url);
}
}
/* 判断是不是品类, 是品类加导航标题(不显示搜索框) */
if ($haveQuery) {
$classNames = Category\ClassModel::getClassNames();
... ... @@ -148,25 +147,25 @@ class SearchController extends AbstractAction
$data['goodList'] = $condition;
$data['query'] = $query;
// 查询数据
if (!isset($condition['query'])) {
$data['goodList'] += Product\ListModel::getClassData($condition);
} else {
$listData = SearchData::searchByCondition($condition);
// 处理返回的数据
if (!empty($listData['data']['brand'])) {
$brandData = $listData['data']['brand'];
$data['brandWay'] = array(
'url' => 'http://' . $brandData['brand_domain'] . SUB_DOMAIN,
'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
'name' => $brandData['brand_name']
);
// 设置品牌默认值
$data['goodList']['brand'] = $brandData['id'];
$data['goodList'] += ListProcess::getListData($listData['data']);
}
$listData = array();
}
// // 查询数据
// if (!isset($condition['query'])) {
// $data['goodList'] += Product\ListModel::getClassData($condition);
// } else {
// $listData = SearchData::searchByCondition($condition);
// // 处理返回的数据
// if (!empty($listData['data']['brand'])) {
// $brandData = $listData['data']['brand'];
// $data['brandWay'] = array(
// 'url' => 'http://' . $brandData['brand_domain'] . SUB_DOMAIN,
// 'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
// 'name' => $brandData['brand_name']
// );
// // 设置品牌默认值
// $data['goodList']['brand'] = $brandData['id'];
// $data['goodList'] += ListProcess::getListData($listData['data']);
// }
// $listData = array();
// }
$this->_view->display('list', $data);
}
... ...
... ... @@ -57,6 +57,8 @@ class BrandModel
$result['brandPage'] = true;
// 是否显示app下载浮层标识
$result['showDownloadApp'] = true;
// 搜索链接地址
$result['searchUrl'] = Helpers::url('/search.html', null, 'search');
/* 顶部的轮翻广告列表 */
if (!empty($brand['brandTop'][0]['data'])) {
... ...
... ... @@ -138,7 +138,6 @@ class IndexModel
$build['type'] = $value['name'];
$build['focus'] = ($value['id'] == $type);
$data['navs'][] = $build;
$data['guang']['infos'][] = array(
'show' => $build['focus'],
'info' => array(),
... ... @@ -155,6 +154,19 @@ class IndexModel
$data['guang']['swiper'][] = $build;
}
}
// 只有当$type=0时才有广告参数返回, 所以需要再调一次!!
else {
$temp = ListData::article('1,3', 0, 0, '', $page);
if (!empty($temp['data']['list']['adlist'])) {
foreach ($temp['data']['list']['adlist'] as $value) {
$build = array();
$build['url'] = Helpers::getFilterUrl($value['url']);
$build['img'] = Helpers::getImageUrl($value['src'], 830, 327);
$data['guang']['swiper'][] = $build;
}
}
$temp = array();
}
// 内容列表
if (!empty($article['data']['list']['artList'])) {
... ...
... ... @@ -168,7 +168,7 @@ class HomeModel
// 调用接口获取楼层数据, 并封装成模板渲染需要的数据格式
$channelData = IndexData::getResourceData('2,3', self::CODE_FLOOR_GIRLS);
if (isset($channelData['code']) && $channelData['code'] == 200) {
$result = FloorProcess::getContent($channelData['data']);
$result = FloorProcess::getContent($channelData['data'], 2);
}
if (USE_CACHE) {
... ...