webpackJsonp([11],{XWbS:function(t,e){},lFkT:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n("//Fk"),i=n.n(o),s={data:function(){return{code:"",onInput:!1,phone:"",num:61,isSend:!1,realCode:"",bindType:!1}},created:function(){this.$route.query.phone&&(this.phone=this.$route.query.phone),this.$route.query.bindType&&(this.bindType=!0),this.sendCode()},computed:{canNext:function(){var t=!1;return this.realCode&&this.code&&(t=!0),t}},methods:{back:function(){this.$router.replace({name:"login"})},click:function(){var t=this;this.canNext&&this.login().then(function(){window.history.length<=1?t.$router.replace({name:"home",query:{},params:{isNext:1}}):t.$router.go(-1)})},login:function(){var t=this;return new i.a(function(e,n){t.bindType?t.checkCode().then(function(n){console.log(n),n?(t.updateUser("phone",t.phone),e()):t.$modal.info({msg:"验证码错误",duration:1500})}):(t.$store.commit("updateLoading",!0),t.$http.post({url:"/userInfo/loginSms",data:{phone:t.phone,code:t.code,sessionId:t.realCode}}).then(function(n){t.$store.commit("updateLoading",!1),n.success?(t.$modal.success({msg:"登录/注册成功",duration:1500}),e()):t.$modal.info({msg:n.error,duration:1500})}))})},checkUsePhone:function(){var t=this;return this.$store.commit("updateLoading",!0),new i.a(function(e,n){t.$http.get({url:"/userInfo/getOne",data:{phone:t.phone}}).then(function(n){t.$store.commit("updateLoading",!1),n.success?(console.log(n.data),n.data?e(!0):e(!1)):e(!1)})})},checkCode:function(){var t=this;return this.$store.commit("updateLoading",!0),new i.a(function(e,n){t.$http.get({url:"/rong/verifyCode",data:{sessionId:t.realCode,code:t.code}}).then(function(n){t.$store.commit("updateLoading",!1),n.success?e(!0):e(!1)})})},sendCode:function(){var t=this;this.isSend||this.getSend().then(function(){t.isSend=!0,t.getTime()})},getSend:function(){var t=this;return this.$store.commit("updateLoading",!0),new i.a(function(e,n){t.$http.get({url:"/rong/sendCode",data:{phone:t.phone}}).then(function(n){t.$store.commit("updateLoading",!1),n.success?(t.$modal.success({msg:"发送成功",duration:1500}),t.realCode=n.data,e()):t.$modal.info({msg:n.error,duration:1500})})})},getTime:function(){var t=this;this.num>0?(this.num--,setTimeout(function(){t.getTime()},1e3)):(this.num=61,this.isSend=!1)}},components:{GmButton:n("qkow").a}},a={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"container"},[o("div",{staticClass:"title"},[t._v("\n        验证码已发送至\n    ")]),t._v(" "),o("div",{staticClass:"send"},[o("div",{staticClass:"val",on:{click:t.back}},[t._v(t._s(t.phone))]),t._v(" "),o("div",{staticClass:"ps",on:{click:t.sendCode}},[t._v(t._s(t.isSend?"("+t.num+"秒)":"发送验证码"))])]),t._v(" "),o("div",{staticClass:"input"},[o("img",{staticClass:"icon",attrs:{src:n("PyDq"),alt:""}}),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.code,expression:"code"}],attrs:{type:"number",placeholder:"输入短信验证码"},domProps:{value:t.code},on:{input:[function(e){e.target.composing||(t.code=e.target.value)},function(e){t.code=t.code.slice(0,6)}],focus:function(e){t.onInput=!0},blur:function(e){t.onInput=!1}}}),t._v(" "),t.onInput&&t.code?o("img",{staticClass:"del",attrs:{src:n("9F0b"),alt:""},on:{click:function(e){t.code=""}}}):t._e()]),t._v(" "),o("div",{staticClass:"btn"},[o("gm-button",{attrs:{type:t.canNext?"primary":"dark"},on:{click:t.click}},[t._v(t._s(t.bindType?"绑定":"注册/登录"))])],1)])},staticRenderFns:[]};var c=n("VU/8")(s,a,!1,function(t){n("XWbS")},"data-v-e5fac1a8",null);e.default=c.exports}});
//# sourceMappingURL=11.67ed3efe8028050a0714.js.map