...
|
...
|
@@ -16,6 +16,7 @@ var dispatchModeHammer, |
|
|
dispatchTimeHammer,
|
|
|
$invoice = $('.invoice'),
|
|
|
$price = $('.price-cal'),
|
|
|
$couponUse = $('.coupon-use.used'),
|
|
|
payType,
|
|
|
priceTmpl = Handlebars.compile($('#tmpl-price').html()),
|
|
|
queryString = $.queryString(),
|
...
|
...
|
@@ -27,6 +28,11 @@ if (window.getUid() !== orderInfo('uid')) { |
|
|
order.init();
|
|
|
}
|
|
|
|
|
|
if ($couponUse.data('value') !== orderInfo('couponValue')) {
|
|
|
orderInfo('couponCode', null);
|
|
|
orderInfo('couponValue', null);
|
|
|
}
|
|
|
|
|
|
function dispacthTapEvt(e) {
|
|
|
var $cur = $(e.target).closest('li');
|
|
|
|
...
|
...
|
@@ -110,10 +116,25 @@ function orderCompute() { |
|
|
}
|
|
|
|
|
|
function submitOrder() {
|
|
|
if (orderInfo('invoice') && !orderInfo('invoiceText')) {
|
|
|
var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
|
|
|
msg = $('#msg').find('input').val() || orderInfo('msg');
|
|
|
|
|
|
if (orderInfo('invoice')) {
|
|
|
if (!invoiceText) {
|
|
|
tip.show('请输入发票抬头');
|
|
|
return;
|
|
|
}
|
|
|
if (invoiceText.length > 30) {
|
|
|
tip.show('发票抬头不得超过30个汉字');
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (msg) {
|
|
|
if (msg.length > 40) {
|
|
|
tip.show('留言不得超过40个汉字');
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
loading.showLoadingMask();
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
...
|
...
|
@@ -123,9 +144,9 @@ function submitOrder() { |
|
|
cartType: queryString.cartType || queryString.carttype || 'ordinary',
|
|
|
deliveryId: orderInfo('deliveryId'),
|
|
|
deliveryTimeId: orderInfo('deliveryTimeId'),
|
|
|
invoiceText: $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
|
|
|
invoiceText: invoiceText,
|
|
|
invoiceType: $invoice.find('.invoice-type').val() || orderInfo('invoiceType'),
|
|
|
msg: $('#msg').find('input').val() || orderInfo('msg'),
|
|
|
msg: msg,
|
|
|
paymentTypeId: orderInfo('paymentTypeId'),
|
|
|
paymentType: orderInfo('paymentType'), //支付方式
|
|
|
couponCode: orderInfo('couponCode'),
|
...
|
...
|
@@ -198,7 +219,7 @@ $invoice.find('[name="invoice-title"]').on('blur', function() { |
|
|
orderInfo('invoiceType', $(this).val());
|
|
|
});
|
|
|
|
|
|
$('#msg').find('input').on('blur', function() {
|
|
|
$('#msg').find('textarea').on('blur', function() {
|
|
|
orderInfo('msg', $(this).val());
|
|
|
});
|
|
|
|
...
|
...
|
|