chunk-24ac3deb.53c25bb0.js 7.0 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-24ac3deb"],{"14d9":function(e,t,n){"use strict";var o=n("23e7"),i=n("7b0b"),r=n("07fa"),s=n("3a34"),a=n("3511"),c=n("d039"),d=c((function(){return 4294967297!==[].push.call({length:4294967296},1)})),l=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},u=d||!l();o({target:"Array",proto:!0,arity:1,forced:u},{push:function(e){var t=i(this),n=r(t),o=arguments.length;a(n+o);for(var c=0;c<o;c++)t[n]=arguments[c],n++;return s(t,n),n}})},3511:function(e,t,n){"use strict";var o=TypeError,i=9007199254740991;e.exports=function(e){if(e>i)throw o("Maximum allowed index exceeded");return e}},"3a34":function(e,t,n){"use strict";var o=n("83ab"),i=n("e8b5"),r=TypeError,s=Object.getOwnPropertyDescriptor,a=o&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!s(e,"length").writable)throw new r("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},"454b":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pt-28 p-4"},[t("div",{staticClass:"text-center"},[t("van-image",{attrs:{width:"6rem",height:"6rem",src:this.$settings.logo}}),t("p",{staticClass:"mt-5 mb-12 text-2xl"},[e._v("志远售后平台")])],1),e.showLoginType?t("div",{staticClass:"text-center"},[t("van-button",{attrs:{type:"primary",size:"large",round:"",block:"","icon-prefix":"my-icon",icon:"weixin"},on:{click:e.weixinLogin}},[e._v("微信授权登录")])],1):e._e(),e.showLoginType?e._e():t("van-form",{on:{submit:e.onSubmit}},[t("van-field",{attrs:{clearable:"",label:"手机号",placeholder:"请输入手机号",type:"tel",rules:[{required:!0}]},on:{input:e.changePhone},model:{value:e.loginForm.phone,callback:function(t){e.$set(e.loginForm,"phone",t)},expression:"loginForm.phone"}}),t("van-field",{attrs:{clearable:"",type:"digit",label:"短信验证码",placeholder:"请输入短信验证码",rules:[{required:!0}]},scopedSlots:e._u([{key:"button",fn:function(){return[t("van-button",{attrs:{disabled:e.sendDisabled,loading:e.sendLoading,size:"small",type:"primary"},on:{click:e.handSendVerifyCode}},[t("van-count-down",{directives:[{name:"show",rawName:"v-show",value:e.showCountDown,expression:"showCountDown"}],ref:"countDown",staticClass:"text-white",attrs:{time:e.countDownTime,format:"ss秒","auto-start":!1},on:{finish:e.countDownFinish}}),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.showCountDown,expression:"!showCountDown"}]},[e._v("发送验证码")])],1)]},proxy:!0}],null,!1,1905796647),model:{value:e.loginForm.code,callback:function(t){e.$set(e.loginForm,"code",t)},expression:"loginForm.code"}}),t("div",{staticClass:"mt-8"},[t("van-button",{attrs:{loading:e.loginLoading,disabled:e.disabled,block:"",type:"info","loading-text":"加载中...","native-type":"submit"}},[e._v(e._s(e.btnText))])],1),2==e.loginForm.login_type?t("div",[t("van-divider",{style:{borderColor:"#4B5563",paddingTop:"20px"},attrs:{"content-position":"center"}},[e._v("其它登录方式")]),t("van-icon",{staticClass:"w-full text-center inline-block",attrs:{"class-prefix":"my-icon",name:"weixin",color:"#07c160",size:"2.5rem"},on:{click:e.weixinLogin}})],1):e._e()],1)],1)},i=[],r=(n("d401"),n("14d9"),n("13d5"),n("b64b"),n("d3b7"),n("4d63"),n("c607"),n("ac1f"),n("2c3e"),n("25f0"),n("5319"),n("99af"),n("1836")),s=n("2687");function a(e,t){return Object(r["a"])({url:s["a"].weixin+"user_info/".concat(e,"?code=").concat(t),method:"get"})}var c="Customer-Storage",d={get:function(e){var t=window.localStorage.getItem(c+"_"+e);return t?window.JSON.parse(t):""},set:function(e,t){window.localStorage.setItem(c+"_"+e,window.JSON.stringify(t))},del:function(e,t){window.localStorage.removeItem(c+"_"+e)}};function l(e){return Object(r["a"])({url:s["a"].customer+"send_verify_code",method:"post",data:e})}var u=n("eaf8"),h={data:function(){return{btnText:"登录",sendDisabled:!0,showCountDown:!1,disabled:!1,wxID:1,code:"",loginLoading:!1,sendLoading:!1,showLoginType:!0,countDownTime:6e4,loginForm:{phone:"",code:"",openid:"",nickname:"",sex:0,headimgurl:"",login_type:1}}},watch:{$route:{handler:function(e){var t=e.query;console.log(e.query),t&&(this.redirect=t.redirect,this.otherQuery=this.getOtherQuery(t))},immediate:!0}},created:function(){var e=this.getUrlKey("code");if(null!=e&&""!==e)return d.set("weixin_code",e),void(window.location.href=d.get("href"));this.code=d.get("weixin_code"),1===this.loginForm.login_type&&null!=this.code&&""!==this.code?this.fetchUserInfo():this.btnText="登录"},mounted:function(){d.set("href",window.location.href)},methods:{countDownFinish:function(){this.showCountDown=!1,this.sendDisabled=!1},changePhone:function(){""===this.loginForm.phone?this.sendDisabled=!0:this.sendDisabled=!1},handSendVerifyCode:function(){var e=this;this.sendDisabled=!0,this.showCountDown=!0;var t=Object(u["a"])(),n=this.$md5(this.$md5(this.loginForm.phone+t.toString()));l({phone:this.loginForm.phone,timestamp:t,signature:n}).then((function(t){e.$refs.countDown.reset(),e.$refs["countDown"].start(),e.disabled=!1,e.showCountDown=!0})).catch((function(){e.showCountDown=!1,e.sendDisabled=!1}))},weixinLogin:function(){this.$router.push({path:this.redirect||"/",query:this.otherQuery})},phoneLogin:function(){if(Object(u["b"])())return this.weixinLogin();this.loginForm.login_type=2,this.showLoginType=!1},fetchUserInfo:function(){var e=this;this.disabled=!0,a(this.wxID,this.code).then((function(t){if(d.del("weixin_code"),e.loginForm.openid=t.data.openid,e.loginForm.nickname=t.data.nickname,e.loginForm.sex=t.data.sex,e.loginForm.headimgurl=t.data.headimgurl,t.data.is_exists)return e.onSubmit();e.showLoginType=!1,e.btnText="绑定微信并登录",e.disabled=!1})).catch((function(){d.del("weixin_code")}))},onSubmit:function(){var e=this;this.loginLoading=!0,this.$store.dispatch("user/login",this.loginForm).then((function(){e.$router.push({path:e.redirect||"/",query:e.otherQuery}),e.loginLoading=!1})).catch((function(){e.loginLoading=!1}))},getUrlKey:function(e){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(location.href)||[,""])[1].replace(/\+/g,"%20"))||null},getOtherQuery:function(e){return Object.keys(e).reduce((function(t,n){return"redirect"!==n&&(t[n]=e[n]),t}),{})}}},f=h,g=n("2877"),w=Object(g["a"])(f,o,i,!1,null,null,null);t["default"]=w.exports},"99af":function(e,t,n){"use strict";var o=n("23e7"),i=n("d039"),r=n("e8b5"),s=n("861d"),a=n("7b0b"),c=n("07fa"),d=n("3511"),l=n("8418"),u=n("65f0"),h=n("1dde"),f=n("b622"),g=n("2d00"),w=f("isConcatSpreadable"),p=g>=51||!i((function(){var e=[];return e[w]=!1,e.concat()[0]!==e})),m=function(e){if(!s(e))return!1;var t=e[w];return void 0!==t?!!t:r(e)},b=!p||!h("concat");o({target:"Array",proto:!0,arity:1,forced:b},{concat:function(e){var t,n,o,i,r,s=a(this),h=u(s,0),f=0;for(t=-1,o=arguments.length;t<o;t++)if(r=-1===t?s:arguments[t],m(r))for(i=c(r),d(f+i),n=0;n<i;n++,f++)n in r&&l(h,f,r[n]);else d(f+1),l(h,f++,r);return h.length=f,h}})}}]);