1 |
- webpackJsonp([32],{"2RsO":function(n,e,i){(e=i("yGwj")(!0)).push([n.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","",{version:3,sources:[],names:[],mappings:"",file:"ReBindingMobile.vue"}]),n.exports=e},"4z3q":function(n,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i("SQ4B"),t=i("vGYV"),r=i("qI5z"),a={name:"ReBindingMobile",data:function(){return{loading:!1,active:0,user:{},phoneBindingForm:{phone:"",verifyCode:"",newPhone:""},hasVerifyCode:!1,codeTime:60,rules:{verifyCode:[{required:!0,message:"请输入验证码",trigger:"blur"},{min:6,max:6,message:"验证码长度为6个字符",trigger:"blur"}],phone:[{required:!0,message:"请输入手机号",trigger:"blur"}],newPhone:[{required:!0,message:"请输入手机号",trigger:"blur"},{min:11,max:11,message:"手机号不合法",trigger:"blur"}]}}},methods:{setUserInfo:function(){var n=this,e=Object(t.M)("user")&&Object(t.M)("user").userVO.id;o.a.get("/api/user/"+e).then(function(e){n.user=e.userVO,n.phoneBindingForm.phone=n.user.mobile})},reBindingMobile:function(){var n=this;if(this.showLoading(),0===this.active){var e={id:this.user.id,mobile:this.user.mobile,verifyCode:this.phoneBindingForm.verifyCode};o.a.put("/api/verify/old/mobile",e).then(function(e){n.hideLoading(),2e4===e.code?(Object(r.a)("success","验证成功"),n.active=1,n.phoneBindingForm.phone="",n.phoneBindingForm.verifyCode="",n.hasVerifyCode=!1,n.codeTime=60,n.setUserInfo()):(Object(r.a)("error","验证原手机失败:"+e.data),n.codeTime=60,n.hasVerifyCode=!1)}).catch(function(e){n.phoneBindingForm.phone="",n.phoneBindingForm.verifyCode="",n.codeTime=60,n.hasVerifyCode=!1,n.hideLoading(),Object(r.a)("error","验证原手机失败:"+e.data)})}else{var i={id:this.user.id,mobile:this.phoneBindingForm.newPhone,verifyCode:this.phoneBindingForm.verifyCode};o.a.put("/api/user/mobile",i).then(function(e){n.hideLoading(),"ERROR"==e.msg?Object(r.a)("error","绑定失败:"+e.data):(Object(r.a)("success","绑定成功"),n.$router.push({path:"/personal/phoneBinding"}))}).catch(function(e){n.hideLoading(),Object(r.a)("error","绑定失败:"+e.data)})}},getVerifyCode:function(){var n=this;if(0===this.active){var e={id:this.user.id,mobile:this.phoneBindingForm.phone};o.a.put("/api/verify/mobile",e).then(function(e){var i=n;if("ERROR"==e.msg)Object(r.a)("error","验证码获取失败:"+e.data);else{n.hasVerifyCode=!0,Object(r.a)("success",e.data);var o=setInterval(function(){i.codeTime>0?i.codeTime--:(clearInterval(o),i.hasVerifyCode=!1,this.codeTime=10)},1e3)}}).catch(function(n){Object(r.a)("error","获取验证码失败:"+n.data)})}else{var i={id:this.user.id,mobile:this.phoneBindingForm.newPhone};o.a.put("/api/verify/mobile",i).then(function(e){var i=n;if("ERROR"==e.msg)Object(r.a)("error","验证码获取失败:"+e.data);else{n.hasVerifyCode=!0,Object(r.a)("success",e.data);var o=setInterval(function(){i.codeTime>0?i.codeTime--:(clearInterval(o),i.hasVerifyCode=!1,this.codeTime=10)},1e3)}}).catch(function(n){Object(r.a)("error","获取验证码失败:"+n.data)})}},showLoading:function(){this.loading=!0},hideLoading:function(){this.loading=!1}},mounted:function(){this.setUserInfo()}},s=function(){var n=this,e=n.$createElement,i=n._self._c||e;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:n.loading,expression:"loading"}]},[i("el-steps",{staticStyle:{margin:"20px"},attrs:{active:n.active,"process-status":"finish"}},[i("el-step",{attrs:{title:"验证原手机"}}),n._v(" "),i("el-step",{attrs:{title:"绑定新手机"}})],1),n._v(" "),i("el-form",{ref:n.phoneBindingForm,staticStyle:{width:"400px"},attrs:{"label-width":"80px",rules:n.rules,model:n.phoneBindingForm}},[0===n.active?i("el-form-item",{attrs:{label:"原手机号",prop:"phone"}},[i("span",{model:{value:n.phoneBindingForm.phone,callback:function(e){n.$set(n.phoneBindingForm,"phone",e)},expression:"phoneBindingForm.phone"}},[n._v(n._s(this.user.mobile))])]):n._e(),n._v(" "),1===n.active?i("el-form-item",{attrs:{label:"新手机号",prop:"newPhone"}},[i("el-input",{model:{value:n.phoneBindingForm.newPhone,callback:function(e){n.$set(n.phoneBindingForm,"newPhone",e)},expression:"phoneBindingForm.newPhone"}})],1):n._e(),n._v(" "),i("el-form-item",{attrs:{label:"验证码",prop:"verifyCode"}},[i("el-input",{staticClass:"input-with-select",attrs:{placeholder:"验证码内容"},model:{value:n.phoneBindingForm.verifyCode,callback:function(e){n.$set(n.phoneBindingForm,"verifyCode",e)},expression:"phoneBindingForm.verifyCode"}},[i("el-button",{attrs:{slot:"append",disabled:n.hasVerifyCode},on:{click:n.getVerifyCode},slot:"append"},[n._v(n._s(n.hasVerifyCode?n.codeTime:"获取验证码")+"\n ")])],1),n._v(" "),n.hasVerifyCode?i("span",[n._v("验证码已发送到您手机上")]):n._e()],1),n._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary",plain:""},on:{click:n.reBindingMobile}},[n._v(n._s(0===this.active?"下一步":"完成绑定")+"\n ")])],1)],1)],1)};s._withStripped=!0;var d={render:s,staticRenderFns:[]},c=d;var l=!1;var h=i("VU/8")(a,c,!1,function(n){l||i("aYoZ")},"data-v-59308709",null);h.options.__file="src/pages/UserCenter/ReBindingMobile.vue";e.default=h.exports},aYoZ:function(n,e,i){var o=i("2RsO");"string"==typeof o&&(o=[[n.i,o,""]]),o.locals&&(n.exports=o.locals);i("rjj0")("11093844",o,!1,{})}});
|