修改结算页顺丰地址不支持地区的判定逻辑
Code Review By Rock Zhang
Showing
3 changed files
with
7 additions
and
8 deletions
framework @ e9d066dd
@@ -96,12 +96,6 @@ function orderCompute() { | @@ -96,12 +96,6 @@ function orderCompute() { | ||
96 | if ($.type(res) !== 'object') { | 96 | if ($.type(res) !== 'object') { |
97 | window.location.reload(); | 97 | window.location.reload(); |
98 | } else { | 98 | } else { |
99 | - /*if (res.order_amount) { | ||
100 | - res.order_amount = (+res.order_amount).toFixed(2); | ||
101 | - } | ||
102 | - if (res.discount_amount) { | ||
103 | - res.discount_amount = (+res.discount_amount).toFixed(2); | ||
104 | - }*/ | ||
105 | if (res.last_order_amount) { | 99 | if (res.last_order_amount) { |
106 | res.last_order_amount = (+res.last_order_amount).toFixed(2); | 100 | res.last_order_amount = (+res.last_order_amount).toFixed(2); |
107 | } | 101 | } |
@@ -127,6 +121,10 @@ function submitOrder() { | @@ -127,6 +121,10 @@ function submitOrder() { | ||
127 | var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), | 121 | var invoiceText = $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'), |
128 | msg = $('#msg').find('input').val() || orderInfo('msg'); | 122 | msg = $('#msg').find('input').val() || orderInfo('msg'); |
129 | 123 | ||
124 | + if (orderInfo('deliveryId') === 2 && !$addressWrap.data('support')) { | ||
125 | + tip.show('当前地址不支持顺丰快递'); | ||
126 | + return; | ||
127 | + } | ||
130 | if (orderInfo('invoice')) { | 128 | if (orderInfo('invoice')) { |
131 | if (!invoiceText) { | 129 | if (!invoiceText) { |
132 | tip.show('请输入发票抬头'); | 130 | tip.show('请输入发票抬头'); |
@@ -346,7 +346,8 @@ class CartModel | @@ -346,7 +346,8 @@ class CartModel | ||
346 | $result['phoneNum'] = isset($address['mobile']) ? $address['mobile'] : $payReturn['delivery_address']['mobile']; | 346 | $result['phoneNum'] = isset($address['mobile']) ? $address['mobile'] : $payReturn['delivery_address']['mobile']; |
347 | $result['area'] = isset($address['area']) ? $address['area'] : $payReturn['delivery_address']['area']; | 347 | $result['area'] = isset($address['area']) ? $address['area'] : $payReturn['delivery_address']['area']; |
348 | $result['address'] = isset($address['address']) ? $address['address'] : $payReturn['delivery_address']['address']; | 348 | $result['address'] = isset($address['address']) ? $address['address'] : $payReturn['delivery_address']['address']; |
349 | - $result['isSupport'] = ($payReturn['delivery_address']['is_support'] === 'Y'); | 349 | + $isSupport = isset($address['is_support']) ? $address['is_support'] : $payReturn['delivery_address']['is_support']; |
350 | + $result['isSupport'] = $isSupport === 'Y'; | ||
350 | } | 351 | } |
351 | 352 | ||
352 | // 配送方式 | 353 | // 配送方式 |
-
Please register or login to post a comment