outlets.js 1.68 KB
/**
 * 商品促销controller
 * @author: yyq<yanqing.yang@yoho.cn>
 * @date: 2016/5/19
 */

'use strict';

// const headerModel = require('../../../doraemon/models/header');

/**
 * outlets 首页
 * @param  {[type]} req [description]
 * @param  {[type]} res [description]
 * @return {[type]}     [description]
 */
exports.index = (req, res) => {
    res.render('outlets/index', {});
    // headerModel.requestHeaderData()
    //     .then(response => {
    //         response = headerModel.setHeaderData(response.data, 'outlets');
    //
    //         response.module = 'product';
    //         response.page = 'outlets';
    //         response.footerTop = true;
    //         response.devEnv = true;
    //
    //         // 假数据输出
    //         res.render('outlets/index', Object.assign(response, simulation.saleIndex()));
    //
    //         // 真实数据输出
    //         /* return sale.getSaleDate().then(result => {
    //
    //             response.result = result;
    //             response.resultShow = JSON.stringify(result, null, 4);
    //
    //             res.render('sale/index', response);
    //         });*/
    //     })
    //     .catch(() => {
    //         res.render('error', { devEnv: true, pageErr: true });
    //     });
};

/**
 * outlets 频道页
 * @param  {[type]} req [description]
 * @param  {[type]} res [description]
 * @return {[type]}     [description]
 */
exports.channel = (req, res) => {
    let channel = {
        boys: '',
        girls: '',
        kids: '',
        lifestyle: ''
    };
    let response = {};

    if (!channel[req.params.channel]) {
        response.pageErr = true;
    }
    res.render('outlets/channel', response);
};