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