goods.js 802 Bytes
/**
 * 商品信息相关路由处理
 * @author: xuqi(qi.xu@yoho.cn)
 * @date: 2015/7/15
 */
var fs = require('fs'),
    path = require('path'),
    tplPath = path.normalize(path.join(__dirname, '../partials/common/good_info.html')),
    data = require('../../public/js/data/goods');

exports.goodTpl = function(req, res) {
    fs.readFile(tplPath, 'utf8', function(err, data) {
        if (err) {
            res.send({
                success: false
            });
        }

        res.send(data);
    });
};

//加载更多商品信息
exports.more = function(req, res) {
    res.send({
        code: 200,
        data: {
            end: true,
            goods: data
        }
    });
};

// 收藏、取消收藏
exports.like = function(req, res) {
    res.send({
        code: 200
    });
};