import{b as w,u as R,p as C,a3 as B,k as d,o as E,h as N,A as l,j as o,f as e,a as S,l as _,t as g,D as T,ba as U}from"./index.4d3e3847.js";import{M as f,u as z}from"./user.db558d4c.js";import{p as D}from"./rule.18072557.js";import{E as F}from"./index.0b460150.js";import{u as y}from"./verifyCode.64f29492.js";import{u as h}from"./hooks.428ba1c3.js";const I={class:"w-full flex justify-between"},P=w({__name:"phone",setup($){const{t:a}=R(),r=C(!1),t=B({phone:"",verifyCode:""}),p=C(),{isDisabled:V,text:v}=y(),b=async m=>{r.value=!0,m&&await m.validate((n,i)=>{if(n)setTimeout(()=>{F.success(T(U("login.loginSuccess"))),r.value=!1},2e3);else return r.value=!1,i})};function k(){y().end(),z().SET_CURRENTPAGE(0)}return(m,n)=>{const i=d("el-input"),u=d("el-form-item"),c=d("el-button"),x=d("el-form");return E(),N(x,{ref_key:"ruleFormRef",ref:p,model:t,rules:e(D),size:"large"},{default:l(()=>[o(e(f),null,{default:l(()=>[o(u,{prop:"phone"},{default:l(()=>[o(i,{clearable:"",modelValue:t.phone,"onUpdate:modelValue":n[0]||(n[0]=s=>t.phone=s),placeholder:e(a)("login.phone"),"prefix-icon":e(h)("iphone")},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),o(e(f),{delay:100},{default:l(()=>[o(u,{prop:"verifyCode"},{default:l(()=>[S("div",I,[o(i,{clearable:"",modelValue:t.verifyCode,"onUpdate:modelValue":n[1]||(n[1]=s=>t.verifyCode=s),placeholder:e(a)("login.smsVerifyCode"),"prefix-icon":e(h)("ri:shield-keyhole-line",{online:!0})},null,8,["modelValue","placeholder","prefix-icon"]),o(c,{disabled:e(V),class:"ml-2",onClick:n[2]||(n[2]=s=>e(y)().start(p.value,"phone"))},{default:l(()=>[_(g(e(v).length>0?e(v)+e(a)("login.info"):e(a)("login.getVerifyCode")),1)]),_:1},8,["disabled"])])]),_:1})]),_:1}),o(e(f),{delay:150},{default:l(()=>[o(u,null,{default:l(()=>[o(c,{class:"w-full",size:"default",type:"primary",loading:r.value,onClick:n[3]||(n[3]=s=>b(p.value))},{default:l(()=>[_(g(e(a)("login.login")),1)]),_:1},8,["loading"])]),_:1})]),_:1}),o(e(f),{delay:200},{default:l(()=>[o(u,null,{default:l(()=>[o(c,{class:"w-full",size:"default",onClick:k},{default:l(()=>[_(g(e(a)("login.back")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});export{P as default};
