2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
import{p as m,r as d,d as r,e as t,l as x,w as p,v as f,m as v,t as g,h as w,x as h,y as b,$ as y,b as a,q as k}from"./index-BmU8V2V2.js";import{v as V}from"./create-actualizacion-datos-usuario.action-CxcN_O1G.js";import{S as T}from"./SecondaryButton-CAqGmnmb.js";const B={class:"mx-auto py-8 px-4 sm:px-6 lg:px-8 max-w-4xl"},M={key:0,class:"text-center"},O={class:"w-fit my-12 mx-auto"},P={href:"/"},S={class:"text-lg text-center mb-6"},N={__name:"VerificacionOtp",setup(_){const o=m();k();const l=y().params.movil,s=d(""),i=d(!1),u=()=>{if(s.value.length===6){const n={numero:l,codigo:s.value};V(n).then(e=>{e.error?o.error(e.message||"Hubo un problema al procesar la solicitud"):(i.value=!0,o.success(e.message||"Código OTP verificado correctamente"))}).catch(e=>{o.error("Error al enviar la solicitud"),console.error(e)})}else o.error("Por favor, ingrese un código OTP válido de 6 dígitos")};return(n,e)=>(a(),r("div",B,[i.value?(a(),r("div",M,[e[2]||(e[2]=t("div",{class:"text-green-500 my-4"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-14 mx-auto"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])],-1)),e[3]||(e[3]=t("p",{class:"text-2xl font-semibold text-green-500"},"¡Validado exitosamente!",-1)),t("div",O,[t("a",P,[x(T,null,{default:p(()=>e[1]||(e[1]=[t("span",{class:"flex space-x-2"},[t("p",{class:"px-1"}," Volver al inicio "),t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})])],-1)])),_:1})])])])):(a(),r("form",{key:1,onSubmit:f(u,["prevent"]),class:"bg-[#f6f6f6] rounded-xl shadow-lg px-8 py-6"},[e[5]||(e[5]=t("h1",{class:"text-3xl sm:text-4xl font-bold text-center mb-4"},"Verificación OTP",-1)),t("p",S,[e[4]||(e[4]=v(" Hemos enviado un código de verificación a ")),t("strong",null,g(w(l)),1)]),h(t("input",{"onUpdate:modelValue":e[0]||(e[0]=c=>s.value=c),type:"text",placeholder:"Ingrese el código OTP",class:"p-3 border rounded-lg shadow-md w-full text-center",maxlength:"6"},null,512),[[b,s.value]]),e[6]||(e[6]=t("div",{class:"mt-6 flex justify-center"},[t("button",{type:"submit",class:"px-6 py-3 w-full md:w-auto bg-[#284d92] text-white rounded-lg shadow-md"}," Verificar ")],-1))],32))]))}};export{N as default};
|