...
|
...
|
@@ -30,6 +30,35 @@ function dispacthTapEvt(e) { |
|
|
$cur.addClass('chosed');
|
|
|
}
|
|
|
|
|
|
dispatchModeHammer = new Hammer(document.getElementsByClassName('dispatch-mode')[0]);
|
|
|
dispatchModeHammer.on('tap', dispacthTapEvt);
|
|
|
|
|
|
dispatchTimeHammer = new Hammer(document.getElementsByClassName('dispatch-time')[0]);
|
|
|
dispatchTimeHammer.on('tap', dispacthTapEvt);
|
|
|
|
|
|
$('.checkbox').on('touchstart', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('icon-cb-checked')) {
|
|
|
$this.removeClass('icon-cb-checked').addClass('icon-checkbox');
|
|
|
return;
|
|
|
}
|
|
|
if ($this.hasClass('icon-checkbox')) {
|
|
|
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.invoice').on('touchend', '.checkbox', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('icon-cb-checked')) {
|
|
|
$('.invoice').addClass('focus');
|
|
|
}
|
|
|
if ($this.hasClass('icon-checkbox')) {
|
|
|
$('.invoice').removeClass('focus');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
function orderCompute() {
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
...
|
...
|
@@ -62,34 +91,29 @@ function orderCompute() { |
|
|
});
|
|
|
}
|
|
|
|
|
|
dispatchModeHammer = new Hammer(document.getElementsByClassName('dispatch-mode')[0]);
|
|
|
dispatchModeHammer.on('tap', dispacthTapEvt);
|
|
|
|
|
|
dispatchTimeHammer = new Hammer(document.getElementsByClassName('dispatch-time')[0]);
|
|
|
dispatchTimeHammer.on('tap', dispacthTapEvt);
|
|
|
|
|
|
$('.checkbox').on('touchstart', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('icon-cb-checked')) {
|
|
|
$this.removeClass('icon-cb-checked').addClass('icon-checkbox');
|
|
|
return;
|
|
|
}
|
|
|
if ($this.hasClass('icon-checkbox')) {
|
|
|
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.invoice').on('touchend', '.checkbox', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('icon-cb-checked')) {
|
|
|
$('.invoice').addClass('focus');
|
|
|
}
|
|
|
if ($this.hasClass('icon-checkbox')) {
|
|
|
$('.invoice').removeClass('focus');
|
|
|
}
|
|
|
});
|
|
|
function submitOrder() {
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
|
url: '/shoppingCart/orderSub',
|
|
|
data: {
|
|
|
addressId: orderInfo('addressId'),
|
|
|
cartType: orderInfo('cartType'),
|
|
|
deliveryId: orderInfo('deliveryId'),
|
|
|
deliveryTimeId: orderInfo('deliveryTimeId'),
|
|
|
invoiceText: orderInfo('invoiceText'),
|
|
|
invoiceType: orderInfo('invoiceType'),
|
|
|
msg: orderInfo('msg'),
|
|
|
paymentTypeId: orderInfo('paymentTypeId'),
|
|
|
paymentType: orderInfo('paymentType'), //支付方式
|
|
|
couponCode: orderInfo('couponCode'),
|
|
|
yohoCoin: orderInfo('yohoCoin')
|
|
|
}
|
|
|
}).then(function(res) {
|
|
|
console.log(res);
|
|
|
}).fail(function() {
|
|
|
tip.show('网络出错');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 界面点击,状态存 cookie
|
|
|
$('.dispatch-mode').on('touchend', 'li', function() {
|
...
|
...
|
@@ -132,4 +156,6 @@ $('#msg').find('input').on('blur', function() { |
|
|
|
|
|
$('.pay-mode').on('click', 'li', function() {
|
|
|
orderInfo('paymentTypeId', $(this).data('pay-id'));
|
|
|
orderInfo('paymentType', $(this).data('pay-type'));
|
|
|
submitOrder();
|
|
|
}); |
...
|
...
|
|