Authored by 郭成尧

Merge branch 'feature/guang2' into 'release/5.8'

comments



See merge request !631
@@ -159,7 +159,7 @@ const index = (req, res, next) => { @@ -159,7 +159,7 @@ const index = (req, res, next) => {
159 159
160 co(function* () { 160 co(function* () {
161 let detail = yield req.ctx(DetailModel).packageData(id, isApp, isWeixin, channel, isShare); 161 let detail = yield req.ctx(DetailModel).packageData(id, isApp, isWeixin, channel, isShare);
162 - let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id}); 162 + let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id, udid: udid});
163 let praise = yield req.ctx(DetailModel).getArticlePraiseAndFavor({ 163 let praise = yield req.ctx(DetailModel).getArticlePraiseAndFavor({
164 uid: uid, 164 uid: uid,
165 id: id, 165 id: id,
@@ -316,7 +316,7 @@ const mini = (req, res, next) => { @@ -316,7 +316,7 @@ const mini = (req, res, next) => {
316 316
317 co(function* () { 317 co(function* () {
318 let detail = yield req.ctx(DetailModel).packageData(id, isApp); 318 let detail = yield req.ctx(DetailModel).packageData(id, isApp);
319 - let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id}); 319 + let commentsTotal = yield req.ctx(DetailModel).commentsTotal({article_id: id, udid: udid});
320 let praise = yield req.ctx(DetailModel).getArticlePraiseAndFavor({ 320 let praise = yield req.ctx(DetailModel).getArticlePraiseAndFavor({
321 uid: uid, 321 uid: uid,
322 id: id, 322 id: id,
@@ -454,10 +454,12 @@ const foryoho = (req, res, next) => { @@ -454,10 +454,12 @@ const foryoho = (req, res, next) => {
454 * @param {*} next 454 * @param {*} next
455 */ 455 */
456 const getComments = (req, res, next) => { 456 const getComments = (req, res, next) => {
  457 + let udid = req.sessionID || require('yoho-md5')(req.ip) || 'yoho';
457 458
458 req.ctx(DetailModel).comments({ 459 req.ctx(DetailModel).comments({
459 article_id: req.query.article_id, 460 article_id: req.query.article_id,
460 - page: req.query.page 461 + page: req.query.page,
  462 + udid: udid
461 }).then(result => { 463 }).then(result => {
462 return res.render('info/comments', { 464 return res.render('info/comments', {
463 comments: result, 465 comments: result,
@@ -357,7 +357,8 @@ class DetailModel extends global.yoho.BaseModel { @@ -357,7 +357,8 @@ class DetailModel extends global.yoho.BaseModel {
357 return serviceAPI.get(`${URI_PACKAGE_COMMENTS}getList`, { 357 return serviceAPI.get(`${URI_PACKAGE_COMMENTS}getList`, {
358 article_id: params.article_id, 358 article_id: params.article_id,
359 page: params.page, 359 page: params.page,
360 - limit: params.limit || 10 360 + limit: params.limit || 20,
  361 + udid: params.udid
361 }).then(result => { 362 }).then(result => {
362 return _.get(result, 'data.list', []); 363 return _.get(result, 'data.list', []);
363 }); 364 });
@@ -371,7 +372,8 @@ class DetailModel extends global.yoho.BaseModel { @@ -371,7 +372,8 @@ class DetailModel extends global.yoho.BaseModel {
371 return serviceAPI.get(`${URI_PACKAGE_COMMENTS}getList`, { 372 return serviceAPI.get(`${URI_PACKAGE_COMMENTS}getList`, {
372 article_id: params.article_id, 373 article_id: params.article_id,
373 page: 1, 374 page: 1,
374 - limit: 1 375 + limit: 1,
  376 + udid: params.udid
375 }).then(result => { 377 }).then(result => {
376 return _.get(result, 'data.total', 0); 378 return _.get(result, 'data.total', 0);
377 }); 379 });
@@ -22,7 +22,7 @@ const domains = { @@ -22,7 +22,7 @@ const domains = {
22 22
23 module.exports = { 23 module.exports = {
24 app: 'h5', 24 app: 'h5',
25 - appVersion: '5.7.1', // 调用api的版本 25 + appVersion: '5.8.0', // 调用api的版本
26 port: 6001, 26 port: 6001,
27 siteUrl: '//m.yohobuy.com', 27 siteUrl: '//m.yohobuy.com',
28 assetUrl: '//127.0.0.1:5001', 28 assetUrl: '//127.0.0.1:5001',