import{U as e,aI as a,p as s,o,b as t,h as l,q as n,n as r,u as d,t as i,f as u,I as c,x as m,s as p,av as h,b0 as v,A as f,C as b,a as x,G as _,aK as C,w as y,aE as V,aT as g,bo as w}from"./vendor-jA_NIjzi.js";import"./vendor-html2canvas-6F43d9AR.js";import{u as j}from"./useCount-2hEguuHI.js";import"./common-utils-8H8K2JPG.js";import{_ as E,u as S,a9 as I,a8 as A}from"./common-store-e_1WBubm.js";const P={class:"VerifyPhone"},U={class:"form-item"},k={key:0,class:"error-bar"},z={class:"form-item"},M={key:0,class:"error-bar"},O=E({__name:"VerifyPhone",props:{errorStatus:{type:Object,default:()=>({text:"",show:!1})},errorStatusForPhone:{type:Object,default:()=>({text:"",show:!1})}},emits:["update:phone","update:phoneCode"],setup(f,{emit:b}){const{t:x}=e(),_=S(),{countdown:C,startCountdown:y}=j(),V=f,{errorStatus:g,errorStatusForPhone:w}=a(V),E=s({phone:"",phoneCode:""}),A=b,O=async()=>{const e=await I({ip:_.userinfo.ip,loginMobile:E.phone,mobileAreaCode:86});if(1!==e.code)return e.message&&p(e.message);p("发送成功"),y()},Z=()=>{A("sendValues",{phone:E.phone,phoneCode:E.phoneCode})},q=()=>{A("sendValues",{phone:E.phone,phoneCode:E.phoneCode})};return(e,a)=>{const s=h,p=v;return o(),t("div",P,[l("div",U,[a[2]||(a[2]=l("div",{class:"label"},"手机号码",-1)),n(s,{class:r({red:d(w).show}),modelValue:E.phone,"onUpdate:modelValue":a[0]||(a[0]=e=>E.phone=e),placeholder:"请输入手机号码",maxlength:"11",onInput:Z},null,8,["class","modelValue"]),d(w).show?(o(),t("p",k,i(d(w).text),1)):u("",!0)]),l("div",z,[n(s,{class:r({red:d(g).show}),modelValue:E.phoneCode,"onUpdate:modelValue":a[1]||(a[1]=e=>E.phoneCode=e),placeholder:d(x)("请输入验证码"),onInput:q,maxlength:"6"},{button:c((()=>[n(p,{size:"small",class:"sendCode",onClick:O,disabled:+d(C)<60||!E.phone||!/^1[3-9]\d{9}$/.test(E.phone)},{default:c((()=>[m(i(60==+d(C)?d(x)("获取验证码"):d(x)("n秒发送",{n:d(C)})),1)])),_:1},8,["disabled"])])),_:1},8,["class","modelValue","placeholder"]),d(g).show?(o(),t("p",M,i(d(g).text),1)):u("",!0)])])}}},[["__scopeId","data-v-2e32fb76"],["__file","VerifyPhone.vue"]]),Z={class:"email"},q={class:"text-sm text-[var(--add-digital-currency-text2)] font-semibold mb-2"},F={class:"form-item"},$=["placeholder","disabled"],B={class:"form-item"},G=["placeholder"],K=E(Object.assign({name:"Email"},{__name:"index",props:f({customEmail:Boolean},{email:{type:String},emailModifiers:{},captcha:{type:String,required:!0},captchaModifiers:{}}),emits:["update:email","update:captcha"],setup(a){const{t:s}=e(),n=b(a,"email"),u=b(a,"captcha"),{userinfo:c}=x(S());a.customEmail||(n.value=c.value.email);const m=_((()=>!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(a.customEmail?n.value:c.value.email)));let p=C({time:6e4}),h=_((()=>p.current.value.seconds));return(e,v)=>(o(),t("div",Z,[l("div",q,i(d(s)("邮箱地址")),1),l("div",F,[y(l("input",{class:"",placeholder:d(s)("请输入邮箱地址"),"onUpdate:modelValue":v[0]||(v[0]=e=>n.value=e),disabled:!a.customEmail},null,8,$),[[V,n.value]])]),l("div",B,[y(l("input",{class:"",placeholder:d(s)("请输入验证码"),maxlength:"6","onUpdate:modelValue":v[1]||(v[1]=e=>u.value=e)},null,8,G),[[V,u.value]]),l("div",{class:r(["mr-2 rounded w-max px-1.5 leading-[30px] text-xs text-[var(--button-text-color)] bg-[var(--main-text-color-1)]",{"van-button--disabled":m.value||d(h)}]),onClick:v[2]||(v[2]=e=>(async()=>{if(m.value||h.value)return;const e=g({duration:0,message:"".concat(s("验证码发送中"),"...")});try{await A({ip:c.value.ip,email:a.customEmail?n.value:c.value.email}),p.reset(),w(s("验证码发送成功")),p.start()}finally{e.close()}})())},i(d(h)?"".concat(d(h),"s"):d(s)("发送验证码")),3)])]))}}),[["__scopeId","data-v-85fa3813"],["__file","index.vue"]]);export{K as E,O as V};
