Commit 13e1d2ce by 朱继来

调整购物车排序

parent 0c0aa129
Showing with 11 additions and 4 deletions
...@@ -459,6 +459,7 @@ ...@@ -459,6 +459,7 @@
// 调整商品数量 // 调整商品数量
$('.shop-table').delegate('.goods_num', 'blur', function() { $('.shop-table').delegate('.goods_num', 'blur', function() {
var self = $(this); var self = $(this);
var origin_num = self.data('origin_num'); // 原始数量
var num = self.val(); var num = self.val();
var min_buy = Number(self.parents('tr').attr('min_buy')); var min_buy = Number(self.parents('tr').attr('min_buy'));
var cart_id = self.parents('tr').data('cid'); var cart_id = self.parents('tr').data('cid');
...@@ -466,6 +467,8 @@ ...@@ -466,6 +467,8 @@
var user_id = 0; var user_id = 0;
var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆 var delivery_place = 1; // 1.大陆,2.香港 自营默认是大陆
if (origin_num == num) return; // 未修改数量,则return
if (internal_uid) { if (internal_uid) {
user_id = internal_uid; user_id = internal_uid;
} else { } else {
...@@ -534,6 +537,8 @@ ...@@ -534,6 +537,8 @@
return false; return false;
}, },
}) })
layer.msg('商品删除中...', {icon: 16, time: 0, shade: 0.3});
}, },
btn2: function (index) { btn2: function (index) {
layer.close(index); layer.close(index);
...@@ -643,6 +648,8 @@ ...@@ -643,6 +648,8 @@
layer.alert(resp.errmsg); layer.alert(resp.errmsg);
}, },
}) })
layer.msg('批量导入中...', {icon: 16, time: 0, shade: 0.3});
}) })
form.find('input[type="file"]').trigger('click'); form.find('input[type="file"]').trigger('click');
...@@ -868,11 +875,11 @@ ...@@ -868,11 +875,11 @@
if (len > 0) { if (len > 0) {
var buyer = ''; var buyer = '';
// list = list.reverse();
// 购物车列表 // 购物车列表
for (var i = 0; i < len; i++) { for (var i = len - 1 ; i >= 0; i--) {
html += '<tr data-cid="'+list[i].cart_id+'" data-type="'+list[i].type+'" min_buy="'+list[i].min_buy+'" data-sup_name="'+list[i].supplier_name+'" data-sup_id="'+list[i].supplier_id+'">'+ html += '<tr data-cid="'+list[i].cart_id+'" data-type="'+list[i].type+'" min_buy="'+list[i].min_buy+'" data-sup_name="'+list[i].supplier_name+'" data-sup_id="'+list[i].supplier_id+'">'+
'<td>'+(i+1)+'</td>'+ '<td>'+(len - i)+'</td>'+
'<td class="goods_id">'+list[i].goods_id+'</td>'+ '<td class="goods_id">'+list[i].goods_id+'</td>'+
'<td>'+list[i].goods_name+'</td>'+ '<td>'+list[i].goods_name+'</td>'+
'<td>'+list[i].brand_name+'</td>'; '<td>'+list[i].brand_name+'</td>';
...@@ -881,7 +888,7 @@ ...@@ -881,7 +888,7 @@
html += '<td><span class="goods_mpl">'+list[i].mpl+'</span></td>'; html += '<td><span class="goods_mpl">'+list[i].mpl+'</span></td>';
} }
html += '<td><input type="text" class="goods_num" name="goods_num" value="'+list[i].goods_number+'"></td>'+ html += '<td><input type="text" class="goods_num" name="goods_num" value="'+list[i].goods_number+'" data-origin_num="'+list[i].goods_number+'"></td>'+
'<td class="goods_price">'+list[i].goods_price+'</td>'+ '<td class="goods_price">'+list[i].goods_price+'</td>'+
'<td class="goods_amount">'+list[i].goods_amount_format+'</td>'+ '<td class="goods_amount">'+list[i].goods_amount_format+'</td>'+
'<td>'+list[i].delivery_time+'</td>'; '<td>'+list[i].delivery_time+'</td>';
......
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