import{m as I,n as w,t as k,q as S,d as C,u as F,v as m,k as o,w as b,x as E,y as P,s as d,g as h,j as N,P as L,l as v,L as R}from"./index.879f7421.js";import{F as V}from"./index.00975bf6.js";import{I as j}from"./index.c463dbd0.js";const[x,O]=I("row"),T=Symbol(x),B={tag:w("div"),wrap:k,align:String,gutter:S(0),justify:String};var A=C({name:x,props:B,setup(s,{slots:l}){const{children:r,linkChildren:c}=F(T),f=m(()=>{const t=[[]];let e=0;return r.forEach((n,i)=>{e+=Number(n.span),e>24?(t.push([i]),e-=24):t[t.length-1].push(i)}),t}),a=m(()=>{const t=Number(s.gutter),e=[];return t&&f.value.forEach(n=>{const i=t*(n.length-1)/n.length;n.forEach((p,q)=>{if(q===0)e.push({right:i});else{const y=t-e[p-1].right,$=i-y;e.push({left:y,right:$})}})}),e});return c({spaces:a}),()=>{const{tag:t,wrap:e,align:n,justify:i}=s;return o(t,{class:O({[`align-${n}`]:n,[`justify-${i}`]:i,nowrap:!e})},{default:()=>{var p;return[(p=l.default)==null?void 0:p.call(l)]}})}}});const[z,D]=I("col"),G={tag:w("div"),span:S(0),offset:b};var K=C({name:z,props:G,setup(s,{slots:l}){const{parent:r,index:c}=E(T),f=m(()=>{if(!r)return;const{spaces:a}=r;if(a&&a.value&&a.value[c.value]){const{left:t,right:e}=a.value[c.value];return{paddingLeft:t?`${t}px`:null,paddingRight:e?`${e}px`:null}}});return()=>{const{tag:a,span:t,offset:e}=s;return o(a,{style:f.value,class:D({[t]:t,[`offset-${e}`]:e})},{default:()=>{var n;return[(n=l.default)==null?void 0:n.call(l)]}})}}});const g=P(K),_=P(A),U="_imgCode_mq980_1",W="_codeTitle_mq980_4",Y="_img_mq980_1",H="_imgChange_mq980_16",J="_field_mq980_23",M="_imgCodePopup_mq980_27";var u={imgCode:U,codeTitle:W,img:Y,imgChange:H,field:J,imgCodePopup:M},ee=C({name:"o-img-code",props:{value:Boolean,phone:[String,Number],onClose:{type:Function,default:()=>{}},onSendCode:{type:Function,default:()=>{}}},data(){return{isSuffix:d.platformApi,showStatus:!1,identifyingCode:null,code:null}},mounted(){this.showStatus=this.value,this.sendImgCode()},watch:{value(s){this.showStatus=s},code(s){s.length>=4&&this.checkVerifyLoginImage()}},methods:{async sendImgCode(){const{data:s}=await h.get(this.isSuffix+"/open/sendImgCode",{requestType:"form",hideLoading:!0,params:{phone:this.phone}});this.identifyingCode=s},async updateIdentifyingCode(){this.sendImgCode()},async checkVerifyLoginImage(){try{if(this.code.length<4)return;await h.post(`${this.isSuffix}/open/verifyImgCode`,{requestType:"form",data:{phone:this.phone,code:this.code}}),console.log(d.clientId,d.platformType),await h.post(`${this.isSuffix}/open/sendSms`,{requestType:"form",data:{mobile:this.phone,type:"LOGIN",clientId:d.clientId[d.platformType]}}),setTimeout(()=>{N("\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001")},100),this.onClose(),this.onSendCode()}catch{this.updateIdentifyingCode()}}},render(){return o(L,{show:this.showStatus,class:u.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.onClose()},closeable:!0,closeIcon:"close"},{default:()=>[o("div",{class:u.imgCode},[o("p",{class:u.codeTitle},[v("\u8F93\u5165\u56FE\u5F62\u9A8C\u8BC1\u7801")]),o(_,null,{default:()=>[o(g,{span:"14"},{default:()=>[o(V,{placeholder:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",modelValue:this.code,"onUpdate:modelValue":s=>this.code=s,class:u.field},null)]}),o(g,{span:"10",class:u.img},{default:()=>[o(j,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>o(R,{type:"spinner",size:"20"},null)})]})]}),o(_,{style:{display:"flex",justifyContent:"end"}},{default:()=>[o(g,{span:"10"},{default:()=>[o("span",{class:u.imgChange,onClick:()=>this.updateIdentifyingCode()},[v("\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u6362")])]})]})])]})}});function te(s){return/^1[3456789]\d{9}$/.test(s)}export{g as C,ee as I,_ as R,te as c};
