import{d as P,r as p,u as q,a as z,c as B,o as b,w as s,j as e,_ as N,k as O,N as I,l as c,bA as U,m as w,B as D,p as y,h as K,D as M,A as R,bB as S,L as k,t as V}from"./index-9PRMimni.js";const A={key:0},E=P({__name:"PlusRegisterForm",setup(L){const m=p(),_=q(),g=p(!1),t=p("获取验证码"),u=p(!1),o=z({username:"",password:"",retPassword:"",mobile:"",code:"",agreement:!1}),h={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:(l,a)=>a===!0}},f=l=>{l.preventDefault(),m.value.validate(async a=>{a?_.error("请填写完整信息"):(_.success("注册准备就绪"),g.value=!0)})};function x(){if(!o.mobile)return _.error("手机号码不能为空");t.value=60,u.value=!0;let l=setInterval(()=>{t.value--,t.value<=0&&(clearInterval(l),t.value="获取验证码",u.value=!1)},1e3)}return(l,a)=>{const d=I,i=O,n=N,v=D,C=V;return b(),B(C,{ref_key:"formRef",ref:m,"show-label":!1,"show-require-mark":!1,size:"large",model:o,rules:h},{default:s(()=>[e(n,{path:"mobile"},{default:s(()=>[e(i,{class:"order-first rounded-lg",value:o.mobile,"onUpdate:value":a[0]||(a[0]=r=>o.mobile=r),placeholder:"请输入手机号码"},{prefix:s(()=>[e(d,{size:"18",color:"#808695"},{default:s(()=>[e(c(U))]),_:1})]),_:1},8,["value"])]),_:1}),e(n,{path:"code"},{default:s(()=>[e(i,{value:o.code,"onUpdate:value":a[1]||(a[1]=r=>o.code=r),placeholder:"请输入验证码",onKeyup:w(f,["enter"]),class:"rounded-lg"},{prefix:s(()=>[e(d,{size:"18",color:"#808695"},{default:s(()=>[e(c(S))]),_:1})]),suffix:s(()=>[e(v,{text:"",type:"info",disabled:u.value,onClick:x},{default:s(()=>[y(R(t.value),1),u.value?(b(),K("span",A,"s")):M("",!0)]),_:1},8,["disabled"])]),_:1},8,["value"])]),_:1}),e(n,{path:"password"},{default:s(()=>[e(i,{value:o.password,"onUpdate:value":a[2]||(a[2]=r=>o.password=r),type:"password",showPasswordOn:"click",placeholder:"请输入密码",class:"rounded-lg"},{prefix:s(()=>[e(d,{size:"18",color:"#808695"},{default:s(()=>[e(c(k))]),_:1})]),_:1},8,["value"])]),_:1}),e(n,{path:"retPassword"},{default:s(()=>[e(i,{value:o.retPassword,"onUpdate:value":a[3]||(a[3]=r=>o.retPassword=r),type:"password",showPasswordOn:"click",placeholder:"请再次输入密码",onKeyup:w(f,["enter"]),class:"rounded-lg"},{prefix:s(()=>[e(d,{size:"18",color:"#808695"},{default:s(()=>[e(c(k))]),_:1})]),_:1},8,["value"])]),_:1}),e(n,{"show-label":!1},{default:s(()=>[e(v,{type:"primary",onClick:f,size:"large",loading:g.value,block:"",class:"rounded-lg"},{default:s(()=>a[4]||(a[4]=[y(" 注册 ")])),_:1},8,["loading"])]),_:1})]),_:1},8,["model"])}}});export{E as _};
