(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-user-qrcodeLogin"],{"251c":function(t,e,a){"use strict";a("6a54");var n=a("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,a("d4b5");n(a("c096"));var o=a("739a"),i=n(a("2389")),s={mixins:[i.default],data:function(){return{StatusBar:this.StatusBar,CustomBar:this.CustomBar,NavBar:this.StatusBar+this.CustomBar,AppStyle:this.$store.state.AppStyle,logo:"",token:"",appname:"",text:"",scanText:"",scanLoginUrl:"",timer:null,styleIndex:""}},onHide:function(){clearInterval(this.timer),this.timer=null},onShow:function(){o.localStorage.getItem("userinfo")?(this.userInfo=JSON.parse(o.localStorage.getItem("userinfo")),this.userInfo.style="background-image:url("+this.userInfo.avatar+");",this.group=this.userInfo.group):this.userInfo=null,o.localStorage.getItem("token")?this.token=o.localStorage.getItem("token"):this.token=""},onLoad:function(t){var e=this;t.text&&(e.text=t.text),e.styleIndex=e.$API.GetStyleIndex(),e.appname=e.$API.GetAppName(),e.logo=e.$API.GetLogo();var a=e.randomString(7)+(new Date).getTime();e.scanText=a,e.scanLoginUrl=e.$API.getScan()+"?codeContent="+a,e.timer=setInterval((function(){e.getScan()}),3e3)},methods:{back:function(){clearInterval(this.timer),this.timer=null,uni.navigateBack({delta:1})},getScan:function(){var t=this,e={codeContent:t.scanText};t.$Net.request({url:t.$API.getScanStatus(),data:e,header:{"Content-Type":"application/x-www-form-urlencoded"},method:"get",dataType:"json",success:function(e){if(1==e.data.code){uni.showToast({title:"扫码登录成功！",icon:"none"}),clearInterval(t.timer),t.timer=null,o.localStorage.setItem("userinfo",JSON.stringify(e.data.data)),o.localStorage.setItem("token",e.data.data.token);setTimeout((function(){var e=t.styleIndex;uni.redirectTo({url:"/pages/home/"+e}),clearTimeout("timer")}),1e3)}},fail:function(t){uni.showToast({title:"网络开小差了哦",icon:"none"})}})},randomString:function(t){t=t||32;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",a=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*a));return n}}};e.default=s},"42e1":function(t,e,a){var n=a("c86c");e=n(!1),e.push([t.i,"uni-page-body[data-v-501914ee]{background-color:#fff}body.?%PAGE?%[data-v-501914ee]{background-color:#fff}",""]),t.exports=e},"94a5":function(t,e,a){var n=a("42e1");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var o=a("967d").default;o("8c37c074",n,!0,{sourceMap:!1,shadowMode:!1})},"94c2":function(t,e,a){"use strict";var n=a("94a5"),o=a.n(n);o.a},a758:function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return o})),a.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"user",class:[t.isDark?"dark":"",t.$store.state.AppStyle],style:{"background-color":t.isDark?"#1c1c1c":"#f6f6f6","min-height":t.isDark?"100vh":"auto"}},[a("v-uni-view",{staticClass:"header",style:[{height:t.CustomBar+"px"}]},[a("v-uni-view",{staticClass:"cu-bar",class:t.isDark?"dark":"bg-white",style:{height:t.CustomBar+"px","padding-top":t.StatusBar+"px","background-color":t.isDark?"#1c1c1c":"#ffffff"}},[a("v-uni-view",{staticClass:"action",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.back.apply(void 0,arguments)}}},[a("v-uni-text",{staticClass:"cuIcon-back"})],1),a("v-uni-view",{staticClass:"content text-bold",style:[{top:t.StatusBar+"px"}]},[t._v("快捷扫码登录")]),a("v-uni-view",{staticClass:"action"})],1)],1),a("v-uni-view",{style:[{padding:t.NavBar+"px 10px 0px 10px"}]}),a("v-uni-view",{staticClass:"qrcodeLogin"},[a("v-uni-view",{staticClass:"qrcodeLogin-logo"},[a("v-uni-image",{attrs:{src:t.logo,mode:"widthFix"}})],1),a("v-uni-view",{staticClass:"qrcodeLogin-name"},[t._v("使用 "+t._s(t.appname)+" 扫码快捷登录")]),a("v-uni-view",{staticClass:"qrcodeLogin-code"},[a("v-uni-image",{attrs:{src:t.scanLoginUrl}})],1)],1)],1)},o=[]},ec67:function(t,e,a){"use strict";a.r(e);var n=a("a758"),o=a("fa55");for(var i in o)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return o[t]}))}(i);a("94c2");var s=a("828b"),r=Object(s["a"])(o["default"],n["b"],n["c"],!1,null,"501914ee",null,!1,n["a"],void 0);e["default"]=r.exports},fa55:function(t,e,a){"use strict";a.r(e);var n=a("251c"),o=a.n(n);for(var i in n)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return n[t]}))}(i);e["default"]=o.a}}]);