1 |
- webpackJsonp([82],{"9ijU":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o("TIfe"),a={name:"change_pwd",filters:{mobile:function(e){return e?""==e?e:e.replace(e.substring(3,7),"****"):""}},data:function(){return{countdownSet:null,next_loading:!1,reg_loading:!1,username_error:"",code_error:"",mobile_error:"",mobile_success:"",complite_btn_enable:!1,login_error:!1,login_error_msg:"",next_btn_enable:!1,userinfo:this.$userInfo(),account_info:this.$store.getters.account_info,setp:1,countdown:90,sended:!1,sendMsgText:"获取验证码",sendMsgLoading:!1,formData:{verify:"",origin_verify:"",tel:""}}},created:function(){this.formData.aff_code=this.$route.query.aff_code},watch:{formData:{handler:function(e,t){""!=e.username&&""!=e.code?this.next_btn_enable=!0:this.next_btn_enable=!1,this.checkMobile(e.username)?(this.mobile_error="",this.mobile_success="success"):(this.mobile_error="手机号格式错误",this.mobile_success=""),""!=e.password&&""!=e.password_check?this.complite_btn_enable=!0:this.complite_btn_enable=!1},deep:!0}},methods:{show_error:function(e){var t=this;t.login_error=!0,setTimeout(function(){t.login_error=!1},3e3),t.login_error_msg=e},nextReg:function(){var e=this;e.next_loading=!0,this.$axios("post","/api/pro/verify/check",{type:3,tel:this.account_info.tel,verify:e.formData.origin_verify}).then(function(t){e.next_loading=!1,1==t.data.code?(e.countdown=0,clearTimeout(e.countdownSet),setTimeout(function(){e.sendMsgText="获取验证码",e.sended=!1,e.countdown=90},1e3),e.setp++):e.$notify({message:t.data.msg,duration:1e3,background:"#f44"})})},countDownInit:function(){var e=this;if(e.sendMsgText="已发送("+e.countdown+")",0==e.countdown)return e.countdown=90,e.sendMsgText="重新发送",e.sended=!1,!1;e.countdownSet=setTimeout(function(){e.countdown--,e.countDownInit()},1e3)},sendLogin:function(){var e=this;e.$toast.loading({mask:!0,message:"正在登录..."}),this.$store.dispatch("login",{account:e.formData.username,password:e.formData.password}).then(function(t){e.$toast.clear(),0==t.code?e.$notify({message:t.msg,duration:1e3,background:"#f44"}):e.$router.push({name:"home"})})},sendReg:function(){var e=this;if(""==e.formData.code)return e.$toast("请输入验证码!"),!1;var t,o;if(t="/api/pro/account/replace",o={type:"mobile",tel:e.formData.tel,verify:e.formData.verify,origin_verify:e.formData.origin_verify},!this.checkMobile(e.formData.tel))return e.$toast("请输入正确的手机号"),!1;e.reg_loading=!0,this.$axios("post",t,o).then(function(t){if(1==t.data.code){if(e.$toast(t.data.msg),window.plus?plus.storage.removeItem("account_info"):localStorage.removeItem("account_info"),window.plus)for(var o=plus.webview.all(),n=0;n<o.length;n++)o[n].evalJS('window.VueObj.$store.dispatch("get_account_info").then(function(){window.VueObj.$forceUpdate();});');else e.$store.dispatch("get_account_info");e.$route_back()}}).finally(function(){e.reg_loading=!1})},checkMobile:function(e){return!!/^1[0123456789]\d{9}$/.test(e)},sendMsg:function(){var e=this;e.sendMsgLoading=!0;var t=null;if(t=1==e.setp?{mobile:e.account_info.tel,type:3}:{mobile:e.formData.tel,type:1},!this.verifyPhoneNo(t.mobile))return e.$notify({message:"请输入正确手机号码",duration:1e3,background:"#f44"}),e.sendMsgLoading=!1,!1;this.$axios("post","/api/pro/send-sms",{data:Object(n.s)(t)},"v2").then(function(t){1==t.data.code?(e.sended=!0,e.countDownInit(),e.$toast("已经发送,请注意查收!")):e.$toast(t.data.msg)}).finally(function(){e.sendMsgLoading=!1})},verifyPhoneNo:function(e){return/^1[0123456789]\d{9}$/.test(e)}}},s={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login-box-parent"},[o("van-nav-bar",{attrs:{title:"修改手机号","left-text":"返回","left-arrow":""},on:{"click-left":e.$route_back}}),e._v(" "),o("div",{staticClass:"login-box",staticStyle:{"background-color":"#f5f5f5"}},[o("scroller",[o("div",{staticClass:"login-form-box",staticStyle:{"background-color":"#fff"}},[o("div",{staticClass:"setp1"},[o("van-cell-group",[o("van-cell",{directives:[{name:"show",rawName:"v-show",value:""!=e.account_info.tel&&1==e.setp,expression:"account_info.tel != '' && setp == 1"}],attrs:{title:"手机号"}},[e._v(e._s(e._f("mobile")(e.account_info.tel)))]),e._v(" "),o("van-field",{directives:[{name:"show",rawName:"v-show",value:1==e.setp,expression:"setp == 1"}],attrs:{center:"",clearable:"",label:"验证码",placeholder:"请输入短信验证码","error-message":e.code_error},model:{value:e.formData.origin_verify,callback:function(t){e.$set(e.formData,"origin_verify",t)},expression:"formData.origin_verify"}},[o("van-button",{staticStyle:{border:"none","font-size":"0.28rem"},attrs:{slot:"button",loading:e.sendMsgLoading,size:"small",plain:"",type:"info",disabled:e.sended},on:{click:e.sendMsg},slot:"button"},[e._v("\n "+e._s(e.sendMsgText)+"\n ")])],1),e._v(" "),o("van-field",{directives:[{name:"show",rawName:"v-show",value:2==e.setp,expression:"setp == 2"}],attrs:{label:"新手机号",type:"digit",maxlength:13,placeholder:"请输入手机号"},model:{value:e.formData.tel,callback:function(t){e.$set(e.formData,"tel",t)},expression:"formData.tel"}}),e._v(" "),o("van-field",{directives:[{name:"show",rawName:"v-show",value:2==e.setp,expression:"setp == 2"}],staticClass:"message_code",attrs:{center:"",clearable:"",label:"验证码",maxlength:6,placeholder:"请输入短信验证码","error-message":e.code_error},model:{value:e.formData.verify,callback:function(t){e.$set(e.formData,"verify",t)},expression:"formData.verify"}},[o("van-button",{attrs:{slot:"button",loading:e.sendMsgLoading,size:"small",type:"info",disabled:e.sended},on:{click:e.sendMsg},slot:"button"},[e._v(e._s(e.sendMsgText))])],1)],1)],1),e._v(" "),o("div",{staticStyle:{padding:"0 0.32rem 0.2rem"}},[o("van-button",{directives:[{name:"show",rawName:"v-show",value:1==e.setp,expression:"setp == 1"}],attrs:{loading:e.reg_loading,size:"large",type:"info"},on:{click:e.nextReg}},[e._v("下一步")]),e._v(" "),o("van-button",{directives:[{name:"show",rawName:"v-show",value:2==e.setp,expression:"setp == 2"}],attrs:{loading:e.reg_loading,size:"large",type:"info"},on:{click:e.sendReg}},[e._v("确定更换")])],1)])])],1)],1)},staticRenderFns:[]};var i=o("VU/8")(a,s,!1,function(e){o("t8uz")},"data-v-7fab3b12",null);t.default=i.exports},t8uz:function(e,t){}});
|