Showing
2 changed files
with
11 additions
and
2 deletions
@@ -6003,8 +6003,17 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | @@ -6003,8 +6003,17 @@ $yohoPage.on('touchstart', '.btn-minus', function() { | ||
6003 | url = $('#limitProductPay').val() + '?limitproductcode=' + limitProductCode + '&sku=' + | 6003 | url = $('#limitProductPay').val() + '?limitproductcode=' + limitProductCode + '&sku=' + |
6004 | productSku + '&skn=' + skn + '&buy_number=' + buyNumber; | 6004 | productSku + '&skn=' + skn + '&buy_number=' + buyNumber; |
6005 | 6005 | ||
6006 | - //打开结算页面,结束函数执行。 | ||
6007 | - window.location.href = url; | 6006 | + // 调用接口判断商品是否可以购买 |
6007 | + $.ajax({ | ||
6008 | + url: url | ||
6009 | + }).then(function(res) { | ||
6010 | + | ||
6011 | + // 如果有错,则商品不可购买,执行页面刷新,否则跳到结算页面 | ||
6012 | + res.error ? window.location.reload() : window.location.href = url; | ||
6013 | + }).fail(function() { | ||
6014 | + window.location.reload(); | ||
6015 | + }); | ||
6016 | + | ||
6008 | return false; | 6017 | return false; |
6009 | 6018 | ||
6010 | } else { | 6019 | } else { |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment