Authored by 郭成尧

comments

... ... @@ -159,7 +159,7 @@ const index = (req, res, next) => {
co(function* () {
let detail = yield req.ctx(DetailModel).packageData(id, isApp, isWeixin, channel, isShare);
let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id});
let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id, udid: udid});
let praise = yield req.ctx(DetailModel).getArticlePraiseAndFavor({
uid: uid,
id: id,
... ... @@ -316,7 +316,7 @@ const mini = (req, res, next) => {
co(function* () {
let detail = yield req.ctx(DetailModel).packageData(id, isApp);
let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id});
let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id, udid: udid});
let praise = yield req.ctx(DetailModel).getArticlePraiseAndFavor({
uid: uid,
id: id,
... ... @@ -454,10 +454,12 @@ const foryoho = (req, res, next) => {
* @param {*} next
*/
const getComments = (req, res, next) => {
let udid = req.sessionID || require('yoho-md5')(req.ip) || 'yoho';
req.ctx(DetailModel).comments({
article_id: req.query.article_id,
page: req.query.page
page: req.query.page,
udid: udid
}).then(result => {
return res.render('info/comments', {
comments: result,
... ...
... ... @@ -357,7 +357,8 @@ class DetailModel extends global.yoho.BaseModel {
return serviceAPI.get(`${URI_PACKAGE_COMMENTS}getList`, {
article_id: params.article_id,
page: params.page,
limit: params.limit || 10
limit: params.limit || 20,
udid: params.udid
}).then(result => {
return _.get(result, 'data.list', []);
});
... ... @@ -371,7 +372,8 @@ class DetailModel extends global.yoho.BaseModel {
return serviceAPI.get(`${URI_PACKAGE_COMMENTS}getList`, {
article_id: params.article_id,
page: 1,
limit: 1
limit: 1,
udid: params.udid
}).then(result => {
return _.get(result, 'data.total', 0);
});
... ...
... ... @@ -22,7 +22,7 @@ const domains = {
module.exports = {
app: 'h5',
appVersion: '5.7.1', // 调用api的版本
appVersion: '5.8.0', // 调用api的版本
port: 6001,
siteUrl: '//m.yohobuy.com',
assetUrl: '//127.0.0.1:5001',
... ...