From 0d83512a4f241e86ecc142c661e8cd26f33d3d96 Mon Sep 17 00:00:00 2001 From: Imugiii Date: Sat, 9 May 2026 07:59:45 +0000 Subject: [PATCH] feat(front): payment selection and order confirmation pages payment.html - card / cash choice with inline SVG icons; both simulate payment (MVP) confirmation.html - order number WK-, cart cleared on load, new-order button resets flow to index.html --- .../borne/assets/js/page-confirmation.js | 42 ++++++ src/public/borne/confirmation.html | 69 ++++++++++ src/public/borne/payment.html | 120 ++++++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 src/public/borne/assets/js/page-confirmation.js create mode 100644 src/public/borne/confirmation.html create mode 100644 src/public/borne/payment.html diff --git a/src/public/borne/assets/js/page-confirmation.js b/src/public/borne/assets/js/page-confirmation.js new file mode 100644 index 0000000..9173527 --- /dev/null +++ b/src/public/borne/assets/js/page-confirmation.js @@ -0,0 +1,42 @@ +/* + * page-confirmation.js — Order confirmation screen. + * + * Generates a short order number: "WK-" + Date.now() encoded in base 36. + * This is session-unique and human-readable at the counter. + * + * Clears the cart on load so that "Nouvelle commande" starts fresh. + */ + +import { clearCart, getTotalCents, formatPrice } from './state.js'; + +const orderNumberEl = document.getElementById('order-number'); +const orderTotalEl = document.getElementById('order-total'); +const newOrderBtn = document.getElementById('new-order-btn'); + +function generateOrderNumber() { + return 'WK-' + Date.now().toString(36).toUpperCase(); +} + +document.addEventListener('DOMContentLoaded', () => { + /* Capture total before clearing */ + const totalCents = getTotalCents(); + + if (orderTotalEl) { + orderTotalEl.textContent = formatPrice(totalCents); + } + + if (orderNumberEl) { + orderNumberEl.textContent = generateOrderNumber(); + } + + /* Clear cart immediately — order is confirmed */ + clearCart(); +}); + +if (newOrderBtn) { + newOrderBtn.addEventListener('click', () => { + /* clearCart() already called on DOMContentLoaded, but guard anyway */ + clearCart(); + window.location.href = 'index.html'; + }); +} diff --git a/src/public/borne/confirmation.html b/src/public/borne/confirmation.html new file mode 100644 index 0000000..4c86263 --- /dev/null +++ b/src/public/borne/confirmation.html @@ -0,0 +1,69 @@ + + + + + + + + Wakdo - Confirmation + + + + + + + + +
+ +
+ + + + +

Commande confirmee !

+ +

Votre commande est en preparation

+ +
+ Votre numero de commande + +
+ +

+ Montant regle : +

+ +

+ Temps d'attente estime : 5 - 10 minutes +

+ +
+ + + +
+ + + + diff --git a/src/public/borne/payment.html b/src/public/borne/payment.html new file mode 100644 index 0000000..d43d3f3 --- /dev/null +++ b/src/public/borne/payment.html @@ -0,0 +1,120 @@ + + + + + + + + Wakdo - Paiement + + + + + + + + +
+ +

Comment souhaitez-vous payer ?

+ + +
+ +
+ +
+ + + + + + + +
+ +
+ + + + + +