...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
const headerModel = require('../../../doraemon/models/header'); // 头部model
|
|
|
const footerModel = require('../../../doraemon/models/footer_tab'); // 底部tab
|
|
|
const indexModel = require('../models/brand');
|
|
|
const typeLib = require('../../../config/type-lib');
|
|
|
|
|
|
/**
|
|
|
* 品牌一览
|
...
|
...
|
@@ -17,7 +18,6 @@ const indexModel = require('../models/brand'); |
|
|
* @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
|
|
|
*/
|
|
|
let index = (req, res, next) => {
|
|
|
|
|
|
let responseData = {
|
|
|
module: 'channel',
|
|
|
page: 'brand',
|
...
|
...
|
@@ -26,14 +26,36 @@ let index = (req, res, next) => { |
|
|
// title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停',
|
|
|
showFooterTab: footerModel.getUrlData('category')
|
|
|
};
|
|
|
let channel,
|
|
|
gender;
|
|
|
|
|
|
if (!req.query.channel) {
|
|
|
channel = '1';
|
|
|
} else if (!typeLib.channels[req.query.channel]) {
|
|
|
channel = req.query.channel;
|
|
|
} else {
|
|
|
channel = typeLib.channels[req.query.channel] + '';
|
|
|
}
|
|
|
if (!req.query.gender) {
|
|
|
gender = '1,3';
|
|
|
} else if (!typeLib.gender[gender]) {
|
|
|
gender = req.query.gender;
|
|
|
} else {
|
|
|
gender = typeLib.gender[gender];
|
|
|
}
|
|
|
|
|
|
let param = {
|
|
|
channel: req.query.channel || '1',
|
|
|
gender: req.query.gender || '1,3'
|
|
|
channel,
|
|
|
gender
|
|
|
};
|
|
|
|
|
|
indexModel.getBrandByChannel(param.channel).then(result => {
|
|
|
res.render('brand/index', Object.assign(responseData, result));
|
|
|
console.log(result.channel.channels)
|
|
|
res.render('brand/index', Object.assign(responseData, result, {
|
|
|
params: {
|
|
|
yhChannel: channel
|
|
|
}
|
|
|
}));
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
...
|
...
|
|