Commit bd324961 by 朱继来

防止重复提交订单

parent abbf1098
Showing with 8 additions and 2 deletions
...@@ -610,9 +610,11 @@ ...@@ -610,9 +610,11 @@
}) })
// 提交订单 // 提交订单
$('.submit-order').click(function() { // $('.submit-order').on('click', function() {
$('.submit-order').off().on('click', function() {
var self = $(this);
var address_id = $('input[name=address_id]').val(); var address_id = $('input[name=address_id]').val();
var type = $(this).data('type'); // 1-联营线上,2-自营线上,3-自营线下,4-自营其他业务 var type = self.data('type'); // 1-联营线上,2-自营线上,3-自营线下,4-自营其他业务
var cart_ids = []; var cart_ids = [];
var user_id = 0; var user_id = 0;
var remark = $('#remark').val(); // 订单备注 var remark = $('#remark').val(); // 订单备注
...@@ -666,6 +668,8 @@ ...@@ -666,6 +668,8 @@
datax.user_coupon_id = user_coupon_id; datax.user_coupon_id = user_coupon_id;
} }
self.attr('disabled', true).css('pointer-events', 'none'); // 成功生成订单后禁用按钮,防止重复提交
// 自营线上 // 自营线上
if (type == 2 && is_online == 1) { if (type == 2 && is_online == 1) {
var sale_type = $('#sale_type').val(); var sale_type = $('#sale_type').val();
...@@ -702,6 +706,8 @@ ...@@ -702,6 +706,8 @@
btn: [], btn: [],
}); });
self.removeAttr('disabled').css('pointer-events', 'auto');
return false; return false;
} }
}, },
......
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