Authored by xuqi

shipping cut show

... ... @@ -33,6 +33,10 @@ const index = uid => {
let goods = theData.goods_list;
let shopping = theData.shopping_cart_data;
let packageList = shopping.package_list;
_.forEach(goods, theGoods => {
let splitName = theGoods.product_name.split(' ');
... ... @@ -55,7 +59,26 @@ const index = uid => {
theData.yoho_coin *= 100; // 有货币稀释
theData.shopping_cart_data.balanceCoin = theData.use_yoho_coin;
shopping.balanceCoin = theData.use_yoho_coin;
// 拆单后的邮费优惠计算
if (packageList) {
let shippingOrigin = 0;
let shippingCut = 0;
_.forEach(packageList, i => {
shippingOrigin += (i.shopping_orig_cost >>> 0);
shippingCut += (i.shopping_cut_cost >>> 0);
});
// 对运费的数据进行扩展
shippingCut === 0 || Object.assign(
_.filter(shopping.promotion_formula_list, i => i.promotion === '运费'), {
shippingCut: shippingCut,
shippingOrigin: shippingOrigin
}
);
}
return data;
}
... ...
... ... @@ -183,7 +183,12 @@
<ul id="balance-list" class="balance-list right">
{{#each promotion_formula_list}}
<li>
<span class="balance-title">{{promotion}}</span>
<span class="balance-title">
{{promotion}}
{{#if shippingCut}}
<em>(原价:{{shippingOrigin}}元,优惠:{{shippingCut}}元)</em>
{{/if}}
</span>
<span class="balance-cost">{{promotion_amount}}</span>
</li>
{{/each}}
... ...