...
|
...
|
@@ -264,7 +264,8 @@ function tranformPayment(data, orderInfo, cartType, skuList, orderComputeData) { |
|
|
skuList: skuList
|
|
|
}, jitInfo);
|
|
|
|
|
|
result.jitDetailUrl = helpers.urlFormat('/cart/index/jitDetail', param);
|
|
|
result.jitDetailUrl = helpers.urlFormat('/cart/index/new/jitDetail', param);
|
|
|
result.packageTitle = cartData.package_title;
|
|
|
}
|
|
|
|
|
|
result.cartPayData = cartData.promotion_formula_list;
|
...
|
...
|
@@ -316,8 +317,53 @@ function coupon(count, orderInfo, orderComputeData) { |
|
|
return coupons;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* JIT 拆单数据处理
|
|
|
*/
|
|
|
function transformJit(packageList) {
|
|
|
let result = {
|
|
|
packages: []
|
|
|
};
|
|
|
|
|
|
_.forEach(packageList, (pValue, pKey) => {
|
|
|
result.packages[pKey] = {
|
|
|
packageType: '包裹' + (pKey + 1) + ':' + pValue.title
|
|
|
};
|
|
|
|
|
|
_.forEach(pValue.goods_list, (gValue, gKey) => {
|
|
|
result.packages[pKey].goods = [];
|
|
|
result.packages[pKey].goods[gKey] = {
|
|
|
thumb: gValue.goods_images
|
|
|
};
|
|
|
|
|
|
switch (gValue.goods_type) {
|
|
|
case 'price_gift' :
|
|
|
// 加价购
|
|
|
result.packages[pKey].goods[gKey].isAdd = true;
|
|
|
break;
|
|
|
case 'gift' :
|
|
|
// 赠品
|
|
|
result.packages[pKey].goods[gKey].isGift = true;
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (pValue.shopping_cost !== '0.00') {
|
|
|
result.packages[pKey].expressCost = pValue.shopping_cost;
|
|
|
}
|
|
|
if (pValue.shopping_cut_cost !== '0.00') {
|
|
|
result.packages[pKey].discount = pValue.shopping_cut_cost;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
module.exports = {
|
|
|
tranformPayment,
|
|
|
yohoCoinCompute,
|
|
|
coupon
|
|
|
coupon,
|
|
|
transformJit
|
|
|
}; |
...
|
...
|
|