1 |
- webpackJsonp([29],{LMk5: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","",{version:3,sources:[],names:[],mappings:"",file:"BindingMobile.vue"}]),n.exports=e},Vnik:function(n,e,i){var o=i("LMk5");"string"==typeof o&&(o=[[n.i,o,""]]),o.locals&&(n.exports=o.locals);i("rjj0")("10cf1818",o,!1,{})},uavL:function(n,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i("SQ4B"),r=i("vGYV"),t=i("qI5z"),a={name:"BindingMobile",data:function(){return{phoneBindingForm:{phone:"",verifyCode:""},loading:!1,hasVerifyCode:!1,codeTime:60,user:{},rules:{verifyCode:[{required:!0,message:"请输入验证码",trigger:"blur"},{min:6,max:6,message:"验证码长度为6个字符",trigger:"blur"}],phone:[{required:!0,message:"请输入手机号",trigger:"blur"},{min:11,max:11,message:"手机号不合法",trigger:"blur"}]}}},methods:{setUserInfo:function(){var n=this,e=Object(r.M)("user")&&Object(r.M)("user").userVO.id;o.a.get("/api/user/"+e).then(function(e){n.user=e.userVO})},getVerifyCode:function(){var n=this,e={id:this.user.id,mobile:this.phoneBindingForm.phone};o.a.put("/api/verify/mobile",e).then(function(e){if("ERROR"==e.msg)Object(t.a)("error",e.data);else{Object(t.a)("success",e.data),n.hasVerifyCode=!0;var i=n,o=setInterval(function(){i.codeTime>0?i.codeTime--:(clearInterval(o),i.hasVerifyCode=!1,this.codeTime=10)},1e3)}}).catch(function(n){Object(t.a)("error","绑定手机失败:"+n.data)})},bindingMobile:function(){var n=this,e={id:this.user.id,mobile:this.phoneBindingForm.phone,verifyCode:this.phoneBindingForm.verifyCode};o.a.put("/api/user/mobile",e).then(function(e){"ERROR"==e.msg?(Object(t.a)("error","绑定失败:"+e.data),n.active=1,n.phoneBindingForm.phone="",n.phoneBindingForm.verifyCode="",n.codeTime=60,n.hasVerifyCode=!1):(Object(t.a)("success","绑定成功"),n.$router.push({path:"/personal/phoneBinding"}))}).catch(function(n){Object(t.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"}],staticStyle:{"margin-top":"20px"}},[i("el-form",{staticStyle:{width:"400px"},attrs:{"label-width":"80px",rules:n.rules,model:n.phoneBindingForm}},[i("el-form-item",{attrs:{label:"手机号码",prop:"phone"}},[i("el-input",{model:{value:n.phoneBindingForm.phone,callback:function(e){n.$set(n.phoneBindingForm,"phone",e)},expression:"phoneBindingForm.phone"}})],1),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.bindingMobile}},[n._v("完成绑定")])],1)],1)],1)};s._withStripped=!0;var d={render:s,staticRenderFns:[]},l=d;var c=!1;var p=i("VU/8")(a,l,!1,function(n){c||i("Vnik")},"data-v-69d47c3c",null);p.options.__file="src/pages/UserCenter/BindingMobile.vue";e.default=p.exports}});
|