Authored by yyq

材料洗涤

... ... @@ -206,7 +206,7 @@ const setBrandIntro = brand => {
* @param comfortInfo
* @return Object
*/
const setDescriptionInfo = (sizeInfo, comfortInfo) => {
const setDescriptionData = (sizeInfo, comfortInfo) => {
let resData = {};
if (_.has(sizeInfo, 'productDescBo.erpProductId')) {
... ... @@ -287,6 +287,49 @@ const setDescriptionInfo = (sizeInfo, comfortInfo) => {
};
/**
* 设置洗涤材质信息
* @param sizeInfo
* @return Object
*/
const setMaterialData = sizeInfo => {
let resData = {};
let material = {};
//洗涤提示
if (sizeInfo.washTipsBoList) {
material.wash = [];
_.forEach(sizeInfo.washTipsBoList, value => {
material.wash.push({
name: value.caption,
img: value.img
});
});
}
//商品材质[洗涤说明]
if (sizeInfo.productMaterialList) {
material.detail = [];
_.forEach(sizeInfo.productMaterialList, value => {
material.detail.push({
img: value.imageUrl,
name: value.caption,
enName: value.encaption,
text: value.remark
});
});
}
if (!_.isEmpty(material)) {
Object.assign(material, {
titleEn: 'MATERIALS',
titleCn: '材料洗涤'
});
resData.material = material;
}
return resData;
}
/**
* 设置尺寸信息
* @param sizeInfo
* @return Object
... ... @@ -422,6 +465,7 @@ module.exports = {
setBrandBanner,
setProductData,
setBrandIntro,
setDescriptionInfo,
setDescriptionData,
setMaterialData,
setSizeData
};
... ...
... ... @@ -63,8 +63,11 @@ let getProductItemData = (params) => {
return _getMultiResourceByBaseInfo(result).then(mulRes => {
// DESCRIPTION商品描述
Object.assign(data, itemFUN.setDescriptionInfo(mulRes.sizeInfo, mulRes.comfort));
Object.assign(data, itemFUN.setDescriptionData(mulRes.sizeInfo, mulRes.comfort));
// MATERIALS材料洗涤
Object.assign(data, itemFUN.setMaterialData(mulRes.sizeInfo));
// SIZEINFO尺码信息
Object.assign(data, itemFUN.setSizeData(mulRes.sizeInfo));
... ...