import{d as F,Y as v,B as I,u as $,h as y,r as u,o as d,f as p,w as l,a as D,t as c,b as s,k as h,$ as q,a1 as A,l as m,a2 as E,E as R,a3 as w,s as K,_ as M}from"./index.e3896b23.js";import{v as N}from"./validate.14f7b19b.js";const S={class:"login-title"},L=m("\u53D1\u9001\u9A8C\u8BC1\u7801"),U=F({__name:"mobile",setup(H){const C=()=>{if(!N(o.mobile)){R.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7");return}w(o.mobile).then(()=>{k()})},e=v({disabled:!1,total:60,count:0}),k=()=>{e.count=e.total,e.disabled=!0;let t=setInterval(()=>{e.count>1&&e.count<=e.total?e.count--:(e.disabled=!1,clearInterval(t))},1e3)},B=I(),{t:_}=$(),f=y(),o=v({mobile:"",code:""}),V=y({mobile:[{required:!0,message:_("required"),trigger:"blur"}],code:[{required:!0,message:_("required"),trigger:"blur"}]}),b=()=>{f.value.validate(t=>{if(!t)return!1;K.userStore.mobileLoginAction(o).then(()=>{B.push({path:"/home"})})})};return(t,a)=>{const g=u("el-input"),r=u("el-form-item"),i=u("el-button"),x=u("el-form");return d(),p(x,{ref_key:"loginFormRef",ref:f,model:o,rules:V.value,onKeyup:E(b,["enter"])},{default:l(()=>[D("div",S,c(t.$t("app.signIn")),1),s(r,{prop:"mobile"},{default:l(()=>[s(g,{modelValue:o.mobile,"onUpdate:modelValue":a[0]||(a[0]=n=>o.mobile=n),"prefix-icon":h(q),placeholder:t.$t("app.mobile")},null,8,["modelValue","prefix-icon","placeholder"])]),_:1}),s(r,{prop:"code",class:"login-code"},{default:l(()=>[s(g,{modelValue:o.code,"onUpdate:modelValue":a[1]||(a[1]=n=>o.code=n),placeholder:t.$t("app.captcha"),"prefix-icon":h(A)},null,8,["modelValue","placeholder","prefix-icon"]),e.disabled?(d(),p(i,{key:1,type:"default",disabled:""},{default:l(()=>[m(c(e.count)+" \u79D2\u540E\u91CD\u65B0\u53D1\u9001",1)]),_:1})):(d(),p(i,{key:0,type:"default",onClick:C},{default:l(()=>[L]),_:1}))]),_:1}),s(r,{class:"login-button"},{default:l(()=>[s(i,{type:"primary",onClick:a[2]||(a[2]=n=>b())},{default:l(()=>[m(c(t.$t("app.signIn")),1)]),_:1})]),_:1})]),_:1},8,["model","rules","onKeyup"])}}});const j=M(U,[["__scopeId","data-v-0620a37a"]]);export{j as default};
