1 |
- !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-e1ea41b7.js","./index-legacy-c42bec0c.js","./index-legacy-f104347d.js","./index-legacy-01b7024c.js"],(function(e,n){"use strict";var o,i,d,s,a,l,r,c,m,u,p;return{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(){var n=document.createElement("style");n.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(n);const f="_imgCode_mq980_1",g="_codeTitle_mq980_4",_="_img_mq980_1",h="_imgChange_mq980_16",y="_field_mq980_23",C="_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:C,closeOnClickOverlay:!1,onClose:()=>{this.$emit("close")},closeable:!0,closeIcon:"close"},{default:()=>[s("div",{class:f},[s("p",{class:g},[l("输入图形验证码")]),s(c,null,{default:()=>[s(m,{span:"14"},{default:()=>[s(u,{placeholder:"请输入验证码",modelValue:this.code,"onUpdate:modelValue":e=>this.code=e,class:y,autocomplete:"off"},null)]}),s(m,{span:"10",class:_},{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:h,onClick:()=>this.updateIdentifyingCode()},[l("看不清?换一换")])]})]})])]})}}))}}}))}();
|