cart.js 466 Bytes
/**
 * 购物车 controller
 * @author: jinhu.dong<jinhu.dong@yoho.cn>
 * @date: 2016/07/04
 */

'use strict';

const cartModel = require('../models/cart');
const _ = require('lodash');

exports.index = (req, res) => {
    cartModel.getCartInfo().then((result) => {

        res.render('cart', _.merge({
            module: 'shopping',
            page: 'cart'
        }, result[0], result[1], result[2]));

    }).catch((err) => {
        res.send(err);
    });
};