outlet.js
2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* 频道页面
* @author: Bi Kai<kai.bi@yoho.cn>
* @date: 2016/05/09
*/
'use strict';
const outletModel = require('../models/outlet');
const headerModel = require('../../../doraemon/models/header');
const renderData = {
module: 'product',
page: 'outlet'
};
exports.index = (req, res) => {
let channel = req.query.yh_channel || req.cookies._Channel || 'boys';
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
let categoryId = req.query.category_id;
outletModel.getContent(categoryId, channel).then(result => {
res.render('outlet', Object.assign({
pageHeader: headerData,
pageFooter: true
}, renderData, result));
});
};
exports.activity = (req, res) => {
let channel = req.query.channel || req.cookies._Channel || 'boys';
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({
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';
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
let categoryId = req.query.category_id;
outletModel.getNearlyActivity(channel, 3, categoryId).then(result => {
renderData.page = 'outlet-activity';
res.render('outlet/will-start', Object.assign({
pageHeader: headerData,
pageFooter: true
}, renderData, result));
});
};