...
|
...
|
@@ -3,7 +3,13 @@ |
|
|
* @author: xuqi(qi.xu@yoho.cn)
|
|
|
* @date: 2015/4/14
|
|
|
*/
|
|
|
var data = require('../../public/js/data')('tpl');
|
|
|
var datas = require('../../public/js/data'),
|
|
|
data = datas('tpl'),
|
|
|
classification = datas('classification'),
|
|
|
search = datas('search'),
|
|
|
fs = require('fs'),
|
|
|
path = require('path'),
|
|
|
tplPath = path.normalize(path.join(__dirname, '../partials/common/good-info.html'));;
|
|
|
|
|
|
exports.show = function(req, res) {
|
|
|
res.render('pages/template', {
|
...
|
...
|
@@ -12,4 +18,36 @@ exports.show = function(req, res) { |
|
|
css: '../css/template.css',
|
|
|
usejs: 'template/footer'
|
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.readTpl = function(req, res) {
|
|
|
fs.readFile(tplPath, 'utf8', function(err, data) {
|
|
|
if (err) {
|
|
|
res.send({
|
|
|
success: false
|
|
|
});
|
|
|
}
|
|
|
|
|
|
res.send({
|
|
|
success: true,
|
|
|
data: data
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.readClassification = function(req, res) {
|
|
|
res.send({
|
|
|
success: true,
|
|
|
data: classification
|
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.search = function(req, res) {
|
|
|
res.send({
|
|
|
success: true,
|
|
|
data: {
|
|
|
end: false, //数据是否结束
|
|
|
goods: search //商品数据
|
|
|
}
|
|
|
});
|
|
|
}; |
|
|
\ No newline at end of file |
...
|
...
|
|