index.js 1.39 KB
/**
 * 个人中心二维码 controller
 * @author: chengyao.guo<chengyao.guo@yoho.cn>
 * @date: 2016/08/10
 */

'use strict';

const headerModel = require('../../../doraemon/models/header'); // 头部model
const indexModel = require('../models/index');

exports.index = (req, res, next) => {
    let params = {
        uid: req.user.uid || '6228593'
    };

    let headerData = headerModel.setNav({
        navTitle: '个人中心'
    });

    indexModel.index(params).then(result => {
        result.isLogin = true;

        if (result) {
            res.render('index', Object.assign(result, {
                pageHeader: headerData,
                pageFooter: true
            }));
        }
    }).catch(next);

    // res.render('index', {
    //     myIndexPage: 1,
    //     showDownloadApp: 1,
    //     navHome: 1,
    //     notice: [],
    //     pageFooter: 1,
    //     cartUrl: '//m.dev.yohobuy.com/cart/index/index',
    //     signinUrl: '//m.dev.yohobuy.com/signin.html?refer=%2F%2Fm.dev.yohobuy.com%2Fhome',
    //     isLogin: true,
    //     wait_pay_num: 99,
    //     wait_cargo_num: 99,
    //     send_cargo_num: 99,
    //     brand_favorite_total: 99,
    //     product_favorite_total: 99,
    //     inbox_total: 99,
    //     comment_total: 99,
    //     refund_exchange_num: 99,
    //     yoho_coin_num: 99,
    //     coupon_num: 99,
    //     product_browse: 99
    // });
};