123456 |
- /*!
- * build: Hopaheal
- * copyright: Mead
- * time: 2022-7-23 18:51:45
- */
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-997c8a06"],{"173f":function(e,t,r){"use strict";r("68f1")},"68f1":function(e,t,r){},d5c2:function(e,t,r){"use strict";r.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"register-container"},[t("el-row",[t("el-col",{attrs:{lg:14,md:11,sm:24,xl:14,xs:24}},[t("div",{staticStyle:{color:"transparent"}},[e._v("占位符")])]),t("el-col",{attrs:{lg:9,md:12,sm:24,xl:9,xs:24}},[t("el-form",{ref:"registerForm",staticClass:"register-form",attrs:{model:e.form,rules:e.registerRules,size:"mini"}},[t("div",{staticClass:"title-tips"},[e._v("注册")]),t("el-form-item",{attrs:{prop:"username"}},[t("el-input",{directives:[{name:"focus",rawName:"v-focus"}],attrs:{"auto-complete":"off",placeholder:"请输入用户名",type:"text"},scopedSlots:e._u([{key:"prefix",fn:function(){return[t("vab-icon",{attrs:{icon:"user-line"}})]},proxy:!0}]),model:{value:e.form.username,callback:function(t){e.$set(e.form,"username","string"===typeof t?t.trim():t)},expression:"form.username"}})],1),t("el-form-item",{attrs:{prop:"phone"}},[t("el-input",{attrs:{maxlength:"11",placeholder:"请输入手机号","show-word-limit":"",type:"text"},scopedSlots:e._u([{key:"prefix",fn:function(){return[t("vab-icon",{attrs:{icon:"smartphone-line"}})]},proxy:!0}]),model:{value:e.form.phone,callback:function(t){e.$set(e.form,"phone","string"===typeof t?t.trim():t)},expression:"form.phone"}})],1),t("el-form-item",{staticStyle:{position:"relative"},attrs:{prop:"phoneCode"}},[t("el-input",{attrs:{placeholder:"请输入手机验证码",type:"text"},scopedSlots:e._u([{key:"prefix",fn:function(){return[t("vab-icon",{attrs:{icon:"barcode-box-line"}})]},proxy:!0}]),model:{value:e.form.phoneCode,callback:function(t){e.$set(e.form,"phoneCode","string"===typeof t?t.trim():t)},expression:"form.phoneCode"}}),t("el-button",{staticClass:"phone-code",attrs:{disabled:e.isGetPhone,type:"primary"},on:{click:e.getPhoneCode}},[e._v(" "+e._s(e.phoneCode)+" ")])],1),t("el-form-item",{attrs:{prop:"password"}},[t("el-input",{attrs:{autocomplete:"new-password",placeholder:"请输入密码",type:"password"},scopedSlots:e._u([{key:"prefix",fn:function(){return[t("vab-icon",{attrs:{icon:"lock-line"}})]},proxy:!0}]),model:{value:e.form.password,callback:function(t){e.$set(e.form,"password","string"===typeof t?t.trim():t)},expression:"form.password"}})],1),t("el-form-item",[t("el-button",{staticClass:"register-btn",attrs:{type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleRegister.apply(null,arguments)}}},[e._v(" 注册 ")]),t("router-link",{attrs:{to:"/login"}},[t("div",{staticStyle:{"margin-top":"20px"}},[e._v("登录")])])],1)],1)],1),t("el-col",{attrs:{lg:1,md:1,sm:24,xl:1,xs:24}},[t("div",{staticStyle:{color:"transparent"}},[e._v("占位符")])])],1)],1)},o=[],n=(r("d9e2"),r("61f7")),i=r("c24f"),a={name:"Register",directives:{focus:{inserted(e){e.querySelector("input").focus()}}},data(){const e=(e,t,r)=>{""===t?r(new Error("用户名不能为空")):r()},t=(e,t,r)=>{Object(n["isPassword"])(t)?r():r(new Error("密码不能少于6位"))},r=(e,t,r)=>{Object(n["isPhone"])(t)?r():r(new Error("请输入正确的手机号"))};return{isGetPhone:!1,getPhoneInterval:null,phoneCode:"获取验证码",showRegister:!1,form:{},registerRules:{username:[{required:!0,trigger:"blur",message:"请输入用户名"},{validator:e,trigger:"blur"}],phone:[{required:!0,trigger:"blur",message:"请输入手机号"},{validator:r,trigger:"blur"}],password:[{required:!0,trigger:"blur",message:"请输入密码"},{validator:t,trigger:"blur"}],phoneCode:[{required:!0,trigger:"blur",message:"请输入手机验证码"}]},loading:!1,passwordType:"password"}},beforeDestroy(){this.getPhoneInterval=null,clearInterval(this.getPhoneInterval)},methods:{getPhoneCode(){if(!Object(n["isPhone"])(this.form.phone))return void this.$refs["registerForm"].validateField("phone");this.isGetPhone=!0;let e=60;this.getPhoneInterval=setInterval(()=>{e>0?(e--,this.phoneCode="获取验证码 "+e+"s"):(clearInterval(this.getPhoneInterval),this.phoneCode="获取验证码",this.getPhoneInterval=null,this.isGetPhone=!1)},1e3)},handleRegister(){this.$refs["registerForm"].validate(async e=>{if(e){const{msg:e}=await Object(i["register"])(this.form);this.$baseMessage(e,"success",!1,"vab-hey-message-success")}})}}},l=a,c=(r("173f"),r("2877")),p=Object(c["a"])(l,s,o,!1,null,"93704c88",null);t["default"]=p.exports}}]);
|