fix :
- second display ui adjustment - show ui on cashier
This commit is contained in:
@@ -205,16 +205,22 @@
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 d-flex flex-column h-100" style="padding-right: 10px;">
|
||||
|
||||
<div class="card-block">
|
||||
<div class="payment-waiting text-center" style="height: 400px; display: flex; flex-direction: column; justify-content: center; align-items: center;">
|
||||
<div class="payment-waiting text-center" style="height: 400px; display: flex; flex-direction: column; justify-content: space-between; align-items: center;">
|
||||
<img src="/image/mmqr.webp" alt="MMQR Payment" style="max-width: 120px; margin-bottom: 10px;">
|
||||
<h3 class="m-t-20" style="color: #555;">Waiting for Customer Payment</h3>
|
||||
<p class="text-muted">Please ask customer to scan the QR code</p>
|
||||
<div class="processing-indicator m-t-10">
|
||||
<% if @qr_svg %>
|
||||
<div>
|
||||
<%= raw @qr_svg %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="processing-indicator m-t-10" style="margin-top: 8rem;">
|
||||
<div class="processing-dot"></div>
|
||||
<div class="processing-dot"></div>
|
||||
<div class="processing-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="d-flex" style="margin-top: 10rem;">
|
||||
<button class="btn btn-block btn-default waves-effect" id="cancel-btn">Cancel</button>
|
||||
</div>
|
||||
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
||||
@@ -252,8 +258,7 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const paymentWaiting = document.querySelector('.payment-waiting');
|
||||
let amountToReceive = <%= number_with_precision(@sale_data.grand_total, precision: precision.to_i) %>;
|
||||
let receipt_no = document.querySelector('#receipt_no').textContent;
|
||||
console.log(receipt_no);
|
||||
const receipt_no = document.querySelector('#receipt_no').textContent;
|
||||
const ws = new WebSocket("wss://juicecorner-0mo.sx-fc.app/cable");
|
||||
|
||||
|
||||
@@ -264,7 +269,8 @@
|
||||
ws.send(JSON.stringify({
|
||||
command: "subscribe",
|
||||
identifier: JSON.stringify({
|
||||
channel: "TestChannel"
|
||||
channel: "TestChannel",
|
||||
// receipt_no: receipt_no
|
||||
})
|
||||
}));
|
||||
}
|
||||
@@ -279,6 +285,7 @@
|
||||
|
||||
if(msg?.message?.status === "PAY_SUCCESS") {
|
||||
paymentWaiting.innerHTML = `
|
||||
<img src="/image/mmqr.webp" alt="MMQR Payment" style="max-width: 120px; margin-bottom: 10px;">
|
||||
<div class="payment-success text-center">
|
||||
<i class="material-icons" style="font-size: 50px; color: #4CAF50;">check_circle</i>
|
||||
<h3 class="m-t-20" style="color: #4CAF50;">Payment Successful!</h3>
|
||||
@@ -341,10 +348,12 @@
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
}).then(function(res) {
|
||||
customer_display_view(null,"reload");
|
||||
return res.json();
|
||||
}).then(function(data) {
|
||||
if(data.status) {
|
||||
window.location.href = "/"
|
||||
|
||||
window.location.href = "/";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user