...
|
...
|
@@ -15,9 +15,9 @@ const library = '../../../library'; |
|
|
const helpers = require(`${library}/helpers`);
|
|
|
|
|
|
const productAPI = require('./detail-product-api');
|
|
|
const commentAPI = require('./detail-comment-api');
|
|
|
const consultAPI = require('./detail-consult-api');
|
|
|
|
|
|
const commentService = require('./detail-comment-service');
|
|
|
const hotAreaService = require('./detail-hotarea-service');
|
|
|
const brandService = require('./brand-service');
|
|
|
const favoriteBrandService = require('./favorite-brand-service');
|
...
|
...
|
@@ -33,9 +33,6 @@ const BLANK_STR = ' '; |
|
|
// 商品详情页的默认头像
|
|
|
const DEFAULT_AVATAR_ICO = 'http://static.yohobuy.com/images/v3/boy.jpg';
|
|
|
|
|
|
const IMAGE_SERVICE_URL = 'http://head.static.yhbimg.com/yhb-head/';
|
|
|
|
|
|
|
|
|
const multiResourcesUrl = {};
|
|
|
const setMultiResourceByProductBaseInfo = (data) => {
|
|
|
return co(function * () {
|
...
|
...
|
@@ -1333,36 +1330,7 @@ const getSizeInfoAsync = (productSkn, maxSortId)=> { |
|
|
/**
|
|
|
* 获取评论
|
|
|
*/
|
|
|
module.exports.indexCommentAsync = (pid, page, size) => {
|
|
|
return co(function *() {
|
|
|
let commentList = yield commentAPI.indexAsync(pid, page, size);
|
|
|
|
|
|
if (commentList.code && commentList.code === 200) {
|
|
|
return commentList.data.map(value => {
|
|
|
let item = {};
|
|
|
|
|
|
let avatar = DEFAULT_AVATAR_ICO;
|
|
|
|
|
|
if (value.head_ico) {
|
|
|
avatar = `${IMAGE_SERVICE_URL}${_.last(value.head_ico.split('headimg'))}`;
|
|
|
avatar = helpers.image(avatar, 30, 30);
|
|
|
}
|
|
|
|
|
|
item.avatar = avatar;
|
|
|
item.userName = value.nickname;
|
|
|
item.color = value.color_name;
|
|
|
item.size = value.size_name;
|
|
|
item.comment = value.content || '';
|
|
|
item.date = value.create_time;
|
|
|
item.total = value.total;
|
|
|
|
|
|
return item;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return [];
|
|
|
})();
|
|
|
};
|
|
|
module.exports.indexCommentAsync = commentService.indexAsync;
|
|
|
|
|
|
/**
|
|
|
* 获取咨询列表
|
...
|
...
|
|