Commit 13e1d2ce by 朱继来

调整购物车排序

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