Просмотр исходного кода

Add age confirmation checkbox to registration form and improve cart comment handling

Erwin Jacimino 6 месяцев назад
Родитель
Сommit
f7e2ac60cd
3 измененных файлов с 12 добавлено и 11 удалено
  1. 1 1
      public/main/js/app.js
  2. 1 10
      public/pin_forgot.html
  3. 10 0
      public/register/index.html

+ 1 - 1
public/main/js/app.js

@@ -891,7 +891,7 @@ window.addToCart = async function(productId, buttonElement = null) {
     const cartItem = cart.find(item => item.id === productId);
     const cartItem = cart.find(item => item.id === productId);
     if (cartItem) {
     if (cartItem) {
         cartItem.quantity++;
         cartItem.quantity++;
-        cartItem.comment += `, ${comment}`;
+        if (comment ) cartItem.comment += `, ${comment}`;
 
 
     } else {
     } else {
         cart.push({ ...product, quantity: 1, comment });
         cart.push({ ...product, quantity: 1, comment });

+ 1 - 10
public/pin_forgot.html

@@ -404,7 +404,7 @@
           case 200:
           case 200:
             showSuccess('Código verificado correctamente');
             showSuccess('Código verificado correctamente');
             setTimeout(async () => {
             setTimeout(async () => {
-              responseJSON = await codeVerify.json();
+              const responseJSON = await codeVerify.json();
               changeToken = responseJSON.data.token;
               changeToken = responseJSON.data.token;
               showStep(3);
               showStep(3);
             }, 1000);
             }, 1000);
@@ -579,15 +579,6 @@
         return;
         return;
       }
       }
       
       
-      // Validar que no sea un PIN muy obvio
-      if (newPin === '1234' || newPin === '0000' || newPin === '1111' || newPin === '2222' || 
-          newPin === '3333' || newPin === '4444' || newPin === '5555' || newPin === '6666' || 
-          newPin === '7777' || newPin === '8888' || newPin === '9999') {
-        showError('Por favor elige un PIN más seguro. Evita secuencias obvias.');
-        newPinInput.focus();
-        newPinInput.select();
-        return;
-      }
       
       
       pinSubmitBtn.disabled = true;
       pinSubmitBtn.disabled = true;
       pinSubmitBtn.textContent = 'Estableciendo PIN...';
       pinSubmitBtn.textContent = 'Estableciendo PIN...';

+ 10 - 0
public/register/index.html

@@ -65,6 +65,16 @@
                    placeholder="12345678-9" 
                    placeholder="12345678-9" 
                    required />
                    required />
           </div>
           </div>
+
+          <div class="flex items-center gap-2">
+            <input id="18olderInput"
+                   type="checkbox"
+                   class="w-4 h-4 text-[#101419] border-gray-300 rounded focus:ring-[#101419] focus:ring-2 transition-all cursor-pointer"
+                   required />
+            <label for="18olderInput" class="text-sm font-medium text-gray-700 cursor-pointer select-none">
+              Declaro que poseo una edad mayor de 18 años
+            </label>
+          </div>
         </div>
         </div>
 
 
         <span id="registerErrorMessage" class="text-red-500 text-sm hidden"></span>
         <span id="registerErrorMessage" class="text-red-500 text-sm hidden"></span>