import{M as i}from"./motion.2692261e.js";import{p as B}from"./rule.030cd267.js";import{E as F}from"./index.31b68cbb.js";import{u as c}from"./verifyCode.99fe3de7.js";import{q as b,B as v,a4 as E,r as d,o as g,K as w,H as o,t as e,v as t,p as R,S as _,O as D,aQ as N}from"./index.d8ce26ef.js";import{u as y}from"./hooks.3def80f5.js";const S={class:"w-full flex justify-between"},T=_(" \u767B\u5F55 "),U=_(" \u8FD4\u56DE "),G=b({__name:"phone",setup(z){const u=v(!1),a=E({phone:"",verifyCode:""}),f=v(),{isDisabled:C,text:x}=c(),V=async p=>{u.value=!0,p&&await p.validate((l,s)=>{if(l)setTimeout(()=>{F.success("\u767B\u5F55\u6210\u529F"),u.value=!1},2e3);else return u.value=!1,s})};function h(){c().end(),N().SET_CURRENTPAGE(0)}return(p,l)=>{const s=d("el-input"),r=d("el-form-item"),m=d("el-button"),k=d("el-form");return g(),w(k,{ref_key:"ruleFormRef",ref:f,model:a,rules:t(B),size:"large"},{default:o(()=>[e(t(i),null,{default:o(()=>[e(r,{prop:"phone"},{default:o(()=>[e(s,{clearable:"",modelValue:a.phone,"onUpdate:modelValue":l[0]||(l[0]=n=>a.phone=n),placeholder:"\u624B\u673A\u53F7\u7801","prefix-icon":t(y)("iphone")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(t(i),{delay:100},{default:o(()=>[e(r,{prop:"verifyCode"},{default:o(()=>[R("div",S,[e(s,{clearable:"",modelValue:a.verifyCode,"onUpdate:modelValue":l[1]||(l[1]=n=>a.verifyCode=n),placeholder:"\u77ED\u4FE1\u9A8C\u8BC1\u7801","prefix-icon":t(y)("ri:shield-keyhole-line",{online:!0})},null,8,["modelValue","prefix-icon"]),e(m,{disabled:t(C),class:"ml-2",onClick:l[2]||(l[2]=n=>t(c)().start(f.value,"phone"))},{default:o(()=>[_(D(t(x)),1)]),_:1},8,["disabled"])])]),_:1})]),_:1}),e(t(i),{delay:150},{default:o(()=>[e(r,null,{default:o(()=>[e(m,{class:"w-full",size:"default",type:"primary",loading:u.value,onClick:l[3]||(l[3]=n=>V(f.value))},{default:o(()=>[T]),_:1},8,["loading"])]),_:1})]),_:1}),e(t(i),{delay:200},{default:o(()=>[e(r,null,{default:o(()=>[e(m,{class:"w-full",size:"default",onClick:h},{default:o(()=>[U]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});export{G as default};
