index.js 1.62 KB
/**
 * guang controller
 * @author: lcy<chuanyang.liu@yoho.cn>
 * @date: 2016/08/31
 */

'use strict';

const _ = require('lodash');

const channelModel = require('../models/index');
const HeaderModel = require('../../../doraemon/models/header');

exports.index = (req, res, next) => {

    let channel = req.yoho.channel;
    let page = req.query.page || 1;
    let limit = req.query.limit || 20;
    let type = req.query.type || 0;

    let pathNav = channelModel.getIndexNav(channel);

    /*Promise.all([
            channelModel.getBanner(),
            channelModel.getCategory(),
            channelModel.getList(),
            //page
            channelModel.getHotTags(),
            channelModel.getAds(),
            channelModel.getExcellectRecos()
        ]).then(ret => {
            res.render('index', {
                'guang' : {
                    'slider' : ret[0],
                    'msgTypes' : ret[1],
                    'msgs' : ret[2],
                    'hotTags' : ret[6],
                    'ads' : ret[3],
                    'exRecos' : ret[5],
                    'msgPager' : null,
                    
                    'guangIndexPage' : true
                }
            });
        }).catch(next);*/

    return res.render('index', {
        pageName : 'guang-index',
        world : {
            aaa : 'AAA'
        }
    });

}

exports.detail = (req, res, next) => {
    return res.render('detail', { 
        detailId : req.params.id
    });
}

exports.tags = (req, res, next) => {
    return res.render('index', {

    });
}

exports.editor = (req, res, next) => {
    return res.render('index', {

    });
}