import{M as d}from"./motion.7382b316.js";import{u as g}from"./rule.c23d3132.js";import{E as V}from"./index.c34edf15.js";import{u as B}from"./verifyCode.19ccf5eb.js";import{q as D,B as C,a4 as h,r as i,o as U,K as A,H as l,t as e,v as o,p as R,S as f,O as P,aD as N}from"./index.7a111e62.js";import{u as p}from"./hooks.f4063c52.js";const S={class:"w-full flex justify-between"},T=f(" \u6211\u5DF2\u4ED4\u7EC6\u9605\u8BFB\u5E76\u63A5\u53D7 "),z=f(" \u300A\u9690\u79C1\u653F\u7B56\u300B "),q=f(" \u786E\u5B9A "),H=f(" \u8FD4\u56DE "),J=D({__name:"regist",setup(M){const c=C(!1),n=C(!1),r=h({username:"",phone:"",verifyCode:"",password:"",repeatPassword:""}),w=C(),{isDisabled:v,text:y}=B(),E=[{validator:(m,u,t)=>{u===""?t(new Error("\u8BF7\u8F93\u5165\u786E\u8BA4\u5BC6\u7801")):r.password!==u?t(new Error("\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4!")):t()},trigger:"blur"}],F=async m=>{n.value=!0,m&&await m.validate((u,t)=>{if(u)c.value?setTimeout(()=>{V.success("\u6CE8\u518C\u6210\u529F"),n.value=!1},2e3):(n.value=!1,V.warning("\u8BF7\u52FE\u9009\u9690\u79C1\u653F\u7B56"));else return n.value=!1,t})};function x(){B().end(),N().SET_CURRENTPAGE(0)}return(m,u)=>{const t=i("el-input"),s=i("el-form-item"),_=i("el-button"),b=i("el-checkbox"),k=i("el-form");return U(),A(k,{ref_key:"ruleFormRef",ref:w,model:r,rules:o(g),size:"large"},{default:l(()=>[e(o(d),null,{default:l(()=>[e(s,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u53F7",trigger:"blur"}],prop:"username"},{default:l(()=>[e(t,{clearable:"",modelValue:r.username,"onUpdate:modelValue":u[0]||(u[0]=a=>r.username=a),placeholder:"\u8D26\u53F7","prefix-icon":o(p)("user")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(o(d),{delay:100},{default:l(()=>[e(s,{prop:"phone"},{default:l(()=>[e(t,{clearable:"",modelValue:r.phone,"onUpdate:modelValue":u[1]||(u[1]=a=>r.phone=a),placeholder:"\u624B\u673A\u53F7\u7801","prefix-icon":o(p)("iphone")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(o(d),{delay:150},{default:l(()=>[e(s,{prop:"verifyCode"},{default:l(()=>[R("div",S,[e(t,{clearable:"",modelValue:r.verifyCode,"onUpdate:modelValue":u[2]||(u[2]=a=>r.verifyCode=a),placeholder:"\u77ED\u4FE1\u9A8C\u8BC1\u7801","prefix-icon":o(p)("ri:shield-keyhole-line",{online:!0})},null,8,["modelValue","prefix-icon"]),e(_,{disabled:o(v),class:"ml-2",onClick:u[3]||(u[3]=a=>o(B)().start(w.value,"phone"))},{default:l(()=>[f(P(o(y)),1)]),_:1},8,["disabled"])])]),_:1})]),_:1}),e(o(d),{delay:200},{default:l(()=>[e(s,{prop:"password"},{default:l(()=>[e(t,{clearable:"","show-password":"",modelValue:r.password,"onUpdate:modelValue":u[4]||(u[4]=a=>r.password=a),placeholder:"\u5BC6\u7801","prefix-icon":o(p)("lock")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(o(d),{delay:250},{default:l(()=>[e(s,{rules:E,prop:"repeatPassword"},{default:l(()=>[e(t,{clearable:"","show-password":"",modelValue:r.repeatPassword,"onUpdate:modelValue":u[5]||(u[5]=a=>r.repeatPassword=a),placeholder:"\u786E\u8BA4\u5BC6\u7801","prefix-icon":o(p)("lock")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(o(d),{delay:300},{default:l(()=>[e(s,null,{default:l(()=>[e(b,{modelValue:c.value,"onUpdate:modelValue":u[6]||(u[6]=a=>c.value=a)},{default:l(()=>[T]),_:1},8,["modelValue"]),e(_,{link:"",type:"primary"},{default:l(()=>[z]),_:1})]),_:1})]),_:1}),e(o(d),{delay:350},{default:l(()=>[e(s,null,{default:l(()=>[e(_,{class:"w-full",size:"default",type:"primary",loading:n.value,onClick:u[7]||(u[7]=a=>F(w.value))},{default:l(()=>[q]),_:1},8,["loading"])]),_:1})]),_:1}),e(o(d),{delay:400},{default:l(()=>[e(s,null,{default:l(()=>[e(_,{class:"w-full",size:"default",onClick:x},{default:l(()=>[H]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});export{J as default};
