...
|
...
|
@@ -7,6 +7,8 @@ |
|
|
const _ = require('lodash');
|
|
|
const channelModel = require('../models/channel');
|
|
|
const helpers = require('../../../library/helpers');
|
|
|
const log = require('../../../library/logger');
|
|
|
const cookie = require('../../../library/cookie');
|
|
|
|
|
|
const mod = 'channel';
|
|
|
let footerTab = {
|
...
|
...
|
@@ -17,6 +19,10 @@ let footerTab = { |
|
|
mineUrl: helpers.url('/home') // 个人中心
|
|
|
};
|
|
|
|
|
|
const channelLogger = (err) => {
|
|
|
log.error(err);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 频道选择
|
|
|
* @param {object} req
|
...
|
...
|
@@ -43,7 +49,7 @@ exports.switchChannel = (req, res, next) => { |
|
|
exports.boys = (req, res) => {
|
|
|
channelModel.getChannelDate({
|
|
|
gender: 'boys',
|
|
|
uid: 123
|
|
|
uid: cookie.getUid(req)
|
|
|
}).then(result => {
|
|
|
res.render('channel', Object.assign({
|
|
|
module: mod,
|
...
|
...
|
@@ -57,7 +63,67 @@ exports.boys = (req, res) => { |
|
|
showFooterTab: footerTab,
|
|
|
pageFooter: true
|
|
|
}, result));
|
|
|
}).catch(console.trace);
|
|
|
}).catch(channelLogger);
|
|
|
};
|
|
|
|
|
|
exports.girls = (req, res) => {
|
|
|
channelModel.getChannelDate({
|
|
|
gender: 'girls',
|
|
|
uid: cookie.getUid(req)
|
|
|
}).then(result => {
|
|
|
res.render('channel', Object.assign({
|
|
|
module: mod,
|
|
|
page: 'home',
|
|
|
title: '女生首页',
|
|
|
girlsHomePage: true,
|
|
|
homeHeader: {
|
|
|
searchUrl: helpers.url('/search', null, 'search')
|
|
|
},
|
|
|
maybeLike: true,
|
|
|
showFooterTab: footerTab,
|
|
|
pageFooter: true
|
|
|
}, result));
|
|
|
}).catch(channelLogger);
|
|
|
};
|
|
|
|
|
|
exports.kids = (req, res) => {
|
|
|
channelModel.getChannelDate({
|
|
|
gender: 'kids',
|
|
|
uid: cookie.getUid(req)
|
|
|
}).then(result => {
|
|
|
res.render('channel', Object.assign({
|
|
|
module: mod,
|
|
|
page: 'home',
|
|
|
title: '潮童首页',
|
|
|
kidsHomePage: true,
|
|
|
homeHeader: {
|
|
|
searchUrl: helpers.url('/search', null, 'search')
|
|
|
},
|
|
|
maybeLike: true,
|
|
|
showFooterTab: footerTab,
|
|
|
pageFooter: true
|
|
|
}, result));
|
|
|
}).catch(channelLogger);
|
|
|
};
|
|
|
|
|
|
exports.lifestyle = (req, res) => {
|
|
|
channelModel.getChannelDate({
|
|
|
gender: 'lifestyle',
|
|
|
uid: cookie.getUid(req)
|
|
|
}).then(result => {
|
|
|
res.render('channel', Object.assign({
|
|
|
module: mod,
|
|
|
page: 'home',
|
|
|
title: '创意生活首页',
|
|
|
lifestyleHomePage: true,
|
|
|
homeHeader: {
|
|
|
searchUrl: helpers.url('/search', null, 'search')
|
|
|
},
|
|
|
maybeLike: true,
|
|
|
showFooterTab: footerTab,
|
|
|
pageFooter: true
|
|
|
}, result));
|
|
|
}).catch(channelLogger);
|
|
|
};
|
|
|
|
|
|
exports.bottomBanner = (req, res) => {
|
...
|
...
|
|