1 |
- import{d as l,g as s,m as n,o as u,c as e,P as m,q as a,L as c}from"./index.f2940478.js";import{R as d,C as i}from"./index.872d49e5.js";import{F as p}from"./index.9ee57e86.js";import{I as g}from"./index.a76f4d1e.js";const h="_imgCode_mq980_1",f="_codeTitle_mq980_4",r="_img_mq980_1",C="_imgChange_mq980_16",y="_field_mq980_23",I="_imgCodePopup_mq980_27";var o={imgCode:h,codeTitle:f,img:r,imgChange:C,field:y,imgCodePopup:I},F=l({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:s.platformApi,showStatus:!1,identifyingCode:null,code:null}},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 n.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 n.post(`${this.isSuffix}/open/sendSmsVerify`,{requestType:"form",hideLoading:!0,data:{mobile:this.phone,type:this.type,code:this.code,clientId:s.clientId[s.platformType]}}),setTimeout(()=>{u("\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001")},100),this.onClose(),this.onSendCode()}catch{this.updateIdentifyingCode()}}},render(){return e(m,{show:this.showStatus,class:o.imgCodePopup,closeOnClickOverlay:!1,onClose:()=>{this.onClose()},closeable:!0,closeIcon:"close"},{default:()=>[e("div",{class:o.imgCode},[e("p",{class:o.codeTitle},[a("\u8F93\u5165\u56FE\u5F62\u9A8C\u8BC1\u7801")]),e(d,null,{default:()=>[e(i,{span:"14"},{default:()=>[e(p,{placeholder:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",modelValue:this.code,"onUpdate:modelValue":t=>this.code=t,class:o.field,maxlength:4},null)]}),e(i,{span:"10",class:o.img},{default:()=>[e(g,{src:this.identifyingCode,onClick:()=>this.updateIdentifyingCode()},{loading:()=>e(c,{type:"spinner",size:"20"},null)})]})]}),e(d,{style:{display:"flex",justifyContent:"end"}},{default:()=>[e(i,{span:"10"},{default:()=>[e("span",{class:o.imgChange,onClick:()=>this.updateIdentifyingCode()},[a("\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u6362")])]})]})])]})}});export{F as I};
|