import{d as N,r as p,u as O,a as U,c as L,o as k,w as s,j as e,_ as I,k as V,N as D,l as i,P as M,i as _,bA as R,B as S,p as f,h as j,D as A,A as K,bB as E,L as h,m as F,n as G,t as T}from"./index-9PRMimni.js";const H={class:"flex w-full"},J={key:0},Q={class:"flex justify-between"},W={class:"flex-initial"},Z=N({__name:"RegisterForm",emits:["backLogin"],setup(X,{emit:x}){const g=p(),v=O(),b=p(!1),r=p("获取验证码"),c=p(!1),y=x,o=U({username:"",password:"",retPassword:"",mobile:"",code:"",agreement:!1}),C={username:{required:!0,message:"请输入用户名",trigger:"blur"},mobile:{required:!0,message:"请输入手机号码",trigger:"blur"},code:{required:!0,message:"请输入短信验证码",trigger:"blur"},password:{required:!0,message:"请输入密码",trigger:"blur"},retPassword:{required:!0,message:"请输入确认密码",trigger:"blur"},agreement:{required:!0,type:"boolean",trigger:"change",message:"请先勾选协议",validator:(n,a)=>a===!0}},w=n=>{n.preventDefault(),g.value.validate(async a=>{a?v.error("请填写完整信息"):(v.success("注册准备就绪"),b.value=!0)})},P=()=>{y("backLogin")};function z(){r.value=60,c.value=!0;let n=setInterval(()=>{r.value--,r.value<=0&&(clearInterval(n),r.value="获取验证码",c.value=!1)},1e3)}return(n,a)=>{const u=D,d=V,l=I,m=S,q=G,B=T;return k(),L(B,{ref_key:"formRef",ref:g,"show-label":!1,"show-require-mark":!1,size:"large",model:o,rules:C},{default:s(()=>[e(l,{path:"username"},{default:s(()=>[e(d,{value:o.username,"onUpdate:value":a[0]||(a[0]=t=>o.username=t),placeholder:"请输入用户名"},{prefix:s(()=>[e(u,{size:"18",color:"#808695"},{default:s(()=>[e(i(M))]),_:1})]),_:1},8,["value"])]),_:1}),e(l,{path:"mobile"},{default:s(()=>[_("div",H,[e(d,{class:"order-first",value:o.mobile,"onUpdate:value":a[1]||(a[1]=t=>o.mobile=t),placeholder:"请输入手机号码"},{prefix:s(()=>[e(u,{size:"18",color:"#808695"},{default:s(()=>[e(i(R))]),_:1})]),_:1},8,["value"]),e(m,{class:"order-last ml-3",disabled:c.value,onClick:z},{default:s(()=>[f(K(r.value),1),c.value?(k(),j("span",J,"s")):A("",!0)]),_:1},8,["disabled"])])]),_:1}),e(l,{path:"code"},{default:s(()=>[e(d,{value:o.code,"onUpdate:value":a[2]||(a[2]=t=>o.code=t),placeholder:"请输入验证码"},{prefix:s(()=>[e(u,{size:"18",color:"#808695"},{default:s(()=>[e(i(E))]),_:1})]),_:1},8,["value"])]),_:1}),e(l,{path:"password"},{default:s(()=>[e(d,{value:o.password,"onUpdate:value":a[3]||(a[3]=t=>o.password=t),type:"password",showPasswordOn:"click",placeholder:"请输入密码"},{prefix:s(()=>[e(u,{size:"18",color:"#808695"},{default:s(()=>[e(i(h))]),_:1})]),_:1},8,["value"])]),_:1}),e(l,{path:"retPassword"},{default:s(()=>[e(d,{value:o.retPassword,"onUpdate:value":a[4]||(a[4]=t=>o.retPassword=t),type:"password",showPasswordOn:"click",placeholder:"请再次输入密码",onKeyup:F(w,["enter"])},{prefix:s(()=>[e(u,{size:"18",color:"#808695"},{default:s(()=>[e(i(h))]),_:1})]),_:1},8,["value"])]),_:1}),e(l,{class:"default-color",path:"agreement"},{default:s(()=>[_("div",Q,[_("div",W,[e(q,{checked:o.agreement,"onUpdate:checked":a[5]||(a[5]=t=>o.agreement=t)},{default:s(()=>a[6]||(a[6]=[f("我同意隐私协议")])),_:1},8,["checked"])])])]),_:1}),e(l,{"show-label":!1},{default:s(()=>[e(m,{type:"primary",onClick:w,size:"large",loading:b.value,block:""},{default:s(()=>a[7]||(a[7]=[f(" 注册 ")])),_:1},8,["loading"])]),_:1}),e(l,{"show-label":!1},{default:s(()=>[e(m,{size:"large",block:"",onClick:P},{default:s(()=>a[8]||(a[8]=[f("返回")])),_:1})]),_:1})]),_:1},8,["model"])}}});export{Z as _};
