...
|
...
|
@@ -4,6 +4,7 @@ |
|
|
* @date: 2015/4/15
|
|
|
*/
|
|
|
var data = require('../../public/js/data')('ps'),
|
|
|
dataInfos = require('../../public/js/data')('dataInfo'),
|
|
|
path = require('path'),
|
|
|
fs = require('fs'),
|
|
|
tplPath = path.normalize(path.join(__dirname, '../partials/ps/info-item.html'));
|
...
|
...
|
@@ -20,11 +21,34 @@ exports.show = function(req, res) { |
|
|
exports.readTpl = function(req, res) {
|
|
|
fs.readFile(tplPath, 'utf8', function(err, data) {
|
|
|
if (err) {
|
|
|
res.send({success: false})
|
|
|
res.send({success: false});
|
|
|
}
|
|
|
|
|
|
fs.readFile(
|
|
|
path.normalize(path.join(__dirname, '../partials/common/time-view-like-share.html')),
|
|
|
'utf8', function(err, subData) {
|
|
|
if (err) {
|
|
|
res.send({success: false});
|
|
|
}
|
|
|
data = data.replace('{{> common/time_view_like_share}}', subData); //Note: 后端需将partials目录替换为内容
|
|
|
res.send({
|
|
|
success: true,
|
|
|
data: data
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.loadInfo = function(req, res) {
|
|
|
var start = 1 * req.query.start,
|
|
|
count = 3,
|
|
|
end = false;
|
|
|
if (start + count >= dataInfos.length) {
|
|
|
end = true;
|
|
|
}
|
|
|
res.send({
|
|
|
success: true,
|
|
|
end: end,
|
|
|
data: dataInfos.slice(start, start + count)
|
|
|
});
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|