plustar.js 1.07 KB
/**
 * 国际优选
 * @author: zxr<xiaoru.zhang@yoho.cn>
 * @date: 2016/09/12
 */
'use strict';

const mRoot = '../models';
const plustarModel = require(`${mRoot}/plustar`);
const headerModel = require('../../../doraemon/models/header'); // 头部model
let channels = {
    boys: 1,
    girl: 2,
    kids: 3,
    lifestyle: 4
};

const getListData = (req, res, next) => {
    let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || 1;
    let recom = '4';
    let all = '1';

    // console.log(gender);

    plustarModel.getListData(gender, recom, all).then((result) => {

        res.render('plustar/list', {
            module: 'guang',
            page: 'plustar-list',
            pageHeader: headerModel.setNav({
                navTitle: '国际优选'
            }),
            pageFooter: true,
            ps: {
                sName: '设计师',
                pName: '经典潮牌',
                star: result.star,
                plus: result.plus
            }
        });
    }).catch(next);
};

module.exports = {
    getListData
};