Showing
4 changed files
with
12 additions
and
10 deletions
@@ -8944,6 +8944,10 @@ function showChooseGifDialog() { | @@ -8944,6 +8944,10 @@ function showChooseGifDialog() { | ||
8944 | }, function() { | 8944 | }, function() { |
8945 | window.location.href = cartContentShow().find('.freebie > a').attr('href'); | 8945 | window.location.href = cartContentShow().find('.freebie > a').attr('href'); |
8946 | }, function() { | 8946 | }, function() { |
8947 | + var info = window.cookie('order-info'); | ||
8948 | + if (info) { | ||
8949 | + window.setCookie('order-info', ''); | ||
8950 | + } | ||
8947 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; | 8951 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; |
8948 | }); | 8952 | }); |
8949 | } | 8953 | } |
@@ -9019,6 +9023,7 @@ if ($('.freebie').length > 0) { | @@ -9019,6 +9023,7 @@ if ($('.freebie').length > 0) { | ||
9019 | 9023 | ||
9020 | $('.btn-balance').on('touchend', function() { | 9024 | $('.btn-balance').on('touchend', function() { |
9021 | lowStockCount = 0; | 9025 | lowStockCount = 0; |
9026 | + var info = window.cookie('order-info'); | ||
9022 | if (shouldLowStocks()) { | 9027 | if (shouldLowStocks()) { |
9023 | tip.show('所选商品中有' + lowStockCount + '种库存不足的商品'); | 9028 | tip.show('所选商品中有' + lowStockCount + '种库存不足的商品'); |
9024 | return false; | 9029 | return false; |
@@ -9030,6 +9035,9 @@ $('.btn-balance').on('touchend', function() { | @@ -9030,6 +9035,9 @@ $('.btn-balance').on('touchend', function() { | ||
9030 | } | 9035 | } |
9031 | 9036 | ||
9032 | if (hasChecked()) { | 9037 | if (hasChecked()) { |
9038 | + if (info) { | ||
9039 | + window.setCookie('order-info', ''); | ||
9040 | + } | ||
9033 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; | 9041 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; |
9034 | } else { | 9042 | } else { |
9035 | tip.show('请先勾选商品'); | 9043 | tip.show('请先勾选商品'); |
@@ -9158,7 +9166,7 @@ $('.icon-del').on('touchstart', function(e) { | @@ -9158,7 +9166,7 @@ $('.icon-del').on('touchstart', function(e) { | ||
9158 | autoHide: true, | 9166 | autoHide: true, |
9159 | fast: true | 9167 | fast: true |
9160 | }); | 9168 | }); |
9161 | - window.setCookie('order-info', ''); | 9169 | + //window.setCookie('order-info', ''); |
9162 | window.setCookie('_yoho-cart-refreshByDelete', true); | 9170 | window.setCookie('_yoho-cart-refreshByDelete', true); |
9163 | window.location.href = '/cart/index/index?cartType=' + $('#cartType').val(); | 9171 | window.location.href = '/cart/index/index?cartType=' + $('#cartType').val(); |
9164 | } else { | 9172 | } else { |
@@ -9423,11 +9431,8 @@ $('.invoice').on('touchend', '.checkbox', function() { | @@ -9423,11 +9431,8 @@ $('.invoice').on('touchend', '.checkbox', function() { | ||
9423 | } | 9431 | } |
9424 | }); | 9432 | }); |
9425 | 9433 | ||
9426 | -function orderCompute(firstEnter) { | 9434 | +function orderCompute() { |
9427 | var yohoCoin = orderInfo('yohoCoin'); | 9435 | var yohoCoin = orderInfo('yohoCoin'); |
9428 | - if (firstEnter) { | ||
9429 | - yohoCoin = 0; | ||
9430 | - } | ||
9431 | $.ajax({ | 9436 | $.ajax({ |
9432 | method: 'POST', | 9437 | method: 'POST', |
9433 | url: '/cart/index/orderCompute', | 9438 | url: '/cart/index/orderCompute', |
@@ -9465,9 +9470,6 @@ function orderCompute(firstEnter) { | @@ -9465,9 +9470,6 @@ function orderCompute(firstEnter) { | ||
9465 | }); | 9470 | }); |
9466 | } | 9471 | } |
9467 | 9472 | ||
9468 | -// 进入页面计算一次价格 | ||
9469 | -//orderCompute(1); | ||
9470 | - | ||
9471 | function submitOrder() { | 9473 | function submitOrder() { |
9472 | var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), | 9474 | var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), |
9473 | msg = $('#msg').find('input').val() || orderInfo('msg'); | 9475 | msg = $('#msg').find('input').val() || orderInfo('msg'); |
@@ -9624,7 +9626,7 @@ require("js/common"); | @@ -9624,7 +9626,7 @@ require("js/common"); | ||
9624 | function init() { | 9626 | function init() { |
9625 | info = { | 9627 | info = { |
9626 | uid: window.getUid(), | 9628 | uid: window.getUid(), |
9627 | - deliveryId: 1, | 9629 | + deliveryId: $('.dispatch-mode .chosed').data('id') || 1, |
9628 | deliveryTimeId: 1, | 9630 | deliveryTimeId: 1, |
9629 | paymentTypeId: 1, | 9631 | paymentTypeId: 1, |
9630 | yohoCoin: 0, | 9632 | yohoCoin: 0, |
@@ -9645,7 +9647,7 @@ try { | @@ -9645,7 +9647,7 @@ try { | ||
9645 | info = JSON.parse(info); | 9647 | info = JSON.parse(info); |
9646 | 9648 | ||
9647 | // 2015/12/31 hf: fixes bug to 购物车页面调用该JS, 会导致有YOHO币,值却没有传给服务端. 因此需要再设置一下 | 9649 | // 2015/12/31 hf: fixes bug to 购物车页面调用该JS, 会导致有YOHO币,值却没有传给服务端. 因此需要再设置一下 |
9648 | - // info.yohoCoin = $('.coin').data('yoho-coin') || 0; | 9650 | + //info['yohoCoin'] = $('.coin').data('yoho-coin') || 0; |
9649 | } catch (e) { | 9651 | } catch (e) { |
9650 | init(); | 9652 | init(); |
9651 | } | 9653 | } |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
-
Please register or login to post a comment