Browse Source

show next number in frontend

Erwin Jacimino 8 tháng trước cách đây
mục cha
commit
cb18fefe81
2 tập tin đã thay đổi với 8 bổ sung3 xóa
  1. 6 1
      public/register/app.js
  2. 2 2
      public/register/index.html

+ 6 - 1
public/register/app.js

@@ -100,7 +100,12 @@ function hideGlobalLoader() {
     }
 }
 
-document.addEventListener('DOMContentLoaded', function () {
+document.addEventListener('DOMContentLoaded', async function () {
+    const nextIdResponse = await fetch('/api/users/next');
+    if (nextIdResponse.ok) {
+        const nextIdData = await nextIdResponse.json();
+        document.getElementById('successMessage').innerHTML = `Revisa tu correo electronico para establecer tu PIN<br/><br/>serias ser el <strong>${nextIdData.next_id} usuario 🫢</strong>`;
+    }
     createGlobalLoader();
     hideGlobalLoader();
  //   showRegisterModal();

+ 2 - 2
public/register/index.html

@@ -92,9 +92,9 @@
 
         <!-- Mensaje de éxito -->
         <div>
-          <h1 class="text-3xl font-bold text-gray-900 mb-3">Revisa tu correo electronico para establecer tu PIN</h1>
+          <h1 id="successMessage" class="text-3xl font-bold text-gray-900 mb-3">Revisa tu correo electronico para establecer tu PIN</h1>
           <p class="text-gray-600 text-lg">
-          Tu cuenta esta <stronghcasi lista. Recibirás un correo electrónico de confirmación en breve.
+          Tu cuenta esta <strong>casi</strong> lista. Recibirás un correo electrónico de confirmación en breve.
           </p>
           <p class="text-gray-600 text-lg mt-4">
             Espero que disfrutes de la experiencia de pedidos con nosotros.