购物车前端库存判断问题优化

master
Bosen 2021-06-01 14:20:01 +08:00
parent 1f91165b65
commit 9b5487d2f2
2 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
site-url: 127.0.0.1
site-url: 47.115.118.34
server:
port: 80
tomcat:

View File

@ -237,7 +237,7 @@
var goodsStock = document.getElementById("goodsStock" + i);
var goodsState = document.getElementById("goodsState" + i);
var checkbox = document.getElementById("checkbox" + i);
if (goodsStock.value < 1 || goodsStock.value < goodsNum.value || goodsState.value != 1){
if (goodsStock.value < 1 || BigInt.valueOf(goodsStock.value) < BigInt.valueOf(goodsNum.value) || goodsState.value != 1){
checkbox.checked = false;
alert("您的购物车中存在超出库存,或者已下架的商品!");
}