Authored by 梁志锋

newfestival home page

... ... @@ -3,9 +3,171 @@
* @author: xuqi(qi.xu@yoho.cn)
* @date: 2015/3/30
*/
module.exports = function(flag) {
module.exports = function (flag) {
switch (flag) {
case 'newstylebrands':
//新品节
case 'newfestival':
return {
slider: [{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/0240f288725106b408d8c524b4d0fba4b9.jpg'
}, {
url: 'http://sale.yohobuy.com/?specialsale_id=11&gender=1,3',
title: '',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d260341d31c084eb93cc.jpg'
}],
banner: {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '单个图片',
imgId: '0',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d260341d31c084eb93cc.jpg'
},
imageList: [{
column_num: 3,
title: "最热推荐",
list: [{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}]
}, {
column_num: 2,
title: "亮点抢先看",
list: [{
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}, {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '',
imgId: '0',
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
}]
}],
banner2: {
url: 'http://www.yohobuy.com/special_8585_0618TEEBOY.html',
title: '',
alt: '单个图片',
imgId: '0',
src: 'http://img13.static.yhbimg.com/taobaocms/2015/06/17/07/02934d7696b187d260341d31c084eb93cc.jpg'
},
newArrival: [{
id: 1,
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/03/08/0244a127c89c1f77ab47f55891e45be1e6.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
name: 'HALFGIRL 插肩棒球服短裙套装',
isLike: true,
price: 478,
salePrice: 208,
isSale: true,
isFew: true,
isNew: false,
url: '',
likeUrl: ''
}, {
id: 2,
src: 'http://img13.static.yhbimg.com/goodsimg/2015/03/02/08/023f696cf1ae78688bc6c8edeccc480c2c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
name: 'GAWS DIGI 丛林数码印花拼接卫衣',
isLike: false,
price: 1268,
salePrice: 589,
isSale: true,
isFew: true,
isNew: false,
url: '',
likeUrl: ''
}, {
id: 3,
src: 'http://img12.static.yhbimg.com/goodsimg/2015/04/20/09/02ef617e5704729b9e8741831d805fac20.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
name: 'CLOTtee 撞色连帽外套',
isLike: false,
price: 488,
salePrice: 139,
isSale: true,
isFew: true,
isNew: false,
url: '',
likeUrl: ''
}, {
id: 4,
src: 'http://img13.static.yhbimg.com/goodsimg/2015/04/03/07/0235b2d48417d0e92b94484d284dca06fc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
name: 'Lee Cooper 蓝色花丛系T恤',
isLike: false,
price: 589,
salePrice: 148,
isSale: false,
isFew: false,
isNew: true,
url: '',
likeUrl: ''
}]
};
case 'newstylebrands':
return {
swiper: [
{
... ...
var $ = require('jquery'),
lazyLoad = require('./common/lazyload'),
Swiper = require('yoho-idangerous.swiper');
new Swiper('.swiper-container', {
pagination: '.swiper-pagination'
});
lazyLoad();
\ No newline at end of file
... ...
.good-info {
float: left;
width: 276rem / $pxConvertRem;
height: 486rem / $pxConvertRem;
margin: 28rem / $pxConvertRem (15rem / $pxConvertRem) 0;
.tag-container {
height: 28rem / $pxConvertRem;
width: 100%;
overflow: hidden;
.good-tag {
display: block;
float: left;
height: 28rem / $pxConvertRem;
font-size: 18rem / $pxConvertRem;
text-align: center;
line-height: 28rem / $pxConvertRem;
box-sizing: border-box;
margin-right: 4rem / $pxConvertRem;
&:last-child {
margin-right: 0;
}
}
.new-tag {
width: 60rem / $pxConvertRem;
background-color: #78dc7e;
color: #fff;
}
.renew-tag {
width: 90rem / $pxConvertRem;
background-color: #78dc7e;
color: #fff;
}
.sale-tag {
width: 60rem / $pxConvertRem;
background-color: #ff575c;
color: #fff;
}
.yohood-tag {
width: 90rem / $pxConvertRem;
background: image-url('yohood.png') no-repeat;
background-size: 100% 100%;
}
.limit-tag {
width: 90rem / $pxConvertRem;
border: 1px solid #000;
color: #000;
}
}
}
.good-detail-img {
position: relative;
.good-islike {
position: absolute;
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
top: 0rem / $pxConvertRem;
right: 0rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
font-size: 30rem / $pxConvertRem;
text-align: center;
color: #b0b0b0;
text-decoration: none;
}
.good-like {
color: #d72928;
}
img {
display: block;
width: 100%;
height: 366rem / $pxConvertRem;
}
.few-tag {
position: absolute;
bottom: 0;
width: 100%;
height: 28rem / $pxConvertRem;
background: #ffac5b;
font-size: 18rem / $pxConvertRem;
color: #fff;
line-height: 28rem / $pxConvertRem;
text-align: center;
}
}
.good-detail-text {
.name a {
display: block;
line-height: 56rem / $pxConvertRem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-decoration: none;
font-size: 22rem / $pxConvertRem;
color: #444;
}
.price {
line-height: 22rem / $pxConvertRem;
font-size: 22rem / $pxConvertRem;
.sale-price {
color: #d62927;
}
.sale-price.no-price {
color: #000;
}
.market-price {
margin: 0 0 0 (5rem / $pxConvertRem);
color: #b0b0b0;
text-decoration: line-through;
}
}
}
\ No newline at end of file
... ...
@import "common/common","common/grid","common/swiper", "newfestival/brand","error/error";
@import "common/common","common/grid","common/swiper", "newfestival/brand","error/error", "newfestival/newfestival";
//恢复样式覆盖
b {
... ...
@import "../common/good-info";
.newfestival-container {
.newfestival-block {
margin-bottom: 30rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
background-color: #fff;
}
.img-container {
width: 100%;
display: block;
.img {
width: 100%;
height: 100%;
}
}
.new-arrival {
padding-left: 0 30rem / $pxConvertRem;
.new-arrival-header {
text-align: center;
height: 70rem / $pxConvertRem;
.header-text {
font-size: 28rem / $pxConvertRem;
color: #9e9e9e;
line-height: 250%;
}
}
.new-arrival-content {
border-top: 1px solid #e0e0e0;
padding: 20rem / $pxConvertRem 14rem / $pxConvertRem;
}
}
.newfestival-recom-3 {
.newfestival-recom-item {
position: relative;
box-sizing: border-box;
float: left;
width: 213.3rem / $pxConvertRem;
height: 213.3rem / $pxConvertRem;
.img-wrapper {
position: absolute;
top: 0;
left: 0;
z-index: 0;
display: block;
width: 100%;
height: 100%;
img {
width: 100%;
height: 100%;
}
}
}
}
.newfestival-recom-2 {
.newfestival-recom-item {
position: relative;
box-sizing: border-box;
float: left;
width: 320rem / $pxConvertRem;
height: 320rem / $pxConvertRem;
.img-wrapper {
position: absolute;
top: 0;
left: 0;
z-index: 0;
display: block;
width: 100%;
height: 100%;
img {
width: 100%;
height: 100%;
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -10,5 +10,6 @@ var controllerPath = './views/controller/',
module.exports = function(app) {
//router here
app.get('/newfestival', newfestival.home);
app.get('/newfestival/brand', newfestival.brand);
};
\ No newline at end of file
... ...
... ... @@ -5,6 +5,16 @@
*/
var data = require('../../public/js/data'),
brandsdata = data('newstylebrands');
newfestivaldata = data('newfestival');
//新品节首页
exports.home = function(req, res) {
res.render('pages/newfestival', {
data: newfestivaldata,
layout: '../layouts/layout',
isNewFestival: 'NewFestival'
});
};
//新品节品牌
exports.brand = function(req, res) {
... ...
<div class="newfestival-container">
{{# data}}
<div class="swiper-container newfestival-block">
<div class="swiper-wrapper">
{{# slider}}
<div class="swiper-slide">
<a href="{{url}}">
<img src="{{src}}" alt="">
</a>
</div>
{{/ slider}}
</div>
<div class="swiper-pagination"></div>
</div>
{{# banner}}
<div class="newfestival-block clearfix" data-id="{{imgId}}">
<a class="img-container" href="{{url}}">
<img class="img lazy" data-original="{{src}}" alt="">
</a>
</div>
{{/ banner}}
{{# imageList}}
<div class="new-arrival newfestival-block newfestival-recom-{{column_num}} clearfix">
<div class="new-arrival-header">
<span class="header-text"> {{title}}</span>
</div>
{{# list}}
<div class="newfestival-recom-item">
<a href="{{url}}" class="img-wrapper">
<img class="lazy" data-original="{{src}}" alt="">
</a>
</div>
{{/ list}}
</div>
{{/ imageList}}
{{# banner2}}
<div class="newfestival-block clearfix" data-id="{{imgId}}">
<a class="img-container" href="{{url}}">
<img class="img lazy" data-original="{{src}}" alt="">
</a>
</div>
{{/ banner2}}
<div class="new-arrival newfestival-block clearfix">
<div class="new-arrival-header">
<span class="header-text">最新单品推荐</span>
</div>
<div class="new-arrival-content">
{{# newArrival}}
{{> common/good_info}}
{{/ newArrival}}
</div>
</div>
{{/ data}}
</div>
\ No newline at end of file
... ...
<div class="good-info" data-id="{{id}}">
<div class="tag-container clearfix">
{{# tags}}
{{# isNew}}
<p class="good-tag new-tag">NEW</p>
{{/ isNew}}
{{# isReNew}}
<p class="good-tag renew-tag">再到着</p>
{{/ isReNew}}
{{# isSale}}
<p class="good-tag sale-tag">SALE</p>
{{/ isSale}}
{{# isYohood}}
<div class="good-tag yohood-tag"></div>
{{/ isYohood}}
{{# isLimit}}
<p class="good-tag limit-tag">限量商品</p>
{{/ isLimit}}
{{/ tags}}
</div>
<div class="good-detail-img">
<a class="good-islike {{# isLike}}good-like{{/ isLike}} iconfont" href="{{likeUrl}}">&#xe605;</a>
<a class="good-thumb" href="{{url}}">
<img class="lazy" data-original="{{thumb}}">
</a>
{{# isFew}}
<p class="few-tag">即将售罄</p>
{{/ isFew}}
</div>
<div class="good-detail-text">
<div class="name">
<a href="{{url}}">{{name}}</a>
</div>
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}
<span class="market-price">¥{{.}}</span>
{{/price}}
</div>
</div>
</div>
\ No newline at end of file
... ...
<script src="http://localhost:8000/public/js/new-festival.js"></script>
<script type="text/javascript">
seajs.use('public/js/new-festival');
</script>
\ No newline at end of file
... ...
... ... @@ -7,6 +7,12 @@
</script>
<!-- <script src="http://localhost:8000/public/dist/libs-dev.js"></script>-->
{{! 根据标识字段添加模块对应JS入口文件}}
{{! 新品节}}
{{# isNewFestival}}
{{> footer_js/new_festival}}
{{/ isNewFestival}}
{{! 品牌}}
{{# isBrand}}
{{> footer_js/brand}}
... ...