|
|
/**
|
|
|
* 频道页面
|
|
|
* @author: Bi Kai<kai.bi@yoho.cn>
|
|
|
* 奥莱页面
|
|
|
* @author: 赵彪<bill.zhao@yoho.cn>
|
|
|
* @date: 2016/05/09
|
|
|
*/
|
|
|
'use strict';
|
...
|
...
|
@@ -19,9 +19,13 @@ const yhChannelMap = { |
|
|
lifestyle: 4
|
|
|
};
|
|
|
|
|
|
// 奥莱首页控制器
|
|
|
exports.index = (req, res) => {
|
|
|
let channel = req.query.channel || req.cookies._Channel || 'boys';
|
|
|
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
|
|
|
let headerData = headerModel.setNav({
|
|
|
navTitle: 'OUTLET',
|
|
|
navBtn: false
|
|
|
});
|
|
|
|
|
|
let categoryId = req.query.category_id;
|
|
|
let yhChannel = req.query.yh_channel || 1;
|
|
|
let contentcode = req.query.content_code;
|
...
|
...
|
@@ -29,15 +33,17 @@ exports.index = (req, res) => { |
|
|
outletModel.getContent(categoryId, yhChannel, contentcode).then(result => {
|
|
|
res.render('outlet', Object.assign({
|
|
|
page: 'outlet',
|
|
|
pageHeader: headerData,
|
|
|
pageFooter: true
|
|
|
pageHeader: headerData
|
|
|
}, renderData, result));
|
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.activity = (req, res) => {
|
|
|
let channel = req.query.channel || req.cookies._Channel || 'boys';
|
|
|
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
|
|
|
// 奥莱活动详情页
|
|
|
exports.activityDetail = (req, res) => {
|
|
|
let headerData = headerModel.setNav({
|
|
|
navTitle: 'OUTLET',
|
|
|
navBtn: false
|
|
|
});
|
|
|
|
|
|
outletModel.getActivity(req.query.id).then(result => {
|
|
|
res.render('outlet/activity', Object.assign({
|
...
|
...
|
@@ -48,14 +54,17 @@ exports.activity = (req, res) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.activityChannel = (req, res) => {
|
|
|
let channel = req.cookies._Channel || 'boys';
|
|
|
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
|
|
|
// 奥莱活动频道列表页
|
|
|
exports.activityList = (req, res) => {
|
|
|
let headerData = headerModel.setNav({
|
|
|
navTitle: 'OUTLET',
|
|
|
navBtn: false
|
|
|
});
|
|
|
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 ? 'outlet-will-end' : 'outlet-will-start';
|
|
|
let yhChannel = yhChannelMap[channel];
|
|
|
let yhChannel = req.query.yh_channel || yhChannelMap[req.yoho.channel];
|
|
|
|
|
|
outletModel.getNearlyActivity(yhChannel, type, categoryId).then(result => {
|
|
|
res.render(template, Object.assign({
|
...
|
...
|
|