...
|
...
|
@@ -93,8 +93,7 @@ function orderCompute() { |
|
|
}).then(function(res) {
|
|
|
var priceHtml;
|
|
|
|
|
|
if (!res) {
|
|
|
tip.show('网络出错');
|
|
|
if (!res.length) {
|
|
|
window.location.reload();
|
|
|
} else {
|
|
|
/*if (res.order_amount) {
|
...
|
...
|
@@ -106,8 +105,12 @@ function orderCompute() { |
|
|
if (res.last_order_amount) {
|
|
|
res.last_order_amount = (+res.last_order_amount).toFixed(2);
|
|
|
}
|
|
|
$coinCheck.find('em').html('- ¥ ' + res.use_yoho_coin);
|
|
|
$coinUsed.html('已抵¥' + res.use_yoho_coin);
|
|
|
if (res.use_yoho_coin) {
|
|
|
$coinCheck.find('em').html('- ¥ ' + res.use_yoho_coin);
|
|
|
$coinUsed.html('已抵¥' + res.use_yoho_coin);
|
|
|
$coinCheck.find('em').show();
|
|
|
$coinUsed.show();
|
|
|
}
|
|
|
priceHtml = priceTmpl({
|
|
|
cartPayData: res.promotion_formula_list,
|
|
|
price: res.last_order_amount
|
...
|
...
|
@@ -116,7 +119,6 @@ function orderCompute() { |
|
|
$price.html(priceHtml);
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
tip.show('网络出错');
|
|
|
window.location.reload();
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -163,7 +165,6 @@ function submitOrder() { |
|
|
var url;
|
|
|
|
|
|
if (!res) {
|
|
|
loading.hideLoadingMask();
|
|
|
tip.show('网络出错');
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -177,13 +178,13 @@ function submitOrder() { |
|
|
}
|
|
|
window.setCookie('order-info', '');
|
|
|
window.location.href = url;
|
|
|
} else {
|
|
|
loading.hideLoadingMask();
|
|
|
tip.show(res.message || '网络出错');
|
|
|
} else if (res.message) {
|
|
|
tip.show(res.message);
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
loading.hideLoadingMask();
|
|
|
tip.show('网络出错');
|
|
|
}).always(function() {
|
|
|
loading.hideLoadingMask();
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -215,9 +216,7 @@ $('.coin').on('touchend', function() { |
|
|
|
|
|
if ($this.find('.checkbox').hasClass('icon-cb-checked')) {
|
|
|
orderInfo('yohoCoin', $this.data('yoho-coin'));
|
|
|
$this.find('.coin-check em').show();
|
|
|
$this.find('.can-use').hide();
|
|
|
$this.find('.used').show();
|
|
|
} else {
|
|
|
orderInfo('yohoCoin', 0);
|
|
|
$this.find('.coin-check em').hide();
|
...
|
...
|
|