Authored by 毕凯

不同时提交订单

... ... @@ -23,7 +23,8 @@ var dispatchModeHammer,
payType,
priceTmpl = Handlebars.compile($('#tmpl-price').html()),
queryString = $.queryString(),
orderInfo = order.orderInfo;
orderInfo = order.orderInfo,
isSubmiting;
lazyLoad();
... ... @@ -127,6 +128,9 @@ function submitOrder() {
var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
msg = $('#msg').find('input').val() || orderInfo('msg');
if (isSubmiting) {
return false;
}
if (orderInfo('invoice')) {
if (!invoiceText) {
tip.show('请输入发票抬头');
... ... @@ -144,6 +148,7 @@ function submitOrder() {
}
}
loading.showLoadingMask();
isSubmiting = true;
$.ajax({
method: 'POST',
url: '/cart/index/orderSub',
... ... @@ -184,6 +189,7 @@ function submitOrder() {
}).fail(function() {
tip.show('网络出错');
}).always(function() {
isSubmiting = false;
loading.hideLoadingMask();
});
}
... ...