(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c4d6c"],{"3d16":function(e,t,a){"use strict";a.r(t);var c=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ChangePassword"},[a("div",{staticClass:"list"},[a("div",{staticClass:"item"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.phone,expression:"phone"}],attrs:{type:"number",placeholder:"填写手机号码"},domProps:{value:e.phone},on:{input:function(t){t.target.composing||(e.phone=t.target.value)}}})]),a("div",{staticClass:"item acea-row row-between-wrapper"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.captcha,expression:"captcha"}],staticClass:"codeIput",attrs:{type:"text",placeholder:"填写验证码"},domProps:{value:e.captcha},on:{input:function(t){t.target.composing||(e.captcha=t.target.value)}}}),a("button",{staticClass:"code font-color-red",class:!0===e.disabled?"on":"",attrs:{disabled:e.disabled},on:{click:e.code}},[e._v("\n "+e._s(e.text)+"\n ")])]),e.isShowCode?a("div",{staticClass:"item"},[a("div",{staticClass:"align-left"},[a("svg",{staticClass:"icon",attrs:{"aria-hidden":"true"}},[a("use",{attrs:{"xlink:href":"#icon-code_"}})]),a("input",{directives:[{name:"model",rawName:"v-model",value:e.codeVal,expression:"codeVal"}],staticClass:"codeIput",attrs:{type:"text",placeholder:"填写验证码"},domProps:{value:e.codeVal},on:{input:function(t){t.target.composing||(e.codeVal=t.target.value)}}}),a("div",{staticClass:"code",on:{click:e.again}},[a("img",{attrs:{src:e.codeUrl}})])])]):e._e()]),a("div",{staticClass:"confirmBnt bg-color-red",on:{click:e.confirm}},[e._v("确认绑定")])])},n=[],o=(a("f548"),a("63ff"),a("57f0")),s=a("08c1"),r=a("f750"),i=a("61f7"),d=a("cba2"),l=a("c24f"),u=a("ed08"),p={name:"BindingPhone",components:{},props:{},data:function(){return{captcha:"",phone:"",keyCode:"",codeUrl:"",codeVal:"",isShowCode:!1}},mixins:[r["a"]],computed:Object(s["b"])(["userInfo"]),mounted:function(){this.getCode()},methods:{again:function(){this.codeUrl=u["a"]+"/captcha?"+this.keyCode+Date.parse(new Date)},getCode:function(){var e=this;Object(l["l"])().then((function(t){e.keyCode=t.data.key})).catch((function(t){e.$dialog.error(t.msg)}))},confirm:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,a,c,n,o=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=this,a=t.phone,c=t.captcha,n=t.codeVal,e.prev=2,e.next=5,t.$validator({phone:[Object(i["b"])(i["b"].message("手机号码")),Object(i["a"])(i["a"].message())],captcha:[Object(i["e"])(i["e"].message("验证码")),Object(i["a"])(i["a"].message("验证码"))],codeVal:this.isShowCode?[Object(i["e"])(i["e"].message("验证码")),i["c"].length(4,i["c"].length.message("验证码")),Object(i["a"])(i["a"].message("验证码"))]:[]}).validate({phone:a,captcha:c,codeVal:n});case 5:e.next=10;break;case 7:return e.prev=7,e.t0=e["catch"](2),e.abrupt("return",Object(d["b"])(e.t0));case 10:Object(l["a"])({phone:this.phone,captcha:this.captcha,code:this.codeVal}).then((function(e){void 0!==e.data&&e.data.is_bind?t.$dialog.confirm({mes:e.msg,opts:[{txt:"确认绑定",color:!1,callback:function(){Object(l["a"])({phone:o.phone,captcha:o.captcha,step:1}).then((function(e){t.$dialog.success(e.msg).then((function(){t.$router.replace({name:"PersonalData"})}))})).catch((function(e){t.$dialog.error(e.msg).then((function(){t.$router.replace({name:"PersonalData"})}))}))}},{txt:"取消",color:!1,callback:function(){t.$dialog.error("已取消绑定").then((function(){t.$router.replace({name:"PersonalData"})}))}}]}):t.$dialog.success(e.msg).then((function(){t.$router.replace({name:"PersonalData"})}))})).catch((function(e){t.$dialog.error(e.msg)}));case 11:case"end":return e.stop()}}),e,this,[[2,7]])})));function t(){return e.apply(this,arguments)}return t}(),code:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=this,a=t.phone,e.prev=2,e.next=5,t.$validator({phone:[Object(i["e"])(i["e"].message("手机号码")),Object(i["b"])(i["b"].message())]}).validate({phone:a});case 5:e.next=10;break;case 7:return e.prev=7,e.t0=e["catch"](2),e.abrupt("return",Object(d["b"])(e.t0));case 10:Object(l["U"])({phone:a,key:t.keyCode,code:t.codeVal}).then((function(e){t.$dialog.success(e.msg),t.sendCode()})).catch((function(e){402===e.data.status&&(t.codeUrl="".concat(u["a"],"/sms_captcha?key=").concat(t.keyCode),t.isShowCode=!0),t.$dialog.error(e.msg)}));case 11:case"end":return e.stop()}}),e,this,[[2,7]])})));function t(){return e.apply(this,arguments)}return t}()}},h=p,m=a("623f"),g=Object(m["a"])(h,c,n,!1,null,null,null);t["default"]=g.exports}}]); //# sourceMappingURL=chunk-2d0c4d6c.8c4e5a08.js.map