item.js 505 Bytes
/**
 * 商品详情页controller
 * @author: yyq<yanqing.yang@yoho.cn>
 * @date: 2016/7/4
 */
'use strict';

const _ = require('lodash');
const Item = require('../models/item');

const index = (req, res, next) => {
    Item.getProductItemData(req.params, req.url, req.user.uid).then(result => {
        if (_.isEmpty(result)) {
            return next();
        }
        result.page = 'item';
        res.display('item', result);
    }).catch(next);
};

module.exports = {
    index // 组件demo页
};