diff --git a/www/css/styles.css b/www/css/styles.css index e7566c5..bfa05c7 100644 --- a/www/css/styles.css +++ b/www/css/styles.css @@ -79,4 +79,14 @@ html.md .navbar .link { #qrcode { max-height: calc(100% - var(--f7-navbar-height)); max-width: 100%; +} + +.numpad-button { + height: 10vh; + line-height: 10vh; +} + +.numpad-button span { + margin: auto auto; + font-weight: bold; } \ No newline at end of file diff --git a/www/js/home.js b/www/js/home.js index 7516b1a..a45f670 100644 --- a/www/js/home.js +++ b/www/js/home.js @@ -11,6 +11,16 @@ $("#payment-popup").on("popup:close", function () { stopPaymentCheck = true; }); +$(".numpad-button").on("click", function () { + var val = $(this).data("value"); + if (val == "C") { + $("#amount-box").val(""); + return; + } + + $("#amount-box").val($("#amount-box").val() + val); +}); + $("#showcodebtn").click(function () { var amount = $("#amount-box").val() * 1.0; if (amount <= 0) { @@ -47,8 +57,8 @@ function makeQrCode(amount, callback) { }); var base64 = window.btoa(svg); $("#qrcode").attr("src", 'data:image/svg+xml;base64,' + base64); - $("#pay-amount").text(data.amount); - $("#paid-amount").text(data.amount); + $("#pay-amount").text(data.amount.toFixed(2)); + $("#paid-amount").text(data.amount.toFixed(2)); app.preloader.hide(); checkPaymentStatus(data.txcode); callback(true); @@ -69,6 +79,7 @@ function checkPaymentStatus(txcode) { if (data.complete == true) { app.popup.close($("#payment-popup")); app.popup.open($("#paid-popup")); + $("#amount-box").val(""); } else { setTimeout(function () { checkPaymentStatus(txcode); diff --git a/www/pages/home.html b/www/pages/home.html index bd60e89..a29d203 100644 --- a/www/pages/home.html +++ b/www/pages/home.html @@ -22,16 +22,27 @@
-
-
-
-
+
+
+
+
$
-