import{t as I,u as w,v as $,w as S,d as C,x as k,y as m,c as o,z as L,C as b,D as P,g as d,m as h,o as E,P as N,q as v,L as R}from"./index.5f7ffb46.js";import{F as V}from"./index.6438a25f.js";import{I as B}from"./index.276a5d68.js";const[x,j]=I("row"),F=Symbol(x),O={tag:w("div"),wrap:$,align:String,gutter:S(0),justify:String};var A=C({name:x,props:O,setup(s,{slots:u}){const{children:r,linkChildren:c}=k(F),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,T)=>{if(T===0)e.push({right:i});else{const y=t-e[p-1].right,q=i-y;e.push({left:y,right:q})}})}),e});return c({spaces:a}),()=>{const{tag:t,wrap:e,align:n,justify:i}=s;return o(t,{class:j({[`align-${n}`]:n,[`justify-${i}`]:i,nowrap:!e})},{default:()=>{var p;return[(p=u.default)==null?void 0:p.call(u)]}})}}});const[z,D]=I("col"),G={tag:w("div"),span:S(0),offset:L};var K=C({name:z,props:G,setup(s,{slots:u}){const{parent:r,index:c}=b(F),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=u.default)==null?void 0:n.call(u)]}})}}});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 l={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:()=>{}},type:{type:String,default:"LOGIN"}},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",hideLoading:!0,data:{phone:this.phone,code:this.code}}),console.log(d.clientId,d.platformType),await h.post(`${this.isSuffix}/open/sendSms`,{requestType:"form",hideLoading:!0,data:{mobile:this.phone,type:this.type,clientId:d.clientId[d.platformType]}}),setTimeout(()=>{E("\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001")},100),this.onClose(),this.onSendCode()}catch{this.updateIdentifyingCode()}}},render(){return o(N,{show:this.showStatus,class:l.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.onClose()},closeable:!0,closeIcon:"close"},{default:()=>[o("div",{class:l.imgCode},[o("p",{class:l.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:l.field},null)]}),o(g,{span:"10",class:l.img},{default:()=>[o(B,{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:l.imgChange,onClick:()=>this.updateIdentifyingCode()},[v("\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u6362")])]})]})])]})}});function te(s){return/^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\d{8}$/.test(s)}export{g as C,ee as I,_ as R,te as c};