...
|
...
|
@@ -12,8 +12,6 @@ const moment = require('moment'); |
|
|
const _ = require('lodash');
|
|
|
|
|
|
const library = '../../../library';
|
|
|
const API = require(`${library}/api`).API;
|
|
|
const sign = require(`${library}/sign`);
|
|
|
const helpers = require(`${library}/helpers`);
|
|
|
|
|
|
const detailAPI = require('./detail-main-api');
|
...
|
...
|
@@ -27,17 +25,16 @@ const favoriteProductService = require('./favorite-product-service'); |
|
|
|
|
|
const shopAPI = require('./shop-api');
|
|
|
const searchAPI = require('./search-api');
|
|
|
const homeHandle = require('./home-handle');
|
|
|
const homeService = require('./home-service');
|
|
|
const HeaderModel = require('../../../doraemon/models/header');
|
|
|
|
|
|
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 IMAGE_SERVICE_URL = 'http://head.static.yhbimg.com/yhb-head/';
|
|
|
|
|
|
var api = new API();
|
|
|
|
|
|
const multiResourcesUrl = {};
|
|
|
const setMultiResourceByProductBaseInfo = (data) => {
|
...
|
...
|
@@ -1373,6 +1370,7 @@ module.exports.indexCommentAsync = (pid, page, size) => { |
|
|
module.exports.indexConsultAsync = (uid, pid, page, size) => {
|
|
|
return co(function *() {
|
|
|
let consultList = yield consultAPI.indexAsync(uid, pid, page, size);
|
|
|
|
|
|
if (consultList.code && consultList.code === 200) {
|
|
|
return consultList.data.list.map(value => {
|
|
|
return {
|
...
|
...
|
@@ -1386,11 +1384,11 @@ module.exports.indexConsultAsync = (uid, pid, page, size) => { |
|
|
isUseful: value.is_useful === 'Y',
|
|
|
useful: parseInt(value.useful, 10),
|
|
|
total: value.total
|
|
|
}
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return []
|
|
|
return [];
|
|
|
})();
|
|
|
};
|
|
|
|
...
|
...
|
@@ -1399,7 +1397,7 @@ module.exports.indexConsultAsync = (uid, pid, page, size) => { |
|
|
*/
|
|
|
module.exports.createConsultAsync = (uid, pid, content) => {
|
|
|
return consultAPI.createAsync(uid, pid, content);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取某一个商品详情主页面
|
...
|
...
|
@@ -1425,7 +1423,7 @@ module.exports.showMainAsync = (data) => { |
|
|
};
|
|
|
|
|
|
// 导航
|
|
|
result.detail.pathNav = _.concat(homeHandle.getHomeChannelNav(data.channel),
|
|
|
result.detail.pathNav = _.concat(homeService.getHomeChannelNav(data.channel),
|
|
|
navs,
|
|
|
[{name: productInfo.goodsInfo.name}]);
|
|
|
result.detail.lastWalk = 5;
|
...
|
...
|
@@ -1475,10 +1473,12 @@ module.exports.indexHotAreaAsync = (pid) => { |
|
|
marketPrice: cur.product.productPriceBo.formatMarketPrice,
|
|
|
productName: cur.product.productName,
|
|
|
href: helpers.getUrlBySkc(_.head(goods.goodsImagesList).productId,
|
|
|
_.head(goods.goodsImagesList).goodsId,
|
|
|
cur.product.cnAlphabet)
|
|
|
_.head(goods.goodsImagesList).goodsId,
|
|
|
cur.product.cnAlphabet)
|
|
|
};
|
|
|
acc.push(point);
|
|
|
|
|
|
return acc;
|
|
|
}, []);
|
|
|
|
|
|
if (_.isEmpty(item)) {
|
...
|
...
|
@@ -1493,4 +1493,4 @@ module.exports.indexHotAreaAsync = (pid) => { |
|
|
|
|
|
return [];
|
|
|
})();
|
|
|
} |
|
|
}; |
...
|
...
|
|