webpackJsonp([14],{"/Vxk":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i("mvHQ"),r=i.n(s),o=i("CCn6"),n=i("7Otq"),a=i.n(n),c=i("Au9i"),l=i("sf/l"),d={name:"bindMobile",mounted:function(){if(this.$sa.track("ViewRegisterpage",{}),!localStorage.getItem("cc_token")){var t=l.a.getUrlParam().token||this.$route.query.token;console.log(t),t?(localStorage.setItem("cc_token",t),this.$store.dispatch("setToken",t)):this.$router.push({name:"author",query:{retUrl:this.$route.fullPath,is_new_user_url:1}})}for(var e=document.getElementById("myCanvas").getContext("2d"),i=[],s=0;s<10;s++)i.push({x:750*Math.random(),y:1334*Math.random(),vx:5*Math.random(),vy:5*Math.random(),size:1+20*Math.random(),color:"#"+("0000"+(16777216*Math.random()<<0).toString(16)).slice(-6)});setInterval(function(t){e.clearRect(0,0,750,1334),i.length;for(var s,r=0;r<10;r++)(s=i[r]).x+=s.vx,s.y+=s.vy,(s.x<=0||s.x>=750)&&(s.vx*=-1),(s.y<=0||s.y>=1334)&&(s.vy*=-1),e.fillStyle=s.color,e.beginPath(),e.arc(s.x,s.y,s.size,0,2*Math.PI,!0),e.closePath(),e.fill()},40)},data:function(){return{logoUrl:a.a,mobile:"",time:0,flag:!0,imgCode:"",msgCode:"",timeSet:null}},methods:{refImgCode:function(){this.$refs.imgCode.src="/api/public/img/verify?flag="+Math.random()},sendMobileCode:function(){var t=this;if(""===this.imgCode||!this.imgCode)return Object(c.Toast)("请填写图形验证码"),!1;var e={img_code:this.imgCode};if(!this.mobile.match(/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/))return Object(c.Toast)("请正确填写手机号"),!1;e.mobile=this.mobile,this.time=30,this.timeO(),this.$sa.track("clickSendcode",{}),Object(o.I)(e).then(function(e){"操作成功"===e?Object(c.Toast)("验证码已发送"):(t.time=0,t.refImgCode(),Object(c.Toast)(e))}).catch(function(e){t.refImgCode()})},timeO:function(){var t=this;this.time>0&&(this.time--,setTimeout(function(){t.timeO()},1e3))},bindMobile:function(){var t=this;if(this.$sa.track("clickSignUp",{}),this.flag){if(this.flag=!1,""===this.msgCode||!this.msgCode)return Object(c.Toast)("请填写手机验证码"),!1;var e={verify_code:this.msgCode};if(!this.mobile.match(/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/))return Object(c.Toast)("请正确填写手机号"),!1;e.mobile=this.mobile,window.location.href.indexOf("teacher_id")>-1&&(e.teacher_id=l.a.getUrlParam().teacher_id||this.$route.query.teacher_id),Object(o.c)(e).then(function(e){Object(o.A)().then(function(e){localStorage.setItem("userDesc",r()(e)),t.$route.query.retUrl?t.$router.push(t.$route.query.retUrl):t.$router.push({name:"index"}),t.flag=!0})}).catch(function(e){t.refImgCode(),t.flag=!0})}}}},u={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("canvas",{attrs:{id:"myCanvas",width:"750",height:"1334"}}),t._v(" "),i("div",{staticClass:"banner-block"},[i("img",{attrs:{src:t.logoUrl}})]),t._v(" "),i("div",{staticClass:"form-block"},[i("div",{staticClass:"input-block"},[i("div",{staticClass:"tips"},[t._v("Mobile Phone")]),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:t.mobile,expression:"mobile"}],attrs:{placeholder:"请输入手机号"},domProps:{value:t.mobile},on:{input:function(e){e.target.composing||(t.mobile=e.target.value)}}})]),t._v(" "),i("div",{staticClass:"input-block"},[i("div",{staticClass:"tips"},[t._v("Picture Verification")]),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:t.imgCode,expression:"imgCode"}],attrs:{placeholder:"请输入图片验证码"},domProps:{value:t.imgCode},on:{input:function(e){e.target.composing||(t.imgCode=e.target.value)}}}),t._v(" "),i("img",{ref:"imgCode",staticClass:"right-btn",attrs:{src:"/api/public/img/verify"},on:{click:t.refImgCode}})]),t._v(" "),i("div",{staticClass:"input-block"},[i("div",{staticClass:"tips"},[t._v("Verification Code")]),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:t.msgCode,expression:"msgCode"}],attrs:{placeholder:"请输入短信验证码"},domProps:{value:t.msgCode},on:{input:function(e){e.target.composing||(t.msgCode=e.target.value)}}}),t._v(" "),0===t.time?i("button",{staticClass:"codeMsg right-btn",on:{click:t.sendMobileCode}},[t._v("发送验证码")]):t._e(),t._v(" "),t.time>0?i("button",{staticClass:"codeMsg disabled right-btn"},[t._v(t._s(t.time)+"s后重新发送")]):t._e()])]),t._v(" "),i("div",{staticClass:"btn-block"},[i("div",{staticClass:"btn",on:{click:t.bindMobile}},[t._v("\n      注册并绑定微信\n    ")])])])},staticRenderFns:[]};var m=i("VU/8")(d,u,!1,function(t){i("SC1p")},"data-v-e55a21f2",null);e.default=m.exports},"7Otq":function(t,e){t.exports="data:image/png;base64,[encoded data, 7032 characters]"},SC1p:function(t,e){}});
//# sourceMappingURL=14.b3d17f7be63f79b48c70.js.map