feat(ReserverController): Gère la durée et le prix total des produits.

⬆️ refactor(FlowReserve.js): Affiche le prix total au lieu du prix par jour.
This commit is contained in:
Serreau Jovann
2026-01-30 18:18:49 +01:00
parent 5cb93029b4
commit 3226b81bfb
2 changed files with 186 additions and 56 deletions

View File

@@ -241,7 +241,7 @@ export class FlowReserve extends HTMLAnchorElement {
</div>
</div>
<div class="flex justify-between items-end mt-2">
<span class="text-[#0782bc] font-black text-sm">${this.formatPrice(product.priceTTC1Day || product.priceHt1Day)} <span class="text-[9px] text-slate-400 font-bold">/j</span></span>
<span class="text-[#0782bc] font-black text-sm">${this.formatPrice(product.totalPriceTTC || product.totalPriceHT)} <span class="text-[9px] text-slate-400 font-bold">Total</span></span>
<button class="text-red-400 hover:text-red-600 p-1 remove-btn" data-remove-id="${product.id}">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
</button>
@@ -252,10 +252,11 @@ export class FlowReserve extends HTMLAnchorElement {
container.innerHTML = `<div class="space-y-3">${datesHtml}${productsHtml}</div>`;
// Attach event listeners for remove buttons
// Attach event listeners
container.querySelectorAll('.remove-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
e.preventDefault();
e.stopPropagation();
this.removeFromList(btn.dataset.removeId);
});
});