Authored by 郭成尧

'dicount-promotion'

... ... @@ -226,6 +226,29 @@ const tool = {
description: '立省¥' + priceShow + '元',
productList: productProcess.processProductList(bundleData && bundleData.productList)
};
},
/**
* 处理量贩数据
* @param finalResult
* @param bundleData
*/
processDiscount(finalResult, bundleData) {
finalResult.discountBuy = {
num: _.get(bundleData, 'bundleInfo.bundleCount', 1),
promotionPhrase: _.get(bundleData, 'bundleInfo.promotionPhrase', '')
};
let oldPromotion = finalResult.promotion;
finalResult.promotion = [{
promotionTitle: _.get(bundleData, 'bundleInfo.promotionPhrase', ''),
promotionType: '量贩'
}];
_.forEach(oldPromotion, value => {
finalResult.promotion.push(value);
});
}
};
... ... @@ -301,6 +324,11 @@ const newDetail = {
finalResult.bundleData = tool.processBundle(bundleData, skn);
}
/* 量贩 */
if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 2) {
tool.processDiscount(finalResult, bundleData);
}
return finalResult;
});
},
... ...