1 |
- import{d as n,D as s,E as l,a as e,V as u,A as d,L as m}from"./index-91080ea3.js";import{R as a,C as i}from"./index-cb3df257.js";import{F as p}from"./index-81251e46.js";import{I as c}from"./index-b36ae7ae.js";const h="_imgCode_mq980_1",g="_codeTitle_mq980_4",r="_img_mq980_1",f="_imgChange_mq980_16",C="_field_mq980_23",y="_imgCodePopup_mq980_27",t={imgCode:h,codeTitle:g,img:r,imgChange:f,field:C,imgCodePopup:y},q=n({name:"o-img-code",props:{value:Boolean,phone:[String,Number],type:{type:String,default:"LOGIN"}},emits:["close","sendCode"],data(){return{isSuffix:"/edu-app",showStatus:!1,identifyingCode:null,code:""}},mounted(){this.showStatus=this.value,this.sendImgCode()},watch:{value(o){this.showStatus=o},code(o){o.length>=4&&this.checkVerifyLoginImage()}},methods:{async sendImgCode(){const{data:o}=await s.get(this.isSuffix+"/open/sendImgCode",{requestType:"form",hideLoading:!0,params:{phone:this.phone}});this.identifyingCode=o},async updateIdentifyingCode(){this.sendImgCode()},async checkVerifyLoginImage(){try{if(this.code.length<4)return;await s.post("/edu-app/open/verifyImgCode",{requestType:"form",hideLoading:!0,data:{phone:this.phone,code:this.code}}),await s.post("/edu-app/open/sendSms",{requestType:"form",hideLoading:!0,data:{clientId:"cooleshow-student",type:"REGISTER",mobile:this.phone}}),setTimeout(()=>{l("验证码已发送")},100),this.$emit("close"),this.$emit("sendCode")}catch(o){this.code="",this.updateIdentifyingCode()}}},render(){return e(u,{show:this.showStatus,class:t.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.$emit("close")},closeable:!0,closeIcon:"close"},{default:()=>[e("div",{class:t.imgCode},[e("p",{class:t.codeTitle},[d("输入图形验证码")]),e(a,null,{default:()=>[e(i,{span:"14"},{default:()=>[e(p,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":o=>this.code=o,class:t.field,autocomplete:"off"},null)]}),e(i,{span:"10",class:t.img},{default:()=>[e(c,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(m,{type:"spinner",size:"20"},null)})]})]}),e(a,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(i,{span:"10"},{default:()=>[e("span",{class:t.imgChange,onClick:()=>this.updateIdentifyingCode()},[d("看不清?换一换")])]})]})])]})}});export{q as M};
|