Authored by 梁志锋

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

... ... @@ -627,4 +627,30 @@
{
areaCode: '',
phoneNum: ''
}
## 分类
{
searchUrl: '',
class: [
{
name: 'BOY',
focus: true, //默认选中
ca: [
{
name: '上衣',
sub: [
{
name: '全部分类',
url: ''
},
...
]
},
...
]
},
...
]
}
\ No newline at end of file
... ...
... ... @@ -48,21 +48,6 @@ class IndexData
}
/**
* 获取启动页频道数据
*
* @return array 启动页频道有关数据
*/
public static function getHomeChannels()
{
// 构建必传参数
$param = Yohobuy::param();
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL.'operations/api/v5/category/getCategory', $param);
}
/**
* 获取用户个人信息
*
* @param integer $uid 用户ID
... ...
/**
* 分类
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/14
*/
var $ = require('yoho.zepto');
var $nav = $('.category-nav'),
$contents = $('.category-container > .content');
var $curContent = $contents.not('.hide');
$('#search-input').focus(function() {
$(this).blur();
});
$nav.delegate('li', 'touchstart', function() {
var $this = $(this),
index = $this.index();
if ($this.hasClass('focus')) {
return;
}
$nav.find('li.focus').removeClass('focus');
$this.addClass('focus');
$curContent.addClass('hide');
$curContent = $contents.eq(index).removeClass('hide');
});
$('.primary-level').delegate('li', 'touchstart', function() {
var $this = $(this),
index = $this.index();
var $subLevel = $this.closest('.content').find('.sub-level');
if ($this.hasClass('focus')) {
return;
}
$this.closest('.primary-level').children('.focus').removeClass('focus');
$this.addClass('focus');
$subLevel.not('.hide').addClass('hide');
$subLevel.eq(index).removeClass('hide');
});
\ No newline at end of file
... ...
.category-page {
font-size: 30rem / $pxConvertRem;
.search-input {
position: relative;
background-color: #f8f8f8;
padding: 13rem / $pxConvertRem 20rem / $pxConvertRem;
p {
box-sizing: border-box;
width: 100%;
height: 60rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
border: none;
padding-left: 53rem / $pxConvertRem;
border-radius: 60rem / $pxConvertRem;
font-size: 30rem / $pxConvertRem;
background: #fff;
color: #999;
}
}
.search-icon {
position: absolute;
top: 0;
bottom: 0;
left: 43rem / $pxConvertRem;
line-height: 86rem / $pxConvertRem;
color: #999;
}
.category-nav {
height: 71rem / $pxConvertRem;
border-bottom: 1px solid #e6e6e6;
li {
display: block;
float: left;
height: 100%;
line-height: 71rem / $pxConvertRem;
width: 25%;
text-align: center;
border-right: 1px solid #e6e6e6;
color: #999;
&:last-child {
border-right: none;
}
&.focus {
color: #000;
}
}
}
.content.hide {
display: none;
}
.primary-level {
float: left;
box-sizing: border-box;
width: 40%;
background: #f8f8f8;
> li {
height: 69rem / $pxConvertRem;
line-height: 69rem / $pxConvertRem;
padding-left: 32rem / $pxConvertRem;
&.focus {
background-color: #fff;
}
}
}
.sub-level-container {
float: left;
box-sizing: border-box;
padding-left: 20rem / $pxConvertRem;
background: #fff;
width: 60%;
}
.sub-level {
width: 100%;
&.hide {
display: none;
}
> li {
height: 71rem / $pxConvertRem;
line-height: 71rem / $pxConvertRem;
border-bottom: 1px solid #e6e6e6;
&:last-child {
border-bottom: none;
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -88,4 +88,4 @@ a {
@include border-radius(10px);
}
@import "layout/header", "layout/footer", "good", "passport/index", "guang/index", "homepage/index";
\ No newline at end of file
@import "layout/header", "layout/footer", "good", "passport/index", "guang/index", "homepage/index", "category/index";
\ No newline at end of file
... ...
{{> layout/header}}
<div class="category-page yoho-page">
{{# category}}
<div id="search-input" class="search-input">
<a href={{searchUrl}}>
<i class="search-icon iconfont">&#xe60f;</i>
<p>搜索商品</p>
</a>
</div>
<div class="category-nav clearfix">
{{# class}}
<li class={{#if focus}}focus{{/if}}>
{{name}}
</li>
{{/ class}}
</div>
<div class="category-container clearfix">
{{# class}}
<div class="content {{#unless focus}}hide{{/if}}">
<ul class="primary-level">
{{# ca}}
<li class={{#if @first}}focus{{/if}}>{{name}}</li>
{{/ ca}}
</ul>
<div class="sub-level-container">
{{# ca}}
<ul class="sub-level {{#unless @first}}hide{{/if}}">
{{# sub}}
<li>
<a href={{url}}>
{{name}}
</a>
</li>
{{/ sub}}
</ul>
{{/ ca}}
</div>
</div>
{{/ class}}
</div>
{{/ category}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -89,7 +89,9 @@
</script>
{{/if}}
<script>
seajs.use('js/homePage/girls');
</script>
\ No newline at end of file
{{!-- 品类 --}}
{{#if categoryPage}}
<script>
seajs.use('js/category/index');
</script>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -19,16 +19,7 @@ class BoysController extends AbstractAction
// 设置顶部信息(搜索)
$this->setHomeChannelHeader();
$data = array(
'sideNav' => array(),
'content' => array()
);
$sideDatas = IndexData::getHomeChannels();
if($sideDatas['code'] == 200)
{
$data['sideNav'] = $sideDatas['data'];
}
$data = array();
// 频道数据
$channelData = IndexData::getUserChannelData(0, '1,3', '201504091403001');
... ...
... ... @@ -19,16 +19,7 @@ class GirlsController extends AbstractAction
// 设置顶部信息(搜索)
$this->setHomeChannelHeader();
$data = array(
'sideNav' => array(),
'content' => array()
);
$sideDatas = IndexData::getHomeChannels();
if($sideDatas['code'] == 200)
{
$data['sideNav'] = $sideDatas['data'];
}
$data = array();
// 频道数据
$channelData = IndexData::getUserChannelData(0, '2,3', '201504091403002');
... ... @@ -47,7 +38,6 @@ class GirlsController extends AbstractAction
$num = count($data['content']);
$data['content'][] = array('maybeLike' =>$maybeLike);
}*/
$data = array(
'headerDownload' => array(
... ... @@ -479,7 +469,6 @@ class GirlsController extends AbstractAction
)
));
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('index', $data);
... ...
... ... @@ -6,7 +6,7 @@ use Plugin\FloorProcess;
/**
* 儿童首页
*/
class kidsController extends AbstractAction
class KidsController extends AbstractAction
{
public function indexAction()
... ... @@ -20,16 +20,7 @@ class kidsController extends AbstractAction
// 设置顶部信息(搜索)
$this->setHomeChannelHeader();
$data = array(
'sideNav' => array(),
'content' => array()
);
$sideDatas = IndexData::getHomeChannels();
if($sideDatas['code'] == 200)
{
$data['sideNav'] = $sideDatas['data'];
}
$data = array();
// 频道数据
$channelData = IndexData::getUserChannelData(0, '', 'e9875682c1599a886bfbdb965b740022');
... ...
<?php
use Action\AbstractAction;
<<<<<<< HEAD
use LibModels\Wap\Home\IndexData as Index;
=======
use LibModels\Wap\Home\IndexData;
use Plugin\FloorProcess;
>>>>>>> 3ceb824c00a2188f954835e78b5e4222bf3c78f8
/**
* 创意生活首页
*/
class kidsController extends AbstractAction
class LifestyleController extends AbstractAction
{
public function indexAction()
... ... @@ -25,16 +21,7 @@ class kidsController extends AbstractAction
// 设置顶部信息(搜索)
$this->setHomeChannelHeader();
$data = array(
'sideNav' => array(),
'content' => array()
);
$sideDatas = IndexData::getHomeChannels();
if($sideDatas['code'] == 200)
{
$data['sideNav'] = $sideDatas['data'];
}
$data = array();
// 频道数据
$channelData = IndexData::getUserChannelData(0, '1,3', '9aa25f5133f011ec96c2045eb15ae425');
... ...
<?php
use Action\AbstractAction;
use LibModels\Wap\Category\ClassData;
// use LibModels\Wap\Category\ClassData;
/**
* 品牌
... ... @@ -9,18 +9,89 @@ class ClassController extends AbstractAction
{
public function indexAction()
{
$brandsData = ClassData::getClassesData();
// $brandsData = ClassData::getClassesData();
$classes = array();
if($brandsData['code'] == 200)
{
$classes = $brandsData['data'];
}
// $classes = array();
// if($brandsData['code'] == 200)
// {
// $classes = $brandsData['data'];
// }
echo '<pre>';
var_dump($classes);exit;
// echo '<pre>';
// var_dump($classes);exit;
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('class', compact('classes'));
// $this->_view->assign('title', 'YOHO!有货');
// $this->_view->display('class', compact('classes'));
$data = array(
"searchUrl" => "",
"class" => array(
array(
"name" => "Boy",
"focus" => true,
"ca" => array(
array(
"name" => "上衣",
"sub" => array(
array(
"name" => "全部上衣",
"url" => ""
),
array(
"name" => "卫衣",
"url" => ""
)
)
),
array(
"name" => "裤装",
"sub" => array(
array(
"name" => "全部裤装",
"url" => ""
),
array(
"name" => "牛仔裤",
"url" => ""
)
)
)
)
),
array(
"name" => "Girl",
"ca" => array(
array(
"name" => "裙装",
"sub" => array(
array(
"name" => "全部裙装",
"url" => ""
),
array(
"name" => "短裙",
"url" => ""
)
)
),
array(
"name" => "鞋靴",
"sub" => array(
array(
"name" => "全部鞋靴",
"url" => ""
),
array(
"name" => "休闲鞋",
"url" => ""
)
)
)
)
)
)
);
$this->_view->assign('title', 'YOHO!有货');
$this->_view->display('index', array('categoryPage' => true, 'category' => $data));
}
}
\ No newline at end of file
... ...