...
|
...
|
@@ -379,38 +379,31 @@ function transformJit(packageList) { |
|
|
};
|
|
|
|
|
|
_.forEach(packageList, (pValue, pKey) => {
|
|
|
result.packages[pKey] = {
|
|
|
packageType: (pKey + 1) + ':' + pValue.title
|
|
|
let perPackageData = {
|
|
|
packageType: (pKey + 1) + ':' + pValue.title,
|
|
|
goods: []
|
|
|
};
|
|
|
|
|
|
_.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;
|
|
|
perPackageData.push({
|
|
|
expressCost: pValue.shopping_cost
|
|
|
});
|
|
|
}
|
|
|
if (pValue.shopping_cut_cost !== '0.00') {
|
|
|
result.packages[pKey].discount = pValue.shopping_cut_cost;
|
|
|
perPackageData.push({
|
|
|
discount: pValue.shopping_cut_cost
|
|
|
});
|
|
|
}
|
|
|
result.packages.push(perPackageData);
|
|
|
|
|
|
_.forEach(pValue.goods_list, gValue => {
|
|
|
result.packages[pKey].goods.push({
|
|
|
thumb: gValue.goods_images,
|
|
|
isAdd: gValue.goods_type === 'price_gift',
|
|
|
isGift: gValue.goods_type === 'gift'
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
...
|
...
|
|