diff --git a/src/main/ui/static/templates/alipay/v4/payment.js b/src/main/ui/static/templates/alipay/v4/payment.js index cebc20af2..f13ab66bb 100644 --- a/src/main/ui/static/templates/alipay/v4/payment.js +++ b/src/main/ui/static/templates/alipay/v4/payment.js @@ -42,7 +42,7 @@ $(function () { return; } var char = $(this).val(); - if (parseFloat(char) > 10000) { + if (parseFloat(char) >= 100000) { char = char.slice(0, char.length - 1); $(this).val(char); return; @@ -167,20 +167,18 @@ $(function () { return; } var pointLocation = dataCache.price.indexOf('.'); - if (pointLocation >= 0 || char == '.' || char.length < 5) { - if (pointLocation >= 0 && char == '.') { - return; - } - if (pointLocation >= 0 && pointLocation <= char.length - 4) { - return; - } - if (dataCache.price == '0' && char != '.') { - dataCache.price = ''; - } + if (char == '.' || char.length > 8) { + return; + } + if (pointLocation >= 0 && pointLocation <= char.length - 4) { + return; + } + if (dataCache.price == '0' && char != '.') { + dataCache.price = ''; + } dataCache.price = char; updatePrice(); updatePoundageStatus(); - } } function updatePoundageStatus() { diff --git a/src/main/ui/static/templates/payment/v4/payment.js b/src/main/ui/static/templates/payment/v4/payment.js index debf29239..57be3fa46 100644 --- a/src/main/ui/static/templates/payment/v4/payment.js +++ b/src/main/ui/static/templates/payment/v4/payment.js @@ -34,7 +34,7 @@ $(function () { return; } var char = $(this).val(); - if (parseFloat(char) > 10000) { + if (parseFloat(char) >= 100000) { char = char.slice(0, char.length - 1); $(this).val(char); return; @@ -159,20 +159,18 @@ $(function () { return; } var pointLocation = dataCache.price.indexOf('.'); - if (pointLocation >= 0 || char == '.' || char.length < 5) { - if (pointLocation >= 0 && char == '.') { - return; - } - if (pointLocation >= 0 && pointLocation <= char.length - 4) { + if (char == '.' || char.length > 8) { + return; + } + if (pointLocation >= 0 && pointLocation <= char.length - 4) { return; - } - if (dataCache.price == '0' && char != '.') { + } + if (dataCache.price == '0' && char != '.') { dataCache.price = ''; - } + } dataCache.price = char; updatePrice(); updatePoundageStatus(); - } } function updatePoundageStatus() {