(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-48cd2b8e"],{"2ca0":function(t,e,n){"use strict";var i=n("23e7"),a=n("06cf").f,s=n("50c4"),c=n("5a34"),o=n("1d80"),r=n("ab13"),l=n("c430"),u="".startsWith,h=Math.min,d=r("startsWith"),f=!l&&!d&&!!function(){var t=a(String.prototype,"startsWith");return t&&!t.writable}();i({target:"String",proto:!0,forced:!f&&!d},{startsWith:function(t){var e=String(o(this));c(t);var n=s(h(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return u?u.call(e,i,n):e.slice(n,n+i.length)===i}})},"575e":function(t,e,n){"use strict";n("a5fb")},a5fb:function(t,e,n){},cee5:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"wechat-title",rawName:"v-wechat-title",value:t.title,expression:"title"}],staticClass:"phone"},[n("div",{staticClass:"phoneCon"},[n("div",{staticClass:"phoneCon1"},[t._m(0),n("van-field",{staticClass:"tel",attrs:{placeholder:"请输入手机号",type:"tel",maxlength:"11"},model:{value:t.tel,callback:function(e){t.tel=e},expression:"tel"}}),n("div",{staticClass:"codeDiv flexCenterBetween"},[n("div",{staticClass:"codeCon"},[n("van-field",{staticClass:"code",attrs:{placeholder:"验证码",type:"tel",maxlength:"4"},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}})],1),n("div",{staticClass:"btnCode flexCenterCenter",on:{click:t.codeClick}},[t._v(t._s(t.isShowCode?"获取验证码":t.num+"S"))])]),n("p",{staticClass:"agreement flexCenterStart"},[n("span",{class:t.agreement?"checked":"check",on:{click:function(e){t.agreement=!t.agreement}}}),t._v(" 我已阅读并同意 "),n("a",{on:{click:function(){return t.$router.push("/termsOfService")}}},[t._v("《服务条款》、")]),n("a",{on:{click:function(){return t.$router.push("/privacyClause")}}},[t._v("《隐私条款》")])]),t._m(1)],1),n("div",{staticClass:"btn flexCenterCenter",on:{click:t.confirm}},[t._v("确认领取")])])])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",{staticClass:"title"},[t._v("领取账户"),n("span",[t._v("(所领取内容将放入此账号内)")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",[n("li",[t._v("输入领取手机号;下载“申怡读书”APP;")]),n("li",[t._v("使用同一个手机号登录“申怡读书APP”即可在“我的 兑换中心-兑换记录”中查看和使用。")])])}],s=(n("2ca0"),n("d466")),c=n("cf45"),o={data:function(){return{title:"快来测一测,你现在是几年级的水平",tel:"",code:"",agreement:!1,timer:null,isShowCode:!0,num:60,uniqueId:""}},mounted:function(){this.init()},beforeRouteEnter:function(t,e,n){n((function(t){e.path.startsWith("/one-year/")||"/termsOfService"==e.path||"/privacyClause"==e.path||t.$router.push("/one-year/index")}))},methods:{init:function(){var t=this;Object(s["Y"])({}).then((function(e){var n=e.code,i=e.data,a=e.msg;200==n?t.uniqueId=i.invitationCode.uniqueId:t.$toast.fail(a)}))},codeClick:function(){var t=this;11==this.tel.length?this.isShowCode&&Object(s["B"])({areaCode:"86",userName:this.tel,type:2,ts:Math.floor(Date.now()/1e3),sign:Object(c["g"])(this.tel)}).then((function(e){var n=e.code,i=(e.data,e.msg),a=t;200==n?(t.$toast("发送验证码成功"),t.isShowCode=!1,t.timer=setInterval((function(){a.num--,a.num<=0&&(clearInterval(a.timer),a.isShowCode=!0,a.num=60)}),1e3)):(t.$toast.fail(i),t.isShowCode=!0,t.num=60)})):this.$toast.fail("请输入正确的手机号")},sendUniqueId:function(){var t=this;Object(s["A"])({uniqueId:this.uniqueId}).then((function(e){var n=e.code,i=(e.data,e.msg);200==n?t.$router.push("/one-year/success/"+t.tel):t.$toast.fail(i)}))},confirm:function(){var t=this;11==this.tel.length&&""!=this.code?""!=this.uniqueId?this.agreement?Object(s["H"])({type:2,userName:this.tel,authCode:this.code,terminal:3}).then((function(e){var n=e.code,i=e.data,a=e.msg;200==n?(localStorage.setItem("token",i.accessToken),t.sendUniqueId()):t.$toast.fail(a)})):this.$toast.fail("请勾选同意选项"):this.$toast.fail("获取邀请码失败"):this.$toast.fail("请输入正确的验证码或手机号")}}},r=o,l=(n("575e"),n("2877")),u=Object(l["a"])(r,i,a,!1,null,"04dc7006",null);e["default"]=u.exports}}]);