Authored by ccbikai

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuywap-node into release/4.6

... ... @@ -9,17 +9,25 @@ const outletModel = require('../models/outlet');
const headerModel = require('../../../doraemon/models/header');
const renderData = {
module: 'product',
page: 'outlet'
module: 'product'
};
const yhChannelMap = {
boys: 1,
girls: 2,
kids: 3,
lifestyle: 4
};
exports.index = (req, res) => {
let channel = req.query.yh_channel || req.cookies._Channel || 'boys';
let channel = req.query.channel || req.cookies._Channel || 'boys';
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
let categoryId = req.query.category_id;
let yhChannel = req.query.yh_channel || 1;
outletModel.getContent(categoryId, channel).then(result => {
outletModel.getContent(categoryId, yhChannel).then(result => {
res.render('outlet', Object.assign({
page: 'outlet',
pageHeader: headerData,
pageFooter: true
}, renderData, result));
... ... @@ -31,39 +39,28 @@ exports.activity = (req, res) => {
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
outletModel.getActivity(req.query.id).then(result => {
renderData.page = 'outlet-detail';
res.render('outlet/activity', Object.assign({
page: 'outlet-detail',
pageHeader: headerData,
pageFooter: true
}, renderData, result));
});
};
exports.willBeEnd = (req, res) => {
let channel = req.query.channel || req.cookies._Channel || 'boys';
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
let categoryId = req.query.category_id;
outletModel.getNearlyActivity(channel, 2, categoryId).then(result => {
renderData.page = 'outlet-activity';
res.render('outlet/will-end', Object.assign({
pageHeader: headerData,
pageFooter: true
}, renderData, result));
});
};
exports.willBeCome = (req, res) => {
let channel = req.query.channel || req.cookies._Channel || 'boys';
exports.activityChannel = (req, res) => {
let channel = req.cookies._Channel || 'boys';
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
let categoryId = req.query.category_id;
let type = req.query.type || 2;
let template = type === 2 ? 'outlet/will-end' : 'outlet/will-start';
let page = type === 2 ? 'tobeend' : 'soon';
let yhChannel = yhChannelMap[channel];
outletModel.getNearlyActivity(channel, 3, categoryId).then(result => {
renderData.page = 'outlet-activity';
outletModel.getNearlyActivity(yhChannel, type, categoryId).then(result => {
res.render('outlet/will-start', Object.assign({
res.render(template, Object.assign({
page: page,
pageHeader: headerData,
pageFooter: true
}, renderData, result));
... ...
... ... @@ -4,8 +4,8 @@
{{#each data}}
<li><a href="{{url}}">{{name}}</a></li>
{{/each}}
<li><a href="outlet/tobeend?yh_channel=5&category_id={{category}}">即将结束</a></li>
<li><a href="outlet/soon?yh_channel=6&category_id={{category}}">即将开始</a></li>
<li><a href="outlet/tobeend?type=0&category_id={{category}}">即将结束</a></li>
<li><a href="outlet/soon?type=1&category_id={{category}}">即将开始</a></li>
</ul>
</nav>
{{/nav}}
... ...