Authored by 王水玲

sale

... ... @@ -70,12 +70,30 @@ exports.specialDetail = (req, res) => {
let headerData = headerModel.setNavHeader('折扣专场');
let renderData = {
module: 'product',
page: 'sale',
page: 'special',
pageHeader: headerData,
pageFooter: true
};
saleModel.getSpecialDetailData().then((result) => {
result = {
src: 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/0239e814b8121913aa67b9ad509bd4e310.jpg?imageView2/2/w/{width}/h/{height}',
goods: {
url: 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
thumb: 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
name: 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
salePrice: '759.00',
price: '799.00',
tags: {
isNew: true,
isAdvance: false,
isDiscount: false,
isYohoood: false,
isLimited: false
},
isSoonSoldOut: true
}
};
res.render('special-detail', Object.assign(renderData, result));
}).catch((err) => {
saleLogger(err, res);
... ... @@ -118,3 +136,40 @@ exports.breakCode = (req, res) => {
saleLogger(err, res);
});
};
/**
* vip
*/
exports.vip = (req, res) => {
let headerData = headerModel.setNavHeader('会员专享');
let renderData = {
module: 'product',
page: 'break-code',
pageHeader: headerData,
pageFooter: true
};
saleModel.getVipData().then((result) => {
result = {
src: 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/0239e814b8121913aa67b9ad509bd4e310.jpg?imageView2/2/w/{width}/h/{height}',
goods: {
url: 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
thumb: 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
name: 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
salePrice: '759.00',
price: '799.00',
tags: {
isNew: true,
isAdvance: false,
isDiscount: false,
isYohoood: false,
isLimited: false
},
isSoonSoldOut: true
}
};
res.render('vip', Object.assign(renderData, result));
}).catch((err) => {
saleLogger(err, res);
});
}
... ...
... ... @@ -132,3 +132,23 @@ exports.getBreakCodeData = (params) => {
}
});
};
/**
* 获取会员享数据
* @param {[object]} params
* @return {[object]}
*/
exports.getVipData = (params) => {
return api.get('', sign.apiSign(Object.assign({
method: 'app.activity.get',
sort: 2,
plateform: 2
}, params))).then((result) => {
if (result && result.code === 200) {
return camelCase(result.data);
} else {
return Promise.reject('error');
}
});
}
\ No newline at end of file
... ...
... ... @@ -25,5 +25,7 @@ router.get('/sale', sale.index);
router.get('/special', sale.special);
router.get('/specialDetail', sale.specialDetail);
router.get('/breakCode', sale.breakCode);
router.get('/vip', sale.vip);
// router.get('/outlet', sale.outlet);
module.exports = router;
... ...
... ... @@ -51,7 +51,7 @@
<div id="goods-container" class="goods-container">
<div class="new-goods container clearfix">
{{# goods}}
{{> common/good}}
{{> common/goods}}
{{/ goods}}
</div>
<div class="price-goods container hide clearfix"></div>
... ...
<div class="sale-channel-page yoho-page">
<div class="banner">
<img src="{{image src 640 250}}"/>
<span class="activity-time"><i class="iconfont time-ico">&#xe603;</i>{{time}}</span>
</div>
<div class="sale-channel-page discount-page yoho-page">
{{> product/sale-common}}
</div>
\ No newline at end of file
... ...
<div class="sale-vip-page discount-page yoho-page">
{{> product/sale-common}}
</div>
\ No newline at end of file
... ...
<div class="banner">
<img src="{{image src 640 200}}"/>
<p class="activity-time" data-time-ms = '{{msTime}}'><i class="iconfont time-ico">&#xe603;</i><span>剩1天2小时38分4秒</span></p>
</div>
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
<span class="span-test">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
<span class="span-test">价格</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
<span class="span-test">折扣</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
<span class="span-test">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
<div id="goods-container" class="goods-container">
<div class="new-goods container clearfix">
{{# goods}}
{{> common/goods}}
{{/ goods}}
</div>
<div class="price-goods container hide clearfix"></div>
<div class="discount-goods container hide clearfix"></div>
{{> common/filter}}
</div>
{{> common/query-param}}
{{> common/suspend-cart}}
\ No newline at end of file
... ...
... ... @@ -32,11 +32,19 @@
<a href="{{url}}">{{name}}</a>
</div>
<div class="price">
{{#if saleViplogin}}
<i class="vip-grade-{{vipGrade}}"></i>
{{/if}}
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}
<span class="market-price">¥{{.}}</span>
{{/price}}
</div>
{{#if saleVip}}
<div class="vip-info">
<i class="vip-icon"></i>更优惠
</div>
{{/if}}
</div>
</div>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -3,8 +3,40 @@
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/5/20
*/
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
var $activityTime = $('.activity-time');
lazyLoad($('img.lazy'));
function getRTime(){
// var EndTime = $activityTime.data('time-ms'),
var EndTime = 1463743993785,
NowTime = new Date(),
t = EndTime - NowTime.getTime(),
anHour = 3600000,
anMinute = 60000,
anSecond = 1000,
showTime = '',
d = 0,
h = 0,
m = 0,
s = 0;
if (t >= 0) {
d = Math.floor(t / anHour / 24);
h = Math.floor(t / anHour % 24);
m = Math.floor(t / anMinute % 60);
s = Math.floor(t / anSecond % 60);
}
showTime += d > 0 ? d + '剩天' : '';
showTime += h > 0 ? h + '小时' : '';
showTime += m > 0 ? m + '分钟' : '';
showTime += s > 0 ? s + '秒' : '';
$activityTime.find('span').html(showTime);
}
setInterval(getRTime,0);
... ...
... ... @@ -12,6 +12,7 @@
@import "product/recommend-for-you";
@import "product/sale";
@import "product/special";
@import "product/special-detail";
@import "product/break-code";
@import "product/discount";
@import "product/good";
... ...
... ... @@ -128,4 +128,44 @@
text-decoration: line-through;
}
}
.vip-grade {
width: 52px;
height: 32px;
display: inline-block;
margin-right: 8px;
vertical-align: text-bottom;
}
.vip-grade-golden {
background: resolve('product/golden.png') no-repeat;
background-size: contain;
}
.vip-grade-platinum {
background: resolve('product/platinum.png') no-repeat;
background-size: contain;
}
.vip-grade-silver {
background: resolve('product/silver.png') no-repeat;
background-size: contain;
}
.vip-info {
margin-top: 19px;
line-height: 32px;
font-size: 18px;
color: #444;
.vip-icon {
width: 88px;
height: 32px;
background: resolve('product/vip-icon.png') no-repeat;
background-size: contain;
display: inline-block;
vertical-align: bottom;
margin-right: 8px;
}
}
}
... ...
.sale-channel-page {
.banner {
position: relative;
height: auto;
overflow: hidden;
.activity-time {
width: 100%;
height: 50px;
position: absolute;
bottom: 0;
left: 0;
z-index: 2;
background: rgba(0, 0 ,0 , .5);
text-align: right;
color: #fff;
font-size: 22px;
line-height: 50px;
padding-right: 28px;
box-sizing: border-box;
.time-ico {
margin-right: 15px;
font-size: 26px;
vertical-align: text-bottom;
}
span {
vertical-align: super;
}
}
}
}
\ No newline at end of file
... ...