Authored by xuqi

new

... ... @@ -21,6 +21,33 @@
</div>
<div class="list-right pull-right">
{{# newMain}}
<div class="new-banner">
<a href="{{bannerHref}}">
<img src="{{banner}}">
</a>
</div>
<div class="new-brands clearfix">
<span class="iconfont pre">&#xe607;</span>
<div class="brands-wrap">
<ul class="brands">
{{# brands}}
<li>
<a href="{{href}}">
<img src="{{logo}}">
</a>
</li>
{{/ brands}}
</ul>
</div>
<span class="iconfont next">&#xe608;</span>
</div>
<div class="new-floor-title">
<span class="date">{{date}}</span>
<span class="title">{{title}}</span>
</div>
{{/ newMain}}
{{> product/standard-content}}
</div>
</div>
... ...
... ... @@ -16,3 +16,53 @@ require('./product');
//最近浏览的商品Lazyload
lazyLoad($('.latest-walk .lazy'));
(function() {
var $brands = $('.brands');
var wrapWidth,
$firstBrand,
totalWidth,
perWidth;
if ($brands.length === 0) {
return;
}
wrapWidth = $('.brands-wrap').width();
$firstBrand = $brands.children('li:first-child');
perWidth = $firstBrand.width() + $firstBrand.css('margin-left').replace('px', '') * 1;
totalWidth = perWidth * $brands.children('li').length;
//针对NEW页面Header的brand banner切换
$('.new-brands').on('click', '.pre,.next', function() {
var $this = $(this),
left;
left = $brands.css('left');
if (left === 'auto') {
left = 0;
} else {
left = +left.replace('px', '');
}
if (($this).hasClass('pre')) {
//左边界
if (left + wrapWidth > 0) {
return;
}
$brands.css('left', left + wrapWidth + 'px');
} else {
//右边界
if (left - wrapWidth < -totalWidth) {
return;
}
$brands.css('left', left - wrapWidth + 'px');
}
});
}());
\ No newline at end of file
... ...
... ... @@ -28,4 +28,110 @@
border-top: 1px dotted #999;
}
}
.new-banner img {
display: block;
width: 100%;
}
.new-brands {
position: relative;
width: 100%;
margin-top: 25px;
> * {
float: left;
}
.pre, .next {
position: absolute;
display: block;
width: 40px;
height: 40px;
line-height: 40px;
color: #fff;
background: #e0e0e0;
text-align: center;
top: 50%;
margin-top: -20px;
cursor: pointer;
opacity: 0.8;
filter: Alpha(opacity=80);
&:hover {
opacity: 0.9;
filter: Alpha(opacity=90);
}
}
.pre {
left: 0;
}
.next {
right: 0;
}
.brands-wrap {
position: relative;
overflow: hidden;
width: 890px;
height: 76px;
margin-left: 40px;
}
.brands {
position: absolute;
width: auto;
height: 76px;
}
.brands li {
float: left;
margin-left: 14px;
a {
display: block;
width: 164px;
height: 76px;
line-height: 76px;
vertical-align: middle;
text-align: center;
}
img {
vertical-align: middle;
max-width: 100%;
max-height: 100%;
border: none;
}
}
}
.new-floor-title {
position: relative;
margin: 35px auto;
width: 300px;
height: 31px;
line-height: 31px;
font-size: 18px;
border: 1px solid #000;
.date {
position: absolute;
left: -1px;
top: -1px;
width: 155px;
height: 33px;
color: #fff;
text-align: center;
background: image-url('product/floor-title.png');
}
.title {
float: right;
margin-right: 40px;
}
}
}
\ No newline at end of file
... ...
... ... @@ -958,6 +958,7 @@ class IndexController extends AbstractAction
public function newSaleAction()
{
$data = array(
'productListPage' => true,
'newSale' => array(
'banner' => array(
'bannerHeight' => 350,
... ... @@ -966,6 +967,36 @@ class IndexController extends AbstractAction
'title' => array(
'name' => '全部商品',
'count' => 540
),
'newMain' => array(
'banner' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/23/07/010a459d41b99a839cba9377532f1c19b2.jpg?imageView/3/w/970/h/200',
'date' => '12月16日',
'title' => '新品到着',
'brands' => array(
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/02/28/15/02b2b5ded161ab31e2e097a327ed475052.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/11/09/09/023721f44182f775d79904010af421331e.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2012/12/13/17/01408fb72646c8f3fa59d870514f08a356.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/12/24/13/0265b45e37af697c5ba12d5415fb341f27.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/11/15/012d09a5cae187af1f6f3ed246b9b5a4fc.jpg?imageView/2/w/170/h/120'
),
array(
'href' => '',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/20/16/01047ffb3ca182871821d551af31ac2378.jpg?imageView/2/w/170/h/120'
)
)
),
'filters' => array(
... ... @@ -1318,6 +1349,7 @@ class IndexController extends AbstractAction
),
'totalCount' => '2259',
'pager' => '<a href="" class="cur"><span>1</span></a><a href=""><span>2</span></a><a href="" title="下一页">下一页<span class="iconfont">&gt;</span></a>'
)
);
$this->_view->display('new-sale', $data);
... ...