goods.js
802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* 商品信息相关路由处理
* @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
});
};