Authored by 郭成尧

Merge branch 'feature/sale' of git.yoho.cn:fe/yohobuy-node into feature/sale

 the commit.
... ... @@ -6,7 +6,7 @@
'use strict';
// const headerModel = require('../../../doraemon/models/header');
const headerModel = require('../../../doraemon/models/header');
// 开发用模拟数据
const outletsSimulation = require('../models/simulation');
... ... @@ -268,3 +268,65 @@ exports.channel = (req, res) => {
// res.render('outlets/channel', response);
};
/**
* outlets 活动
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.special = (req, res) => {
let params = req.query;
let resData = {
module: 'product',
page: 'outlets',
devEnv: true
};
resData.mainBanner = {
list: [
{
href: '#',
img: 'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
},
{
href: '#',
img: 'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
}
],
href: '#',
img: 'http://img10.static.yhbimg.com/brandBanner/2014/11/24/07/01ff74fb2a33764c2fd18b3c8a60f5beef.jpg'
};
resData.specialHead = {
logo: 'http://img10.static.yhbimg.com/brandLogo/2012/08/02/15/0119ad6a2407f5505268688a470d6f6c13.jpg',
special: '精品上装专场',
discount: '8',
title: '全部商品',
count: '123533',
limit: '20000'
};
headerModel.requestHeaderData().then(headerData => {
resData = Object.assign(resData, headerModel.setHeaderData(headerData.data, 'outlets'));
if (!params.id) {
resData.pageErr = true;
}
res.render('outlets/special', resData);
// outlets.getOutletsSpecialData(params).then(result => {
// res.render('outlets/special', resData);
// });
}).catch(() => {
resData.pageErr = true;
res.render('error', resData);
});
};
... ...
... ... @@ -28,6 +28,7 @@ router.get('/sale/goods', sale.getGoodsList); // ajax 获取商品列表
// 奥特莱斯routers
router.get('/outlets/index', outlets.index);
router.get('/outlets/special/detail', outlets.special);
router.get('/outlets/:channel', outlets.channel);
module.exports = router;
... ...
<div class="outlets-special-page outlets-page yoho-page">
{{> common/main-banner}}
<div class="center-content clearfix">
{{> common/special-head}}
<div class="list-left left">
{{> product/left-content}}
</div>
<div class="list-right right">
{{> product/standard-content}}
</div>
</div>
</div>
... ...
{{# mainBanner}}
<div class="main-banner"{{#unless list}} style="background:url({{image img 1920 450}}) no-repeat top center;"{{/unless}}>
{{#if list}}
<ul>
{{# list}}
<li class="banner-img" style="background:url({{image img 1920 450}}) no-repeat top center;">
{{#if href}}
<a href="{{href}}"></a>
{{/if}}
</li>
{{/ list}}
</ul>
{{^}}
{{#if href}}
<a href="{{href}}"></a>
{{/if}}
{{/if}}
</div>
{{/ mainBanner}}
\ No newline at end of file
... ...
{{# specialHead}}
<div class="special-head">
<div class="special-limit">
<span class="iconfont">&#xe60a;</span>
<label class="time" data-limit="{{limit}}">仅剩22小时30分10秒</label>
</div>
<div class="special-name">
<img src="{{logo}}">
{{special}}
<span><i>{{discount}}</i>折起</span>
</div>
<div class="special-title">
{{title}}
<label class="all-count">
{{count}}个结果
</label>
</div>
</div>
{{/ specialHead}}
\ No newline at end of file
... ...
{{# headerData}}
<div class="yoho-header {{headtype}}">
<div class="yoho-header {{headType}}">
<div class="tool-wrapper clearfix">
<div class="center-content">
<div class="yoho-group-map left">
... ... @@ -62,6 +62,7 @@
</div>
<div class="head-wrapper clearfix">
<div class="center-content">
<div class="outlets-logo"></div>
<div class="main-logo"><a href="http://www.yohobuy.com/" class="main-link"></a></div>
<ul class="main-nav-list">
{{# navbars}}
... ...
... ... @@ -280,7 +280,27 @@
margin: 0 auto;
}
}
.main-banner {
height: 360px;
ul {
width: 100%;
height: 100%;
position: relative;
}
li {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
}
}
}
@import "channel";
@import "special";
@import "main-product";
... ...
.outlets-special-page {
.main-banner {
height: 360px;
}
.special-head {
margin: 15px 0;
border-bottom: 1px dashed #ccc;
.special-limit {
float: right;
line-height: 38px;
}
.special-name {
height: 40px;
line-height: 40px;
font-size: 20px;
img {
width: 100px;
height: 40px;
vertical-align: top;
}
span {
font-size: 16px;
}
i {
font-weight: bold;
font-style: italic;
color: #fe575d;
font-size: 26px;
position: relative;
top: 3px;
margin: 0 8px 0 2px;
}
}
.special-title {
font-size: 22px;
height: 34px;
text-align: center;
}
.all-count {
width: 120px;
font-size: 12px;
line-height: 26px;
background: #fff;
margin-left: -60px;
font-weight: normal;
position: absolute;
left: 50%;
display: block;
}
}
}
... ...