| 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("cl-form",{ref:"cl-form"})],2)},c=[],i=(n("3546"),n("0e8d"),n("fdc1"),n("1528"),n("a94a"),n("639b"),n("4f5b"),n("b287"),n("9d37")),o=(n("63ff"),n("e5af"));function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){Object(i["a"])(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var u={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=Object(o["a"])(regeneratorRuntime.mark((function t(){var e,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,this.$service.common.captcha({height:40,width:120});case 3:e=t.sent,n=e.data,r=e.captchaId,this.svg=n,this.captchaId=r,this.loading=!1;case 9:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),openForm:function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(){var e,n=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(this.$createElement,this.count2==this.count){t.next=3;break}return t.abrupt("return",!1);case 3:e=this,this.$refs["cl-form"].open({props:{title:"图片验证码",width:"400px"},items:[{prop:"code",component:{name:"image-code",data:function(){return{code:""}},mounted:function(){e.getCaptcha()},watch:{code:function(t){this.$emit("input",t)}},render:function(){var t=this,n=arguments[0];return n("el-row",{attrs:{type:"flex"},directives:[{name:"loading",value:e.loading}]},[n("el-input",{attrs:{maxlength:"4"},style:{width:"240px"},model:{value:t.code,callback:function(e){t.code=e}}}),n("div",{class:"svg",on:{click:e.getCaptcha},style:{height:"30px",width:"120px",position:"relative",top:"-10px"},domProps:s({},{innerHTML:e.svg})})])}},rules:[{required:!0,message:"图片验证码不能为空"},{min:4,max:4,message:"图片验证码为4个字符",trigger:"blur"}]}],on:{submit:function(t,e){n.$message.success("发送短信验证码成功"),e(),n.send(),n.$emit("success",n.captchaId)}}});case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return 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)}}},p=u,l=n("5511"),h=Object(l["a"])(p,r,c,!1,null,null,null);e["default"]=h.exports}}]);
|