133.e39494a7e9d04cc9aaff.1706754571694+.js 4.5 KB

1
  1. webpackJsonp([133],{L8CE:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={name:"bind_weixin",filters:{mobile:function(e){return""==e?e:e.replace(e.substring(3,7),"****")}},data:function(){return{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(),setp:1,countdown:90,sended:!1,sendMsgText:"获取验证码",sendMsgLoading:!1,formData:{username:"",password:"",password_check:"",code:"",aff_code:"",user_name:"",mobile:""}}},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.$store.dispatch("check_code",{mobile:e.formData.username,captcha:e.formData.code}).then(function(t){e.next_loading=!1,1==t.code?(e.setp++,e.sendReg()):e.$notify({message:t.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;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(!this.checkMobile(e.formData.mobile))return e.$toast("请输入正确的手机号"),!1;if(""==e.formData.code)return e.$toast("请输入验证码!"),!1;e.reg_loading=!0;var t=localStorage.getItem("bind_token_weixin");this.$axiosUser("post","/api/pro/login/sms",{bind_token:t,tel:e.formData.mobile,verify:e.formData.code,type:4}).then(function(t){e.reg_loading=!1,1==t.data.code?(e.$toast(t.data.msg),localStorage.setItem("a-token-temp",t.data.data.token),t.data.data.account_site.length>0?e.$router.push({name:"login_company_list"}):e.$router.push({name:"create_company"})):e.$toast(t.data.msg)})},checkMobile:function(e){return!!/^1\d{10}$/.test(e)},sendMsg:function(){var e=this;if(!this.checkMobile(e.formData.mobile))return e.$toast("请输入正确的手机号"),!1;e.sendMsgLoading=!0,this.$axiosUser("post","/api/pro/send/login_sms",{mobile:e.formData.mobile}).then(function(t){1==t.data.code?(e.sended=!0,e.sendMsgLoading=!1,e.countDownInit(),e.$toast("已经发送,请注意查收!")):(e.sendMsgLoading=!1,e.$toast(t.data.msg))})}}},a={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",{staticStyle:{height:"0.2rem"}}),e._v(" "),o("div",{staticClass:"login-form-box",staticStyle:{"background-color":"#fff"}},[o("div",{staticClass:"setp1"},[o("van-cell-group",[o("van-field",{attrs:{placeholder:"请输入手机号"},model:{value:e.formData.mobile,callback:function(t){e.$set(e.formData,"mobile",t)},expression:"formData.mobile"}}),e._v(" "),o("van-field",{attrs:{center:"",clearable:"",placeholder:"请输入短信验证码","error-message":e.code_error},model:{value:e.formData.code,callback:function(t){e.$set(e.formData,"code",t)},expression:"formData.code"}},[o("van-button",{staticStyle:{border:"none","font-size":"0.28rem",color:"#26A2FF!important"},attrs:{slot:"button",loading:e.sendMsgLoading,size:"small",plain:"",type:"primary",disabled:e.sended},on:{click:e.sendMsg},slot:"button"},[e._v("\n "+e._s(e.sendMsgText)+"\n ")])],1)],1)],1),e._v(" "),o("div",{staticStyle:{padding:"0 0.32rem"}},[o("van-button",{attrs:{loading:e.reg_loading,size:"large",type:"info"},on:{click:e.sendReg}},[e._v("确 定")])],1)])])],1)],1)},staticRenderFns:[]};var s=o("VU/8")(n,a,!1,function(e){o("Q5nb")},"data-v-46f16eff",null);t.default=s.exports},Q5nb:function(e,t){}});