Commit e1c68e6c by 朱继来

添加运费

parent 8bdef0c5
...@@ -960,17 +960,20 @@ ...@@ -960,17 +960,20 @@
} }
// 自营商品检查数量 // 自营商品检查数量
if (goods_type == 2) { // if (goods_type == 2) { // 20200826 订单合并后,不以goods_type为判断条件
var changeGoods = []; var changeGoods = [];
$('.shop-table tbody tr').each(function() { $('.shop-table tbody tr').each(function() {
var goods_id = $(this).find('.goods_id').text(); var goods_id = $(this).find('.goods_id').text();
var num = Number($(this).find('.goods_num').val()); var num = Number($(this).find('.goods_num').val());
var mpl = Number($(this).find('.goods_mpl').text()); var mpl = Number($(this).find('.goods_mpl').text());
var cart_id = $(this).data('cid'); var cart_id = $(this).data('cid');
var type = $(this).data('type'); var type = $(this).data('type');
var curr_goods_type = $(this).data('goods_type');
if (num % mpl != 0) { var self_goods_type = ['3', '4']; // 自营商品类型
// 自营商品 且 数量与倍数不匹配
if (self_goods_type.indexOf(curr_goods_type) != -1 && num % mpl != 0) {
num = Math.ceil(num / mpl) * mpl; num = Math.ceil(num / mpl) * mpl;
$.ajax({ $.ajax({
...@@ -992,7 +995,7 @@ ...@@ -992,7 +995,7 @@
layer.alert('已按倍数调整购买数量,商品ID:'+changeGoods.join(', ')); layer.alert('已按倍数调整购买数量,商品ID:'+changeGoods.join(', '));
self.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表 self.lists(user_id, goods_type, is_online, delivery_place); // 加载购物车列表
} }
} // }
} else { } else {
layer.msg(resp.errmsg || '网络异常'); layer.msg(resp.errmsg || '网络异常');
...@@ -1108,9 +1111,11 @@ ...@@ -1108,9 +1111,11 @@
$('.extend_fee_val').empty().text(data.extend_fee_format); // 附加费 $('.extend_fee_val').empty().text(data.extend_fee_format); // 附加费
} }
if (goods_type == 2 && business_type != 2) { // 自营仓库损耗不需要运费 // if (goods_type == 2 && business_type != 2) { // 自营仓库损耗不需要运费
$('.express_fee_val').empty().text(data.finally_shipping_price_format); // 运费 // $('.express_fee_val').empty().text(data.finally_shipping_price_format); // 运费
} // }
$('.express_fee_val').empty().text(data.finally_shipping_price_format); // 订单合并后,如果存在运费则需要展示
} else { } else {
$('.amount-section').show(); $('.amount-section').show();
$('.order_amount').empty().text(data.order_amount_format); $('.order_amount').empty().text(data.order_amount_format);
......
...@@ -468,6 +468,11 @@ ...@@ -468,6 +468,11 @@
</div> </div>
<div class="row"> <div class="row">
<p class="con-title"><span>运费:</span></p>
<p class="con-val express_fee_val">0.00</p>
</div>
<div class="row">
<p class="con-title"><span>应付金额:</span></p> <p class="con-title"><span>应付金额:</span></p>
<p class="con-val text-danger order_amount"></p> <p class="con-val text-danger order_amount"></p>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment