...
|
...
|
@@ -14,6 +14,7 @@ const YohoAction = require('./lib/yoho-action'); |
|
|
const moment = require('moment');
|
|
|
const camelCase = global.yoho.camelCase;
|
|
|
const DEFAULT_AVATAR_ICO = 'http://static.yohobuy.com/images/v3/boy.jpg';
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
class DetailAction extends YohoAction {
|
|
|
/**
|
...
|
...
|
@@ -80,20 +81,22 @@ class CommentAction extends YohoAction { |
|
|
let size = req.query.size || 10;
|
|
|
|
|
|
return service.getShareOrderListAsync(pid, page, size).then((result) => {
|
|
|
let pageResponse = _.get(result, 'data.pageResponse', {});
|
|
|
|
|
|
this.response.json({
|
|
|
code: result.code,
|
|
|
data: camelCase(result.data.pageResponse.list).map((item)=> {
|
|
|
data: camelCase(_.get(pageResponse, 'list', [])).map((item)=> {
|
|
|
|
|
|
return {
|
|
|
avatar: item.userInfo && item.userInfo.headIco ?
|
|
|
helpers.image(item.userInfo.headIco, 30, 30) :
|
|
|
DEFAULT_AVATAR_ICO,
|
|
|
userName: item.userInfo.nickName,
|
|
|
avatar: _.get(item, 'userInfo.headIco', '') ?
|
|
|
helpers.image(item.userInfo.headIco, 30, 30) :
|
|
|
DEFAULT_AVATAR_ICO,
|
|
|
userName: _.get(item, 'userInfo.nickName', ''),
|
|
|
date: moment(item.createTime, 'X').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
color: item.goods.colorName,
|
|
|
size: item.goods.sizeName,
|
|
|
color: _.get(item, 'goods.colorName', ''),
|
|
|
size: _.get(item, 'goods.sizeName', ''),
|
|
|
comment: item.content,
|
|
|
total: result.data.pageResponse.totalCount
|
|
|
total: pageResponse.totalCount
|
|
|
};
|
|
|
})
|
|
|
});
|
...
|
...
|
|