...
|
...
|
@@ -22,7 +22,7 @@ const helpers = global.yoho.helpers; |
|
|
* @param brand 品牌相关数据
|
|
|
* @return Object
|
|
|
*/
|
|
|
const setBrandBanner = (brand) => {
|
|
|
const _setBrandBanner = (brand) => {
|
|
|
let data = {
|
|
|
bgColor: '#93897d',
|
|
|
brandLogo: {
|
...
|
...
|
@@ -34,7 +34,9 @@ const setBrandBanner = (brand) => { |
|
|
}
|
|
|
};
|
|
|
|
|
|
return data;
|
|
|
return {
|
|
|
brandBanner: data
|
|
|
};
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -42,7 +44,7 @@ const setBrandBanner = (brand) => { |
|
|
* @param base 商品基础数据
|
|
|
* @return Object
|
|
|
*/
|
|
|
const setProductData = (base) => {
|
|
|
const _setProductData = (base) => {
|
|
|
let data = {
|
|
|
name: base.productName,
|
|
|
brandName: _.has(base, 'brand.brandName') ? base.brand.brandName : '',
|
...
|
...
|
@@ -150,8 +152,25 @@ const setProductData = (base) => { |
|
|
return data;
|
|
|
};
|
|
|
|
|
|
const _setBrandIntro = (brand) => {
|
|
|
let barndIntro = {};
|
|
|
|
|
|
if (brand) {
|
|
|
barndIntro = {
|
|
|
brand: {
|
|
|
titleEn: 'BRAND',
|
|
|
titleCn: '品牌介绍',
|
|
|
logo: brand.brandIco,
|
|
|
intro: brand.brandIntro
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return barndIntro;
|
|
|
}
|
|
|
|
|
|
let getProductItemData = (params) => {
|
|
|
let pid = params[0];
|
|
|
|
|
|
// let gid = params[1];
|
|
|
|
|
|
return Promise.all([
|
...
|
...
|
@@ -166,15 +185,17 @@ let getProductItemData = (params) => { |
|
|
}
|
|
|
|
|
|
if (result[0].brand) {
|
|
|
Object.assign(data, {
|
|
|
brandBanner: setBrandBanner(result[0].brand)
|
|
|
});
|
|
|
Object.assign(data, _setBrandBanner(result[0].brand));
|
|
|
|
|
|
Object.assign(data, _setBrandIntro(result[0].brand));
|
|
|
}
|
|
|
|
|
|
Object.assign(data, {
|
|
|
goodInfo: setProductData(result[0])
|
|
|
goodInfo: _setProductData(result[0])
|
|
|
});
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
return data;
|
|
|
});
|
|
|
};
|
...
|
...
|
|