star.js 1.39 KB
/**
 * 新潮教室
 * @author: wsl<shuiling.wang@yoho.cn>
 * @date: 2016/05/30
 */
'use strict';

// const library = '../../../library';
// const channelModel = require('../models/channel');
const mRoot = '../models';
const _ = require('lodash');

// const helpers = require(`${library}/helpers`);
// const log = require(`${library}/logger`);
const headerModel = require('../../../doraemon/models/header');
const starModel = require(`${mRoot}/star`);

/**
 * 星潮教室首页
 * @param  {[object]} req
 * @param  {[object]} res
 * @return {[type]}
 */
exports.index = (req, res) => {
    let headerData = headerModel.setNavHeader('新潮教室');
    let renderData = {
        // module: 'product',
        // page: 'sale',
        title: '新潮教室',
        pageHeader: headerData,
        pageFooter: true
    };

    starModel.getIndexData().then(() => {
        res.render('star/index', _.assign(headerData, renderData, {
            content: '',
            headTab: [
                {
                    cur: true,
                    url: '',
                    name: '全部'
                },
                {
                    cur: false,
                    url: '',
                    name: '星专题'
                },
                {
                    cur: false,
                    url: '',
                    name: '星搭配'
                }
            ]
        }));
    });
};