Authored by 周少峰

Merge branch 'feature/branchOptmztn' of http://git.dev.yoho.cn/web/yohobuywap in…

…to feature/branchOptmztn
... ... @@ -18,7 +18,8 @@ var swiper,
$searchAction = $('.search-action'),
hotBrandsSwiper;
$brandItem = $('.brandNav li'),
$brandWall = $('.branding-wall');
$newBrandWall = $('.recommand-brand-wall'),
$recommandBrandWall = $('.recommand-brand-wall');
var searchH = $('.newbrand-search').outerHeight(),
headerH = $('.yoho-header').outerHeight(),
... ... @@ -243,62 +244,74 @@ if ($brandItem.length > 0 ) {
if (index === 0){
$brandWall.not('.hide').addClass('hide');
$recommandBrandWall.not('.hide').addClass('hide');
$newBrandWall.not('.hide').addClass('hide');
$brandList.removeClass('hide');
}else if (index === 1){
$brandList.not('.hide').addClass('hide');
$newBrandWall.removeClass('hide');
$recommandBrandWall.not('.hide').addClass('hide');
}else {
$brandList.not('.hide').addClass('hide');
$brandWall.eq(index).removeClass('hide');
$recommandBrandWall.removeClass('hide');
$newBrandWall.not('.hide').addClass('hide');
}
});
}
//搜索页面
chHammer = new Hammer($clearHistory[0]);
chHammer.on('tap', function() {
localStorage.removeItem('historys-brand');
$history.html('');
$historySearch.hide();
$clearHistory.hide();
window.rePosFooter();
});
//初始化历史搜索的内容
(function() {
var html = '',
history,
historys, i,
brand,url,locate;
if ($('.brand-search-page').length) {
if (localStorage) {
historys = localStorage.getItem('historys-brand');
chHammer = new Hammer($clearHistory[0]);
chHammer.on('tap', function() {
localStorage.removeItem('historys-brand');
if (historys && historys.length > 0) {
historys = historys.split(ranToken);
for (i = (historys.length >= 10) ? 10 :historys.length; i > 0; i--) {
history = historys[i - 1];
$history.html('');
$historySearch.hide();
$clearHistory.hide();
if (history === '') {
continue;
}
locate = history.indexOf("http://");
brand = history.substr(0,locate);
url = history.substr(locate,history.length-locate);
window.rePosFooter();
});
html += '<li><a href="' + url + '">' + brand + '</li>';
$historySearch.removeClass('hide');
}
//搜索页面
(function () {
var html = '',
history,
historys, i,
brand, url, locate;
if (localStorage) {
historys = localStorage.getItem('historys-brand');
$history.html(html);
$clearHistory.removeClass('hide');
if (historys && historys.length > 0) {
historys = historys.split(ranToken);
for (i = (historys.length >= 10) ? 10 : historys.length; i > 0; i--) {
history = historys[i - 1];
$hotSearch.removeClass('hide');
window.rePosFooter();
if (history === '') {
continue;
}
locate = history.indexOf("http://");
brand = history.substr(0, locate);
url = history.substr(locate, history.length - locate);
html += '<li><a href="' + url + '">' + brand + '</li>';
$historySearch.removeClass('hide');
}
$history.html(html);
$clearHistory.removeClass('hide');
$hotSearch.removeClass('hide');
window.rePosFooter();
}
}
}
}());
}());
}
//writeSearch.bindWirteLocal($form);
\ No newline at end of file
... ...
... ... @@ -82,7 +82,7 @@
height: 90%;
overflow: hidden;
li{
width: 25%;
width: 33%;
height: 100%;
overflow: hidden;
float: left;
... ... @@ -299,6 +299,28 @@
}
}
.branding-wall{
margin-top: 20px;
padding: 0px;
width:98%;
margin-left: 1%;
}
.brand-wall-box{
margin-top: 20px;
width: 32%;
display: inline-block;
}
.brand-name{
text-align: center;
vertical-align: middle;
font-size: 26px;
line-height: 44px;
color: #b8b8b8;
}
.right-bar {
width: 60px;
height: 75%;
... ...
... ... @@ -191,5 +191,9 @@
.hot-search{
margin-top: 20px;
}
.clearfix{
margin-left: 30px;
}
}
}
\ No newline at end of file
... ...
... ... @@ -36,12 +36,18 @@
<div class="brandNav">
<ul>
{{# channels}}
<li {{#if active}}class="active"{{/if}} data-id="{{@index}}">
<span>{{name}}</span>
<span class="split-border"></span>
</li>
{{/channels}}
<li class="allbrand active" data-id="0">
<span>全部品牌</span>
<span class="split-border"></span>
</li>
<li class="newbrand" data-id="1">
<span>新入驻品牌</span>
<span class="split-border"></span>
</li>
<li class="recommandbrand" data-id="2">
<span>推荐品牌</span>
<span class="split-border"></span>
</li>
</ul>
</div>
<div class="second-level-brand">
... ... @@ -65,15 +71,32 @@
</div>
{{/ brandList}}
{{# brandWall}}
<div class="branding-wall bar-{{@index}}">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}"></img>
<div class="brand-name">{{brandName}}</div>>
</a>
{{# newBrandWall}}
<div class="new-brand-wall branding-wall">
{{# list}}
<div class="brand-wall-box">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}"></img>
<div class="brand-name">{{brandName}}</div>
</a>
</div>
{{/ list}}
</div>
{{/ brandWall}}
</div>>
{{/ newBrandWall}}
{{# recommandBrandWall}}
<div class="recommand-brand-wall branding-wall">
{{# list}}
<div class="brand-wall-box">
<a href="{{url}}">
<img class="lazy" data-original="{{img}}"></img>
<div class="brand-name">{{brandName}}</div>
</a>
</div>
{{/ list}}
</div>
{{/ recommandBrandWall}}
</div>
</div>
... ...
... ... @@ -43,6 +43,81 @@ class BrandController extends AbstractAction
// tar test 1505061525
$code = 'ce6ac059493ec26241a8cbe0bfa1b17a';
$channel = Category\BrandModel::getBrandByChannel($code,$channel);
/* //测试数据
$channel = array(
'newBrandWall' => array(
'list' => array(
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
),
),
'recommandBrandWall' => array(
'list' => array(
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
array(
'url' => 'www.baidu.com',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/14/03/02137e5cbcd5336c831550939ca70ba9a5.jpg?imageView2/2/w/640/h/240',
'brandName' => 'wangTest'
),
),
)
);*/
// \Plugin\DataProcess\CouponFloorProcess::debugOut($channel);
// 渲染模板
$this->_view->display('index', array(
... ...