...
|
...
|
@@ -20,7 +20,8 @@ var $invoice = $('.invoice'), |
|
|
queryString = $.queryString(),
|
|
|
orderInfo = order.orderInfo,
|
|
|
isSubmiting,
|
|
|
dispatchInfo;
|
|
|
dispatchInfo,
|
|
|
total;
|
|
|
|
|
|
require('../common');
|
|
|
|
...
|
...
|
@@ -78,16 +79,16 @@ if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) { |
|
|
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
|
|
|
}
|
|
|
|
|
|
function dispacthTapEvt(e) {
|
|
|
var $cur = $(e.target).closest('li');
|
|
|
// function dispacthTapEvt(e) {
|
|
|
// var $cur = $(e.target).closest('li');
|
|
|
|
|
|
if ($cur.length === 0 || $cur.hasClass('chosed')) {
|
|
|
return;
|
|
|
}
|
|
|
// if ($cur.length === 0 || $cur.hasClass('chosed')) {
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
$cur.siblings('li.chosed').removeClass('chosed');
|
|
|
$cur.addClass('chosed');
|
|
|
}
|
|
|
// $cur.siblings('li.chosed').removeClass('chosed');
|
|
|
// $cur.addClass('chosed');
|
|
|
// }
|
|
|
|
|
|
$('.checkbox').on('touchstart', function() {
|
|
|
var $this = $(this);
|
...
|
...
|
@@ -128,7 +129,6 @@ function orderCompute() { |
|
|
skuList: isLimitGood() ? orderInfo('skuList') : undefined
|
|
|
}
|
|
|
}).then(function(res) {
|
|
|
|
|
|
if ($.type(res) !== 'object') {
|
|
|
window.location.reload();
|
|
|
} else {
|
...
|
...
|
@@ -141,6 +141,18 @@ function orderCompute() { |
|
|
$coinCheck.find('em').show();
|
|
|
$coinUsed.show();
|
|
|
}
|
|
|
total = '';
|
|
|
if (res.promotion_formula_list) {
|
|
|
$.each(res.promotion_formula_list, function(index, value) {
|
|
|
total += '<li>' +
|
|
|
'<p>' + value.promotion + '</p>' +
|
|
|
'<span>' + value.promotion_amount + '</span>' +
|
|
|
'</li>';
|
|
|
});
|
|
|
$('.price-cost span').html('¥' + res.last_order_amount);
|
|
|
$('.bill span').html('¥' + res.last_order_amount);
|
|
|
$('.total').html(total);
|
|
|
}
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
window.location.reload();
|
...
|
...
|
@@ -231,17 +243,8 @@ if (!orderInfo('addressId')) { |
|
|
}
|
|
|
|
|
|
$('.dispatch-mode').on('touchend', 'li', function() {
|
|
|
var $defaultMode = $('.dispatch-mode [data-id="1"]');
|
|
|
|
|
|
if (!$addressWrap.data('support') && $(this).data('id') === 2) {
|
|
|
dispacthTapEvt({
|
|
|
target: $defaultMode
|
|
|
});
|
|
|
tip.show('当前地址不支持顺丰快递');
|
|
|
} else {
|
|
|
orderInfo('deliveryId', $(this).data('id'));
|
|
|
orderCompute();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.dispatch-time').on('touchend', 'li', function() {
|
...
|
...
|
@@ -295,19 +298,23 @@ $('form').on('submit', function() { |
|
|
|
|
|
// xwg 2016/3/21 13:22
|
|
|
$('.dispatch').on('touchend', 'h3', function() {
|
|
|
if ($(this).siblings('ul').find('li').length === 1) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if ($(this).siblings('ul').is(':hidden')) {
|
|
|
|
|
|
$('.down').removeClass('hide');
|
|
|
$('.up').addClass('hide');
|
|
|
|
|
|
$('.up', this).removeClass('hide');
|
|
|
$('.down', this).addClass('hide');
|
|
|
$('.dispatch ul').hide();
|
|
|
$(this).siblings('ul').show();
|
|
|
} else {
|
|
|
$('.down', this).removeClass('hide');
|
|
|
$('.up', this).addClass('hide');
|
|
|
$(this).siblings('ul').hide();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$subBlock.on('touchstart', 'li', function() {
|
|
|
console.log($(this).hasClass('icon-radio'));
|
|
|
$.each($(this).parents('ul').find('i'), function() {
|
|
|
$(this).parents('ul').find('i').removeClass('icon-cb-radio').addClass('icon-radio');
|
|
|
});
|
...
|
...
|
@@ -323,7 +330,9 @@ $subBlock.on('touchstart', 'li', function() { |
|
|
|
|
|
$('.bill a').on('touchstart', function() {
|
|
|
orderInfo('paymentTypeId', $('.delivery-id .icon-cb-radio').data('id'));
|
|
|
orderInfo('paymentType', $('.delivery-time .icon-cb-radio').data('id'));
|
|
|
orderInfo('paymentType', $('.payment-type .icon-cb-radio').data('id'));
|
|
|
|
|
|
payType = $('.payment-type .icon-cb-radio').data('id');
|
|
|
submitOrder();
|
|
|
});
|
|
|
|
...
|
...
|
|