webpackJsonp([33],{ixmb:function(t,s){},q3Wa:function(t,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0});e("Fd2+");var i={data:function(){return{phoneNum:"",Sms:"",rSms:"",now:"",options:[],value:"",classList:"",classJ:"",name:""}},methods:{time:function(){if(this.now){var t=(new Date).getTime();return t-this.now>3e3&&(this.now=t,!0)}return this.now=(new Date).getTime(),!0},init:function(){this.phoneNum="",this.Sms="",this.rSms="",this.value="",this.classList=""},findPhone:function(){var t=this;if(""!==this.phoneNum)if(/^1\d{10}$/.test(this.phoneNum)){var s={phone:this.phoneNum};this.ajax.get(this.$store.state.api+"findPhone",s).then(function(s){s.data[0].length>0?t.$toast.fail("此手机号已注册"):t.register()}).catch(function(t){console.error(t)})}else this.$toast.fail("请填写正确的手机号");else this.$toast.fail("请填写手机号")},register:function(){var t=this;if(""!==this.Sms)if(this.Sms.length<6)this.$toast.fail("输入的密码需不少于6位");else if(""!==this.name)if(""!==this.value)if(""!==this.classJ){if(!this.time())return!1;var s=[{unname:this.phoneNum,upassword:this.Sms,sid:"",type:2,oid:this.value,sname:this.name,class:this.classJ}];this.ajax.post(this.$store.state.api+"registerStudent",s).then(function(s){t.$toast.success("注册成功"),t.init(),t.$router.push({path:"/login"})}).catch(function(s){t.$toast.fail("注册失败"),console.error(s)})}else this.$toast.fail("请选择班级");else this.$toast.fail("请选择学校");else this.$toast.fail("请填写孩子真实姓名");else this.$toast.fail("请输入密码")},getOrg:function(){var t=this;this.ajax.get(this.$store.state.api+"getAllOrg","").then(function(s){t.options=s.data[0],console.log(s.data[0])}).catch(function(t){console.error(t)})},goTo:function(t){this.$router.push(t)},goBack:function(){if(this.$router.isBack=!0,window.history.length<=1)return this.$router.push({path:"/"}),!1;this.$router.go(-1)},getClass:function(){var t=this,s={cid:this.value};this.ajax.get(this.$store.state.api+"findClassByTeacher",s).then(function(s){t.classList=s.data[0],console.log(s.data[0][0])}).catch(function(t){console.error(t)})}},created:function(){this.getOrg()}},a={render:function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"login-body"},[e("div",{staticClass:"login-head"},[e("van-icon",{staticClass:"pb_back",attrs:{name:"arrow-left",color:"#fff",size:"1.2rem"},on:{click:t.goBack}}),t._v(" "),e("span",[t._v("注册")])],1),t._v(" "),e("div",{staticClass:"solid_box"}),t._v(" "),e("div",{staticClass:"login_box"},[e("div",{staticClass:"login_head"}),t._v(" "),e("div",{staticClass:"login_body"},[e("div",{staticClass:"login_text_box login_phoneNum"},[e("i"),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.phoneNum,expression:"phoneNum"}],attrs:{type:"text",placeholder:"请输入手机号"},domProps:{value:t.phoneNum},on:{input:function(s){s.target.composing||(t.phoneNum=s.target.value)}}})]),t._v(" "),e("div",{staticClass:"login_text_box login_sms"},[e("i"),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.Sms,expression:"Sms"}],attrs:{type:"text",placeholder:"请输入密码"},domProps:{value:t.Sms},on:{input:function(s){s.target.composing||(t.Sms=s.target.value)}}})]),t._v(" "),e("div",{staticClass:"login_text_box login_sms s_school"},[e("i"),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],attrs:{type:"text",placeholder:"请重新孩子真实姓名"},domProps:{value:t.name},on:{input:function(s){s.target.composing||(t.name=s.target.value)}}})]),t._v(" "),e("div",{staticClass:"login_text_box register_school"},[e("i"),t._v(" "),e("el-select",{attrs:{placeholder:"请选择学校..."},on:{change:t.getClass},model:{value:t.value,callback:function(s){t.value=s},expression:"value"}},t._l(t.options,function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1),t._v(" "),e("div",{staticClass:"login_text_box register_school c_school"},[e("i"),t._v(" "),e("el-select",{attrs:{placeholder:"请选择班级...","no-data-text":"请选择学校"},model:{value:t.classJ,callback:function(s){t.classJ=s},expression:"classJ"}},t._l(t.classList,function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1)]),t._v(" "),e("div",{staticClass:"login_button"},[e("button",{on:{click:t.findPhone}},[e("span",[t._v("注册")])])])])])},staticRenderFns:[]};var o=e("VU/8")(i,a,!1,function(t){e("ixmb")},"data-v-64c7b33b",null);s.default=o.exports}});
//# sourceMappingURL=33.07dc6f40adc2af3bd1a9.js.map