diff --git a/src/components/App/CheckoutDelivery.vue b/src/components/App/CheckoutDelivery.vue index 8190a10..3cfee10 100644 --- a/src/components/App/CheckoutDelivery.vue +++ b/src/components/App/CheckoutDelivery.vue @@ -1,114 +1,297 @@ diff --git a/src/components/App/FineSection.vue b/src/components/App/FineSection.vue index 1ff99ed..8339136 100644 --- a/src/components/App/FineSection.vue +++ b/src/components/App/FineSection.vue @@ -26,7 +26,7 @@ const fineData = ref({ /** Métodos */ const handleSearch = async () => { if (!fineNumber.value.trim()) { - window.Notify.warning("Por favor ingresa o escanea una multa"); + Notify.warning("Por favor ingresa o escanea una multa"); return; } @@ -38,7 +38,7 @@ const handleSearch = async () => { const model = data.model; if (model.status === "paid") { - window.Notify.info("La multa ya ha sido pagada previamente"); + Notify.info("La multa ya ha sido pagada previamente"); fineData.value = { id: model.id, @@ -76,7 +76,7 @@ const handleSearch = async () => { }); }, onFail: (error) => { - window.Notify.error(error.message || "Error al buscar la multa"); + Notify.error(error.message || "Error al buscar la multa"); fineData.value = { fecha: "", placa: "", @@ -90,37 +90,37 @@ const handleSearch = async () => { }, onError: (error) => { console.error("Error al buscar multa:", error); - window.Notify.error("Ocurrió un error al buscar la multa"); + Notify.error("Ocurrió un error al buscar la multa"); }, }); }; const handlePayment = async () => { if (!fineData.value.monto) { - window.Notify.warning("No hay multa cargada para cobrar"); + Notify.warning("No hay multa cargada para cobrar"); return; } if (fineData.value.isPaid) { - window.Notify.warning("Esta multa ya ha sido pagada previamente"); + Notify.warning("Esta multa ya ha sido pagada previamente"); return; } await api.post(apiURL(`fines/${fineData.value.id}/mark-as-paid`), { onSuccess: (data) => { - window.Notify.success("Multa cobrada exitosamente"); + Notify.success("Multa cobrada exitosamente"); emit("payment-processed", { ...fineData.value, paymentData: data }); fineData.value.isPaid = true; }, onFail: (error) => { - window.Notify.error( + Notify.error( error.message || "Error al procesar el pago de la multa" ); }, onError: (error) => { - window.Notify.error("Ocurrió un error al procesar el pago de la multa"); + Notify.error("Ocurrió un error al procesar el pago de la multa"); }, }); }; diff --git a/src/components/App/MembershipSection.vue b/src/components/App/MembershipSection.vue index 9e3cf89..db438f9 100644 --- a/src/components/App/MembershipSection.vue +++ b/src/components/App/MembershipSection.vue @@ -1,75 +1,221 @@ @@ -79,36 +225,33 @@ const calculateTotal = () => {

Buscar miembro

-
- - - +
-
+

Información del Miembro

@@ -120,9 +263,16 @@ const calculateTotal = () => { Fotografía
+ {
- - - + + + + + +
+
+

Tipo de membresía:

+

+ {{ activeMembership.charge_concept.name }} +

+
+ +
+

Expira:

+

{{ expiresAt }}

+
+
-
+

Realizar Cobro de Membresía

- - + +
+ +

+ Costo unitario: ${{ + activeMembership.charge_concept.unit_cost_peso + }} +

+
- + +
+ +
+

+ {{ + isMembershipActive + ? "✓ Membresía activa" + : "✗ Membresía vencida" + }} +

+

+ {{ + daysUntilExpiration === 1 + ? "Vence mañana" + : `Vence en ${daysUntilExpiration} días` + }} +

+
+ +
+

Tipo de membresía:

+

+ {{ activeMembership.charge_concept.name }} +

+
+ +
+

+ {{ isMembershipActive ? "Expira:" : "Expiró:" }} +

+

{{ expiresAt }}

+
+
+ +
diff --git a/src/components/App/QRscan.vue b/src/components/App/QRscan.vue index d7de406..ecfdb4a 100644 --- a/src/components/App/QRscan.vue +++ b/src/components/App/QRscan.vue @@ -3,14 +3,14 @@ import { ref } from 'vue'; import { QrcodeStream } from 'vue-qrcode-reader'; /** Props y Emits */ -defineProps({ - fineNumber: { +const props = defineProps({ + modelValue: { type: String, default: '' } }); -const emit = defineEmits(['update:fineNumber', 'fine-searched']); +const emit = defineEmits(['update:modelValue', 'qr-detected']); /** Refs */ const error = ref(''); @@ -34,13 +34,13 @@ function onDetect(detectedCodes) { const code = detectedCodes[0].rawValue; // Emitir el código escaneado al componente padre - emit('update:fineNumber', code); + emit('update:modelValue', code); // Pausar el escaneo después de detectar isScanning.value = false; - // Emitir evento para buscar la multa - emit('fine-searched'); + // Emitir evento con el código detectado + emit('qr-detected', code); // Reactivar el escaneo después de 2 segundos setTimeout(() => {