MobileForm-035fec20.js 4.9 KB

1
  1. import{d as $,X as A,u as G,r as g,Y as J,a as e,e as k,aM as K,z as Q,$ as W,o as _,x as C,w as l,f as a,a0 as h,c as S,t as V,h as Z,dt as ee,aa as ae,ab as le,a6 as M,du as te,a3 as oe,C as ne,E as ie,R as re,i as se,H as de,_ as me,__tla as ce}from"./index-327f993b.js";import{_ as pe,__tla as ue}from"./XButton-abaf5fb8.js";import{u as b,__tla as ge}from"./useIcon-2bdb37aa.js";import _e,{__tla as fe}from"./LoginFormTitle-f5fa9965.js";import{u as he,L as be,a as ye,__tla as xe}from"./useLogin-4a51fedf.js";import{u as ve,__tla as Fe}from"./useMessage-b42f14d5.js";import{r as y,__tla as we}from"./formRules-23030ee1.js";let L,Ne=Promise.all([(()=>{try{return ce}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return ge}catch{}})(),(()=>{try{return fe}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return we}catch{}})()]).then(async()=>{let x;x={key:1,class:"getMobileCode",style:{cursor:"pointer"}},L=me($({name:"MobileForm",__name:"MobileForm",setup(ke){const{t:i}=Z(),I=ve(),E=A(),{currentRoute:z,push:P}=G(),v=g(),p=g(!1),R=b({icon:"ep:house"}),U=b({icon:"ep:cellphone"}),B=b({icon:"ep:circle-check"}),{validForm:T}=ye(v),{handleBackLogin:j,getLoginState:q}=he(),D=J(()=>e(q)===be.MOBILE),H={tenantName:[y],mobileNumber:[y],code:[y]},t=k({codeImg:"",tenantEnable:"false",token:"",loading:{signIn:!1},loginForm:{uuid:"",tenantName:"\u975E\u7E41\u6E90\u7801",mobileNumber:"",code:""}}),c=k({smsCode:{mobile:"",scene:21},loginSms:{mobile:"",code:""}}),r=g(0),u=g(""),O=async()=>{await F(),c.smsCode.mobile=t.loginForm.mobileNumber,await ee(c.smsCode).then(async()=>{I.success(i("login.SmsSendMsg")),r.value=60;let n=setInterval(()=>{r.value=r.value-1,r.value<=0&&clearInterval(n)},1e3)})};K(()=>z.value,n=>{var o;u.value=(o=n==null?void 0:n.query)==null?void 0:o.redirect},{immediate:!0});const F=async()=>{if(t.tenantEnable==="true"){const n=await ae(t.loginForm.tenantName);le(n)}};return(n,o)=>{const m=ne,s=ie,f=re,w=se,N=pe,X=de;return Q((_(),C(X,{ref_key:"formSmsLogin",ref:v,model:e(t).loginForm,rules:H,class:"login-form","label-position":"top","label-width":"120px",size:"large"},{default:l(()=>[a(w,{style:{"margin-right":"-10px","margin-left":"-10px"}},{default:l(()=>[a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(_e,{style:{width:"100%"}})]),_:1})]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[e(t).tenantEnable==="true"?(_(),C(m,{key:0,prop:"tenantName"},{default:l(()=>[a(f,{modelValue:e(t).loginForm.tenantName,"onUpdate:modelValue":o[0]||(o[0]=d=>e(t).loginForm.tenantName=d),placeholder:e(i)("login.tenantNamePlaceholder"),"prefix-icon":e(R),type:"primary",link:""},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})):h("",!0)]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,{prop:"mobileNumber"},{default:l(()=>[a(f,{modelValue:e(t).loginForm.mobileNumber,"onUpdate:modelValue":o[1]||(o[1]=d=>e(t).loginForm.mobileNumber=d),placeholder:e(i)("login.mobileNumberPlaceholder"),"prefix-icon":e(U)},null,8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,{prop:"code"},{default:l(()=>[a(w,{gutter:5,justify:"space-between",style:{width:"100%"}},{default:l(()=>[a(s,{span:24},{default:l(()=>[a(f,{modelValue:e(t).loginForm.code,"onUpdate:modelValue":o[2]||(o[2]=d=>e(t).loginForm.code=d),placeholder:e(i)("login.codePlaceholder"),"prefix-icon":e(B)},{append:l(()=>[e(r)<=0?(_(),S("span",{key:0,class:"getMobileCode",style:{cursor:"pointer"},onClick:O},V(e(i)("login.getSmsCode")),1)):h("",!0),e(r)>0?(_(),S("span",x,V(e(r))+"\u79D2\u540E\u53EF\u91CD\u65B0\u83B7\u53D6 ",1)):h("",!0)]),_:1},8,["modelValue","placeholder","prefix-icon"])]),_:1})]),_:1})]),_:1})]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(N,{loading:e(p),title:e(i)("login.login"),class:"w-[100%]",type:"primary",onClick:o[3]||(o[3]=d=>(async()=>{await F(),await T()&&(M.service({lock:!0,text:"\u6B63\u5728\u52A0\u8F7D\u7CFB\u7EDF\u4E2D...",background:"rgba(0, 0, 0, 0.7)"}),p.value=!0,c.loginSms.mobile=t.loginForm.mobileNumber,c.loginSms.code=t.loginForm.code,await te(c.loginSms).then(async Y=>{oe(Y),u.value||(u.value="/"),P({path:u.value||E.addRouters[0].path})}).catch(()=>{}).finally(()=>{p.value=!1,setTimeout(()=>{M.service().close()},400)}))})())},null,8,["loading","title"])]),_:1})]),_:1}),a(s,{span:24,style:{"padding-right":"10px","padding-left":"10px"}},{default:l(()=>[a(m,null,{default:l(()=>[a(N,{loading:e(p),title:e(i)("login.backLogin"),class:"w-[100%]",onClick:o[4]||(o[4]=d=>e(j)())},null,8,["loading","title"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])),[[W,e(D)]])}}}),[["__scopeId","data-v-badf870a"],["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/views/Login/components/MobileForm.vue"]])});export{Ne as __tla,L as default};