| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d5c2a"],{7050:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cl-sms-btn"},[t._t("reference",[n("el-button",{attrs:{size:"small"},on:{click:t.openForm}},[t._v(t._s(t.count==t.count2?"获取验证码":t.count2+"s后重试"))])]),n("x-form",{ref:"x-form"})],2)},c=[],a=n("6abc"),o=n("60b5"),i=(n("6a61"),n("24a8"),{props:{count:{type:Number,default:60}},data:function(){var t=this.count;return{timer:null,svg:"",captchaId:"",loading:!1,count2:t}},methods:{getCaptcha:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n,r,c;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loading=!0,e.next=3,t.$service.common.captcha({height:40,width:120});case 3:n=e.sent,r=n.data,c=n.captchaId,t.svg=r,t.captchaId=c,t.loading=!1;case 9:case"end":return e.stop()}}),e)})))()},openForm:function(){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.$createElement,t.count2==t.count){e.next=3;break}return e.abrupt("return",!1);case 3:n=t,t.$refs["x-form"].open({props:{title:"图片验证码",width:"400px"},items:[{prop:"code",component:{name:"image-code",data:function(){return{code:""}},mounted:function(){n.getCaptcha()},watch:{code:function(t){this.$emit("input",t)}},render:function(){var t=this,e=arguments[0];return e("el-row",{attrs:{type:"flex"},directives:[{name:"loading",value:n.loading}]},[e("el-input",{attrs:{maxlength:"4"},style:{width:"240px"},model:{value:t.code,callback:function(e){t.code=e}}}),e("div",{class:"svg",on:{click:n.getCaptcha},style:{height:"30px",width:"120px",position:"relative",top:"-10px"},domProps:Object(a["a"])({},{innerHTML:n.svg})})])}},rules:[{required:!0,message:"图片验证码不能为空"},{min:4,max:4,message:"图片验证码为4个字符",trigger:"blur"}]}],on:{submit:function(e,n){t.$message.success("发送短信验证码成功"),n(),t.send(),t.$emit("success",t.captchaId)}}});case 5:case"end":return e.stop()}}),e)})))()},send:function(){var t=this;this.count2=this.count-1,this.timer=setInterval((function(){t.count2-=1,t.count2<=0&&(t.count2=t.count,clearInterval(t.timer))}),1e3)}}}),s=i,u=n("5d22"),l=Object(u["a"])(s,r,c,!1,null,null,null);e["default"]=l.exports}}]);
|