1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3604deee"],{"044a":function(t,e,o){"use strict";o("5902")},"0a22":function(t,e,o){"use strict";o.r(e);var i,n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"page"},[i("div",{staticClass:"login-box"},[i("div",{staticClass:"login-item"},[i("van-field",{staticStyle:{flex:"1"},attrs:{placeholder:"请输入手机号","error-message":t.errorMsg},on:{input:t.checkPhone},model:{value:t.form.phone,callback:function(e){t.$set(t.form,"phone",e)},expression:"form.phone"}}),i("button",{class:60!==t.time||t.uloading?"qrBtn btn-disabled":"qrBtn",on:{click:t.getCode}},[t._v(" "+t._s(t.codeMsg)+" ")])],1),i("div",{staticClass:"login-item"},[i("van-field",{attrs:{placeholder:"请输入验证码"},model:{value:t.form.code,callback:function(e){t.$set(t.form,"code",e)},expression:"form.code"}})],1),i("div",{staticClass:"mt80"},[i("van-button",{staticStyle:{width:"100%"},attrs:{type:"info",round:"",loading:t.loading,disabled:t.isLogin},on:{click:t.login}},[t._v(" 登录")])],1)]),i("van-popup",{model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[i("div",{staticClass:"vanPopupContent"},[i("img",{attrs:{src:o("8377"),alt:"图片",width:"100%"}}),i("div",{staticClass:"vanPopupMsg"},[i("span",{staticClass:"msg-one"},[t._v("亲爱的张三")]),i("span",{staticClass:"msg-two"},[t._v("未查询到您开通志远装饰系统,")]),i("span",{staticClass:"msg-two"},[t._v("点击[联系客服],开通志远装饰账号")]),i("div",{staticClass:"justify-end"},[i("button",{staticClass:"linkBtn"},[t._v("联系客服")])])])])])],1)},a=[],s=(o("e7e5"),o("d399")),c=o("5530"),d=o("ade3"),r=(o("66b9"),o("b650")),l=(o("be7f"),o("565f")),u=(o("8a58"),o("e41f")),h=(o("b0c0"),o("ac1f"),o("1276"),o("d3b7"),o("159b"),o("00b4"),o("081b")),f=o("2f62"),p={components:(i={},Object(d["a"])(i,u["a"].name,u["a"]),Object(d["a"])(i,l["a"].name,l["a"]),Object(d["a"])(i,r["a"].name,r["a"]),i),data:function(){return{loading:!1,uloading:!1,show:!1,errorMsg:"",type:"",codeMsg:"获取验证码",timer:null,time:60,form:{phone:"",code:"",company_id:"",wx_uid:""}}},computed:Object(c["a"])(Object(c["a"])({},Object(f["c"])({wx_uid:function(t){return t.wx_uid},token:function(t){return t.token},ticket:function(t){return t.ticket},fullPath:function(t){return t.fullPath},company_id:function(t){return t.company_id}})),{},{isLogin:function(){return!(this.form.phone&&this.isPhoneNum(this.form.phone)&&this.form.code&&!this.loading)}}),mounted:function(){var t=this,e=this.handleUrlParams();this.type=this.$route.query.type,this.$nextTick((function(){e.code&&!t.type?t.getUserByCode(e):t.token||t.type||t.$router.push({path:"/loading?ticket=".concat(t.ticket)})}))},methods:Object(c["a"])(Object(c["a"])({},Object(f["b"])(["setToken","setTicket","setclientype","setpersonObj","setFullPath","setUserInfo","setWXUid"])),{},{getUserByCode:function(t){var e=this;h["n"]({code:t.code,ticket:this.ticket}).then((function(t){0==t.data.code?(e.setToken(t.data.token),e.setclientype(t.data.company_data.client_type),e.setpersonObj(t.data.user),e.setUserInfo(t.data),e.fullPath?(window.location.href=window.location.origin+window.location.pathname+"#"+e.fullPath,e.setFullPath("")):window.location.href=window.location.origin+window.location.pathname+"#/Mine?ticket=".concat(e.ticket)):2==t.data.code?(e.form.wx_uid=t.data.data.wx_uid,e.form.company_id=t.data.data.company_id,e.setWXUid(e.form.wx_uid)):3==t.data.code?(e.form.wx_uid=t.data.data.wx_uid,e.setWXUid(e.form.wx_uid),e.$router.push({path:"/selectCompany?type=1"})):-1==t.data.code&&e.$toast(t.data.msg)}))},handleUrlParams:function(){var t={};if(-1!=location.href.indexOf("?")){var e=location.href.split("?")[1].split("#")[0],o=e.split("&");o.forEach((function(e){t[e.split("=")[0]]=e.split("=")[1]}))}return t},isPhoneNum:function(t){var e=/^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;return!!e.test(t)},checkPhone:function(){this.form.phone&&!this.isPhoneNum(this.form.phone)?this.errorMsg="手机号格式不对!":this.errorMsg=""},getCode:function(){var t=this;60===this.time&&this.isPhoneNum(this.form.phone)&&!this.uloading?(this.uloading=!0,h["m"]({phone:this.form.phone}).then((function(e){if(1==e.data.code)return t.uloading=!1,void(t.show=!0);t.time--,t.uloading=!1,t.timer=setInterval((function(){t.time--,t.time<=0?(clearInterval(t.timer),t.time=60,t.codeMsg="获取验证码"):t.codeMsg=t.time+"s"}),1e3)})).catch((function(e){t.uloading=!1,console.log("错误信息: "+e)}))):60==this.time&&Object(s["a"])({message:"请输入手机号"})},login:function(){var t=this;this.loading=!0,h["r"]({phone:this.form.phone,vercode:this.form.code,wx_uid:this.form.wx_uid||this.wx_uid,ticket:this.ticket,company_id:this.company_id||this.form.company_id}).then((function(e){t.loading=!1,0==e.data.code?(Object(s["a"])({message:"登录成功"}),t.setToken(e.data.token),t.setclientype(e.data.company_data.client_type),t.setpersonObj(e.data.user),t.setUserInfo(e.data),t.fullPath?(window.location.href=window.location.origin+window.location.pathname+"#"+t.fullPath,t.setFullPath("")):window.location.href=window.location.origin+window.location.pathname+"#/Mine?ticket=".concat(t.ticket)):2==e.data.code&&(t.setTicket(e.data.data),t.$router.push({path:"/bindCompany?ticket=".concat(t.ticket)}))})).catch((function(e){t.loading=!1}))}})},m=p,g=(o("044a"),o("2877")),w=Object(g["a"])(m,n,a,!1,null,"22946d4f",null);e["default"]=w.exports},5902:function(t,e,o){},"66b9":function(t,e,o){"use strict";o("68ef"),o("9d70"),o("3743"),o("e3b3"),o("bc1b")},8377:function(t,e,o){t.exports=o.p+"img/login-header.50c8338f.png"}}]);
|