1 line
3.8 KiB
JavaScript
1 line
3.8 KiB
JavaScript
![]() |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ebc6c45a"],{"02ef":function(t,e,a){},"32f9":function(t,e,a){"use strict";a("02ef")},a73d:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("a-form",{staticStyle:{"max-width":"500px",margin:"40px auto 0"},attrs:{form:t.form},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.nextStep(e)}}},[a("a-form-item",{attrs:{label:"手机",labelCol:{span:5},wrapperCol:{span:19}}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["phone",{rules:t.validatorRules.phone.rule}],expression:"['phone',{ rules: validatorRules.phone.rule}]"}],staticStyle:{width:"310px","margin-left":"-10px"},attrs:{type:"text",autocomplete:"false",placeholder:"请输入手机号"}},[a("a-icon",{style:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"phone"},slot:"prefix"})],1)],1),t.show?a("a-form-item",{attrs:{label:"验证码",labelCol:{span:5},wrapperCol:{span:19}}},[a("a-row",{staticStyle:{"margin-left":"2px"},attrs:{gutter:16}},[a("a-col",{staticClass:"gutter-row",attrs:{span:12}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["captcha",t.validatorRules.captcha],expression:"['captcha',validatorRules.captcha]"}],attrs:{type:"text",placeholder:"手机短信验证码"}})],1),a("a-col",{staticClass:"gutter-row",attrs:{span:8}},[a("a-button",{attrs:{tabindex:"-1",size:"default",disabled:t.state.smsSendBtn},domProps:{textContent:t._s(t.state.smsSendBtn?t.state.time+" s":"获取验证码")},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.getCaptcha(e)}}})],1)],1)],1):t._e(),a("a-form-item",{attrs:{wrapperCol:{span:19,offset:5}}},[a("router-link",{staticStyle:{float:"left","line-height":"40px"},attrs:{to:{name:"login"}}},[t._v("使用已有账户登录")]),a("a-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"primary"},on:{click:t.nextStep}},[t._v("下一步")])],1)],1)],1)},i=[],o=a("0fea"),n={name:"Step2",props:["userList"],data:function(){return{form:this.$form.createForm(this),loading:!1,dropList:"0",captcha:"",show:!0,state:{time:60,smsSendBtn:!1},formLogin:{captcha:"",mobile:""},validatorRules:{captcha:{rule:[{required:!0,message:"请输入短信验证码!"},{validator:this.validateCaptcha}]},phone:{rule:[{required:!0,message:"请输入手机号码!"},{validator:this.validatePhone}]}}}},computed:{},methods:{nextStep:function(){var t=this,e=this;e.loading=!0,this.form.validateFields((function(a,s){if(!a&&"0"==e.dropList)if(void 0==s.captcha)t.cmsFailed("请输入短信验证码!");else{var i={};i.phone=s.phone,i.smscode=s.captcha,Object(o["i"])("/sys/user/phoneVerification",i).then((function(a){if(a.success){var i={username:a.result.username,phone:s.phone,smscode:a.result.smscode};setTimeout((function(){e.$emit("nextStep",i)}),0)}else t.cmsFailed(a.message)}))}}))},getCaptcha:function(t){var e=this;t.preventDefault();var a=this,s=a.form.getFieldValue("phone");if(s){this.state.smsSendBtn=!0;var i=window.setInterval((function(){a.state.time--<=0&&(a.state.time=60,a.state.smsSendBtn=!1,window.clearInterval(i))}),1e3),n=this.$message.loading("验证码发送中..",0),r={mobile:s,smsmode:"2"};Object(o["i"])("/sys/sms",r).then((function(t){t.success||(setTimeout(n,1),e.cmsFailed(t.message)),setTimeout(n,500)}))}else this.cmsFailed("手机号不能为空!")},cmsFailed:function(t){this.$notification["error"]({message:"验证错误",description:t,duration:4})},handleChangeSelect:function(t){var e=this;0==t?(e.dropList="0",e.show=!0):(e.dropList="1",e.show=!1)},validatePhone:function(t,e,a){if(e){var s=/^[1][3,4,5,7,8][0-9]{9}$/;s.test(e)?a():a("请输入正确的手机号")}else a()}}},r=n,l=(a("32f9"),a("2877")),c=Object(l["a"])(r,s,i,!1,null,"275fc9b2",null);e["default"]=c.exports}}]);
|