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