Authored by htoooth

fix channel

... ... @@ -16,7 +16,7 @@ const sale = require(`${mRoot}/sale`); // sale 页 model
* @return {[type]} [description]
*/
exports.index = (req, res, next) => {
let channel = req.query.channel || req.yoho.channel;
let channel = req.yoho.channel;
// 真实数据输出
sale.getSaleIndexData(channel).then(result => {
... ... @@ -41,7 +41,7 @@ exports.discount = (req, res, next) => {
saleType: '3'
}, req.query);
let channel = req.query.channel || req.yoho.channel;
let channel = req.yoho.channel;
let responseData = {
module: 'product',
... ... @@ -68,7 +68,7 @@ exports.vip = (req, res, next) => {
saleType: '2'
}, req.query);
let channel = req.query.channel || req.yoho.channel;
let channel = req.yoho.channel;
params.uid = req.user.uid || 0;
... ... @@ -95,7 +95,7 @@ exports.newSale = (req, res, next) => {
order: 's_t_desc'
}, req.query);
let channel = req.query.channel || req.yoho.channel;
let channel = req.yoho.channel;
sale.getSaleOthersData(params, channel).then((result) => {
res.render('sale/other', Object.assign({
... ...
... ... @@ -18,8 +18,13 @@ module.exports = () => {
let yoho = {
pageChannel: {}
};
const channel = CHANNEL[req.query.channel || req.cookies._Channel] || CHANNEL.boys;
if (req.query.channel) {
req.query.channel = channel;
}
// 用于头部颜色控制
yoho.pageChannel[channel] = true;
... ...
... ... @@ -155,7 +155,7 @@ exports.processProductList = (list, options) => {
_.forEach(list, (product) => {
// 商品信息有问题,则不显示
if (!product || !product.product_skn || !product.goods_list.length) {
if (!product || !product.product_skn || !_.get(product, 'goods_list.length', 0)) {
return;
}
... ...