...
|
...
|
@@ -191,16 +191,6 @@ const _getActivityDataByProductBaseInfo = (data, additionalData) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取商品咨询和评论数据
|
|
|
* @param data
|
|
|
*/
|
|
|
const _getConsultCommentDataByProductInfo = () => {
|
|
|
return {
|
|
|
commentUrl: helpers.urlFormat('/home/comment')
|
|
|
};
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取品牌数据
|
|
|
*/
|
|
|
const _getBrandDataByProductBaseInfo = (data, additionalData) => {
|
...
|
...
|
@@ -1006,7 +996,7 @@ const _getSizeInfo = (productSkn, maxSortId, additionalData)=> { |
|
|
* @param array $navs
|
|
|
* @return array
|
|
|
*/
|
|
|
const _getSeoByGoodsInfo = function(goodsInfo, navs) {
|
|
|
const _getSeoByGoodsInfo = (goodsInfo, navs) => {
|
|
|
let title = '';
|
|
|
let keywords = '';
|
|
|
let brandName = '';
|
...
|
...
|
@@ -1081,7 +1071,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
// 商品标签
|
|
|
result.tags = _getTagsDataByProductInfo(origin);
|
|
|
|
|
|
// 商品促销短语
|
|
|
// 商品促销短语
|
|
|
result.saleTip = propOrigin('sales_phrase', '');
|
|
|
|
|
|
// 商品价格
|
...
|
...
|
@@ -1102,18 +1092,19 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
result.vipPrice = _getVipDataByProductBaseInfo(origin, vipLevel, uid);
|
|
|
}
|
|
|
|
|
|
// 促销活动banner,虚拟商品无促销
|
|
|
// 促销活动banner,虚拟商品无促销
|
|
|
if (propOrigin('attribute') !== 3) {
|
|
|
result.activity = _getActivityDataByProductBaseInfo(promotionData, additionalData);
|
|
|
}
|
|
|
|
|
|
const C_VALUE = {
|
|
|
type: '返有货币',
|
|
|
des: '每件返 ',
|
|
|
rest: '个 有货币'
|
|
|
};
|
|
|
|
|
|
// 有货币
|
|
|
if (propOrigin('yohoCoinNum', '0') !== '0') {
|
|
|
const C_VALUE = {
|
|
|
type: '返有货币',
|
|
|
des: '每件返 ',
|
|
|
rest: '个 有货币'
|
|
|
};
|
|
|
|
|
|
result.activity.push({
|
|
|
type: C_VALUE.type,
|
|
|
des: `${C_VALUE.des}${propOrigin('yohoCoinNum')}${C_VALUE.rest}`
|
...
|
...
|
@@ -1128,20 +1119,6 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
result.hasOtherPrice = false;
|
|
|
}
|
|
|
|
|
|
// 商品咨询和评论数据,当前为空
|
|
|
let consultComment = _getConsultCommentDataByProductInfo();
|
|
|
|
|
|
// 品牌信息
|
|
|
let banner = {};
|
|
|
|
|
|
if (propOrigin('brand_info', '')) {
|
|
|
result.brandImg = helpers.image(propOrigin('brand_info.brand_ico', ''), 47, 47);
|
|
|
result.brandName = propOrigin('brand_info.brand_name', '');
|
|
|
result.brandUrl = helpers.urlFormat('', null, propOrigin('brand_info.brand_domain'));
|
|
|
banner = _getBrandDataByProductBaseInfo(origin, additionalData);
|
|
|
banner.isCollect = favoriteData.brand;
|
|
|
}
|
|
|
|
|
|
// sku商品信息
|
|
|
let skuData = _getSkuDataByProductBaseInfo(origin);
|
|
|
|
...
|
...
|
@@ -1249,7 +1226,16 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
statGoodsInfo.marketPrice = result.marketPrice;
|
|
|
statGoodsInfo.salePrice = result.salePrice ? result.salePrice : result.marketPrice;
|
|
|
|
|
|
if (banner.brandId) {
|
|
|
// 品牌信息
|
|
|
let banner = {};
|
|
|
|
|
|
if (propOrigin('brand_info', '')) {
|
|
|
result.brandImg = helpers.image(propOrigin('brand_info.brand_ico', ''), 47, 47);
|
|
|
result.brandName = propOrigin('brand_info.brand_name', '');
|
|
|
result.brandUrl = helpers.urlFormat('', null, propOrigin('brand_info.brand_domain'));
|
|
|
banner = _getBrandDataByProductBaseInfo(origin, additionalData);
|
|
|
banner.isCollect = favoriteData.brand;
|
|
|
|
|
|
let domainBrand = yield brandService.getBrandByDomainAsync(banner.brandDomain);
|
|
|
|
|
|
if (domainBrand.type && domainBrand.shopId) {
|
...
|
...
|
@@ -1267,6 +1253,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 统计信息
|
|
|
statGoodsInfo.imageUrl = result.img;
|
|
|
statGoodsInfo.productUrl = helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item');
|
|
|
statGoodsInfo.smallSortId = result.smallSortId;
|
...
|
...
|
@@ -1277,7 +1264,7 @@ const _detailDataPkg = (origin, uid, vipLevel) => { |
|
|
|
|
|
return Object.assign({
|
|
|
goodsInfo: result,
|
|
|
consultComment: consultComment,
|
|
|
consultComment: true,
|
|
|
banner: _.isEmpty(banner) ? null : banner,
|
|
|
statGoodsInfo: statGoodsInfo
|
|
|
}, sizeInfo);
|
...
|
...
|
@@ -1339,7 +1326,6 @@ const showMainAsync = (data) => { |
|
|
data.saveInCookies(data.gid, _.get(productInfo, 'goodsInfo.skn', ''));
|
|
|
}
|
|
|
|
|
|
|
|
|
result.headerData = requestData[1].headerData;
|
|
|
result.productDetailPage = true;
|
|
|
result.detail = productInfo;
|
...
|
...
|
|