(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["SignUpAccount"],{"04cf":function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbutton"},[n("van-button",{attrs:{type:"primary",round:"",block:""},on:{click:t.onClick}},[t._v(t._s(t.text))])],1)},o=[],s={name:"mbutton",props:{text:String,disabled:Boolean},data:function(){return{}},methods:{onClick:function(){this.$emit("click")}}},i=s,r=(n("09c5"),n("2877")),c=Object(r["a"])(i,a,o,!1,null,"26f1a8ea",null);e["a"]=c.exports},"09c5":function(t,e,n){"use strict";var a=n("a6f6"),o=n.n(a);o.a},2558:function(t,e,n){"use strict";var a=n("f0da"),o=n.n(a);o.a},"2a52":function(t,e,n){},"3e40":function(t,e,n){"use strict";var a=n("2a52"),o=n.n(a);o.a},"4d65":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"signUpAccount"},[n("m-header"),n("m-step"),n("div",{staticClass:"title"},[t._v("基本信息")]),n("van-field",{attrs:{required:"",name:"phone",label:"手机号",placeholder:"请输入手机号"},model:{value:t.form.phone,callback:function(e){t.$set(t.form,"phone",e)},expression:"form.phone"}}),n("van-field",{attrs:{required:"",clearable:"",name:"code",label:"验证码",placeholder:"请输入验证码"},scopedSlots:t._u([{key:"button",fn:function(){return[n("span",{directives:[{name:"show",rawName:"v-show",value:t.countDownStatus,expression:"countDownStatus"}],staticClass:"codeText",on:{click:t.onGetCode}},[t._v("获取验证码")]),n("span",{directives:[{name:"show",rawName:"v-show",value:!t.countDownStatus,expression:"!countDownStatus"}],staticClass:"code-text"},[n("van-count-down",{ref:"countdown",attrs:{"auto-start":!1,time:t.countDownTime,format:"ss秒"},on:{finish:t.onCountDownFinished}})],1)]},proxy:!0}]),model:{value:t.form.code,callback:function(e){t.$set(t.form,"code",e)},expression:"form.code"}}),n("m-button",{staticClass:"stepBtn",attrs:{text:"下一步","native-type":"submit"},on:{click:t.onSubmit}})],1)},o=[],s=n("a34a"),i=n.n(s),r=n("6e6e"),c=n("ab6b"),u=n("04cf"),l=/^(?:(?:\+|00)86)?1[3-9]\d{9}$/,d=(n("433b"),n("d399"));function h(t){t?d["a"].loading({duration:0,forbidClick:!0,message:"加载中..."}):d["a"].clear()}var f=n("20bf");function v(t,e,n,a,o,s,i){try{var r=t[s](i),c=r.value}catch(u){return void n(u)}r.done?e(c):Promise.resolve(c).then(a,o)}function p(t){return function(){var e=this,n=arguments;return new Promise((function(a,o){var s=t.apply(e,n);function i(t){v(s,a,o,i,r,"next",t)}function r(t){v(s,a,o,i,r,"throw",t)}i(void 0)}))}}var m={name:"signUpAccount",components:{MHeader:r["a"],MStep:c["a"],MButton:u["a"]},data:function(){var t=this.$route.query;return{organId:t.organId,patternPhone:l,form:{phone:null,code:null},countDownStatus:!0,countDownTime:12e4}},mounted:function(){},methods:{onGetCode:function(){var t=p(i.a.mark((function t(){var e,n;return i.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(h(!0),this.checkPhone(this.form.phone)){t.next=3;break}return t.abrupt("return");case 3:return t.prev=3,t.next=6,Object(f["sendSms"])({mobile:this.form.phone});case 6:e=t.sent,n=e.data,200===n.code?(this.countDownStatus=!1,this.$refs.countdown.start(),h(!1)):this.$toast(n.msg),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](3),h(!1);case 14:case"end":return t.stop()}}),t,this,[[3,11]])})));function e(){return t.apply(this,arguments)}return e}(),onCountDownFinished:function(){this.countDownStatus=!0,this.$refs.countdown.reset()},onCheckPhone:function(){var t=p(i.a.mark((function t(){var e,n,a,o;return i.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return h(!0),t.prev=1,e=this.form,n={mobile:e.phone},t.next=6,Object(f["queryUserByPhone"])(n);case 6:a=t.sent,o=a.data,200===o.code?this.onLogin(o.data):this.$toast(o.msg),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](1),h(!1);case 14:case"end":return t.stop()}}),t,this,[[1,11]])})));function e(){return t.apply(this,arguments)}return e}(),onLogin:function(){var t=p(i.a.mark((function t(e){var n,a,o,s,r;return i.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=this.form,a={clientId:"student",clientSecret:"student",phone:n.phone,smsCode:n.code,organId:this.organId},0===e&&(a.registerFlag="true"),t.next=5,Object(f["smsLogin"])(a);case 5:o=t.sent,s=o.data,200===s.code?(r=s.data.authentication,localStorage.setItem("Authorization",r.token_type+" "+r.access_token),this.$router.push({path:"/signUpBaseInfo",query:{organId:this.organId}})):this.$toast(s.msg);case 8:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),onSubmit:function(){var t=this.form;this.checkPhone(t.phone)&&(t.code?this.onCheckPhone():this.$toast("请输入验证码"))},checkPhone:function(t){var e=!0;return this.patternPhone.test(t)||(this.$toast("手机号输入有误"),e=!1),e}},destroyed:function(){this.$toast.clear()}},_=m,b=(n("d82d"),n("2877")),w=Object(b["a"])(_,a,o,!1,null,"5af24058",null);e["default"]=w.exports},"61aa":function(t,e,n){},"6e6e":function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mheader"},[n("header",{staticClass:"m-nav-header",class:[{fixed:t.isFixed},{headerColor:t.isColor}]},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.isBack,expression:"isBack"}],staticClass:"m-nav-bar__left",on:{click:t.goBack}},[n("van-icon",{staticClass:"arrow-left",attrs:{name:"arrow-left"}})],1),n("div",{staticClass:"m-nav-bar__title"},[t._t("default",[t._v(t._s(t.name?t.name:t.$route.meta.description))])],2),n("div",{staticClass:"m-nav-bar__right"},[t._t("right")],2)])])},o=[],s={name:"mheader",props:{name:String,isBack:{type:Boolean,default:!0},isFixed:{type:Boolean,default:!0},isColor:{type:Boolean,default:!1},backUrl:{type:Object,default:function(){return{callBack:null,status:!1,path:"",params:{}}}}},data:function(){return{title:this.name,backUrlParams:this.backUrl}},methods:{goBack:function(){var t=this.backUrlParams;"function"==typeof t.callBack?t.callBack():t.status?this.$router.push({path:t.path,query:t.params}):history.go(-1)}}},i=s,r=(n("2558"),n("2877")),c=Object(r["a"])(i,a,o,!1,null,"9865a7b0",null);e["a"]=c.exports},a34a:function(t,e,n){t.exports=n("96cf")},a6f6:function(t,e,n){},ab6b:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mStep"},[n("div",{staticClass:"step"},t._l(t.imgUrlList,(function(e,a){return n("div",{key:a,staticClass:"step-item"},[t.number>=e.index?n("svg-icon",{key:"oneImg",attrs:{iconClass:e.active}}):n("svg-icon",{key:"oneImg",attrs:{iconClass:e.default}}),n("p",{class:[t.number>=e.index?e.activeClass:""]},[t._v(t._s(e.text))])],1)})),0)])},o=[],s=n("0032"),i={name:"mStep",components:{SvgIcon:s["a"]},props:{number:{type:Number,default:1}},data:function(){return{imgUrlList:[{index:1,default:"",active:"icon_account_active",activeClass:"active",text:"账号"},{index:1.5,default:"icon_right_arrow",active:"icon_right_arrow_active",activeClass:"active",text:""},{index:2,default:"icon_baseInfo",active:"icon_baseInfo_active",activeClass:"active",text:"基本信息"},{index:2.5,default:"icon_right_arrow",active:"icon_right_arrow_active",activeClass:"active",text:""},{index:3,default:"icon_level",active:"icon_level_active",activeClass:"active",text:"考级信息"},{index:3.5,default:"icon_right_arrow",active:"icon_right_arrow_active",activeClass:"active",text:""},{index:4,default:"icon_payment",active:"icon_payment_active",activeClass:"active",text:"支付"}]}},methods:{}},r=i,c=(n("3e40"),n("2877")),u=Object(c["a"])(r,a,o,!1,null,"406ae98f",null);e["a"]=u.exports},d82d:function(t,e,n){"use strict";var a=n("61aa"),o=n.n(a);o.a},f0da:function(t,e,n){}}]);