!function(){function e(e,t,n,o,i,d,s){try{var a=e[d](s),l=a.value}catch(r){return void n(r)}a.done?t(l):Promise.resolve(l).then(o,i)}function t(t){return function(){var n=this,o=arguments;return new Promise((function(i,d){var s=t.apply(n,o);function a(t){e(s,i,d,a,l,"next",t)}function l(t){e(s,i,d,a,l,"throw",t)}a(void 0)}))}}System.register(["./index-legacy-fdce4919.js","./index-legacy-a5d03881.js","./index-legacy-39907d87.js","./index-legacy-ff6f675b.js"],(function(e,n){"use strict";var o,i,d,s,a,l,r,c,m,u,p,f=document.createElement("style");return f.textContent="._imgCode_mq980_1{padding:.42667rem}._imgCode_mq980_1 ._codeTitle_mq980_4{text-align:center;font-size:.42667rem;color:#4f4f4f;margin:0;padding-bottom:.42667rem}._imgCode_mq980_1 ._img_mq980_1{display:flex;align-items:center;justify-content:center}._imgCode_mq980_1 ._imgChange_mq980_16{display:block;color:#aaa;font-size:.32rem;text-align:center;padding-top:.13333rem}._imgCode_mq980_1 ._field_mq980_23{background:#f4f4f4;padding:.26667rem .32rem!important}._imgCodePopup_mq980_27{width:90%;border-radius:.13333rem;overflow:initial}._imgCodePopup_mq980_27 .van-popup__close-icon{top:-.98667rem!important;right:0!important;font-size:.66667rem;color:#fff}\n",document.head.appendChild(f),{setters:[e=>{o=e.d,i=e.D,d=e.E,s=e.a,a=e.V,l=e.A,r=e.L},e=>{c=e.R,m=e.C},e=>{u=e.F},e=>{p=e.I}],execute:function(){const n="_imgCode_mq980_1",f="_codeTitle_mq980_4",g="_img_mq980_1",_="_imgChange_mq980_16",h="_field_mq980_23",y="_imgCodePopup_mq980_27";e("M",o({name:"o-img-code",props:{value:Boolean,phone:[String,Number],type:{type:String,default:"LOGIN"},clientId:{type:String,default:"cooleshow-student"}},emits:["close","sendCode"],data:()=>({isSuffix:"/edu-app",showStatus:!1,identifyingCode:null,code:""}),mounted(){this.showStatus=this.value,this.sendImgCode()},watch:{value(e){this.showStatus=e},code(e){e.length>=4&&this.checkVerifyLoginImage()}},methods:{sendImgCode(){var e=this;return t((function*(){const{data:t}=yield i.get(e.isSuffix+"/open/sendImgCode",{requestType:"form",hideLoading:!0,params:{phone:e.phone}});e.identifyingCode=t}))()},updateIdentifyingCode(){var e=this;return t((function*(){e.sendImgCode()}))()},checkVerifyLoginImage(){var e=this;return t((function*(){try{if(e.code.length<4)return;yield i.post("/edu-app/open/verifyImgCode",{requestType:"form",hideLoading:!0,data:{phone:e.phone,code:e.code}}),yield i.post("/edu-app/open/sendSms",{requestType:"form",hideLoading:!0,data:{clientId:e.clientId,type:"REGISTER",mobile:e.phone}}),setTimeout((()=>{d("验证码已发送")}),100),e.$emit("close"),e.$emit("sendCode")}catch(t){e.code="",setTimeout((()=>{e.updateIdentifyingCode()}),500)}}))()}},render(){return s(a,{show:this.showStatus,class:y,closeOnClickOverlay:!1,onClose:()=>{this.$emit("close")},closeable:!0,closeIcon:"close"},{default:()=>[s("div",{class:n},[s("p",{class:f},[l("输入图形验证码")]),s(c,null,{default:()=>[s(m,{span:"14"},{default:()=>[s(u,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":e=>this.code=e,class:h,autocomplete:"off"},null)]}),s(m,{span:"10",class:g},{default:()=>[s(p,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>s(r,{type:"spinner",size:"20"},null)})]})]}),s(c,{style:{display:"flex",justifyContent:"end"}},{default:()=>[s(m,{span:"10"},{default:()=>[s("span",{class:_,onClick:()=>this.updateIdentifyingCode()},[l("看不清？换一换")])]})]})])]})}}))}}}))}();
