require("../../@babel/runtime/helpers/Arrayincludes"),(wx.webpackJsonp=wx.webpackJsonp||[]).push([[8734],{2312:function(e,n,a){var t=a(4160),r=a(4107),s=a(5652),c=a(2555),i=a(4269),o=a(2573),u=a.n(o),l=a(3847),A=a(4017),g=a(3816),d=a(7422),f=a(3523),h=a(6516),p=a(4911),v=a(3260),b=a(6070),m=A.A.is,w=function(){var e="";switch(m){case"wx":e="微信授权登录";break;case"swan":e="百度授权登录";break;case"tt":e="头条授权登录";break;default:e=""}return e},k=function(){var e=(0,o.useRouter)().params,n="",a=!1,t=!1,k=function(){var e=(0,c.A)((0,s.A)().m((function e(n){var a;return(0,s.A)().w((function(e){for(;;)switch(e.n){case 0:if("getUserInfo:ok"!==(a=n.detail).errMsg){e.n=2;break}return e.n=1,x();case 1:e.n=3;break;case 2:a.errMsg,h.A.show("授权失败");case 3:d.A.sendClickEvent("".concat(d.A.spmA,".login.main.dlogin"),{clicktitle:"授权登录",err:a.errMsg});case 4:return e.a(2)}}),e)})));return function(n){return e.apply(this,arguments)}}(),x=function(){var e=(0,c.A)((0,s.A)().m((function e(){return(0,s.A)().w((function(e){for(;;)switch(e.n){case 0:if(t=!0,g.A.setAuthResult({success:t}),!a){e.n=2;break}return e.n=1,T();case 1:e.n=3;break;case 2:A.A.navigateBack();case 3:return e.a(2)}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=(0,c.A)((0,s.A)().m((function e(){var t,r,c,i,o,d,v,b,m,w,k,x;return(0,s.A)().w((function(e){for(;;)switch(e.n){case 0:return l.A.show("登录中..."),e.n=1,g.A.isLogin();case 1:if(t=e.v){e.n=3;break}return e.n=2,g.A.login();case 2:r=e.v,c=r.success,t=c;case 3:if(l.A.hide(),t){e.n=4;break}return h.A.show("登录失败请重试"),u().navigateBack(),e.a(2);case 4:if(!a){e.n=9;break}if((n||"").startsWith("http")){e.n=5;break}return p.A.navTo(n,{},{navigateType:"redirectTo"}),e.a(2);case 5:for(i=getCurrentPages(),o=i.length,d=null,v=o-1;v>=0;v--)v>=o-2&&((b=i[v]).route=b.route||b.__route__,"pages/webview/index"===b.route&&(d=b));if(!d){e.n=7;break}return m=f.A.getWeappParamsUrl(n),e.n=6,g.A.getH5LoginUrl(m);case 6:w=e.v,l.A.hide(),t&&w?u().setStorageSync("redirectUrl",w):h.A.show("加载失败，请重试~"),u().navigateBack(),e.n=8;break;case 7:x=null===(k=n)||void 0===k?void 0:k.includes("scene_source=wxmini_tab_webview"),p.A.navTo(n,{},{needLogin:!0,navigateType:x?"switchTab":"redirectTo",switchTabPath:x?"pages/ticket-wallet/index":""});case 8:e.n=10;break;case 9:A.A.navigateBack();case 10:return e.a(2)}}),e)})));return function(){return e.apply(this,arguments)}}(),F=function(){var e=(0,c.A)((0,s.A)().m((function e(){return(0,s.A)().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,g.A.hasAuthed();case 1:(t=e.v)?a?T():A.A.navigateBack():l.A.hide();case 2:return e.a(2)}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,o.useReady)((0,c.A)((0,s.A)().m((function t(){var c,i,o;return(0,s.A)().w((function(t){for(;;)switch(t.n){case 0:try{(c=u().getStorageSync(v.A))&&(i=JSON.parse(c)||{},u().setStorageSync(v.A,(0,r.A)((0,r.A)({},i),{},{h5LoginFlag:!1})))}catch(e){}return l.A.hide(),g.A.setWebviewLoginValid(!1),(o=e.returnUrl)&&(o=decodeURIComponent(o),o=f.A.getOriginUrl(o)),(n=o)&&(a=!0),t.n=1,F();case 1:d.A.sendPageEvent("".concat(d.A.spmA,".login.0.0"),"登录页",e);case 2:return t.a(2)}}),t)})))),(0,o.useDidHide)((function(){l.A.hide()})),(0,o.useUnload)((function(){t||g.A.setAuthResult({success:t})})),(0,b.jsxs)(i.Ss,{className:"container",children:[(0,b.jsx)(i._V,{className:"background",src:"https://gw.alicdn.com/tfs/TB17M2gphTpK1RjSZFGXXcHqFXa-750-1334.png",lazyLoad:!0}),(0,b.jsxs)(i.Ss,{className:"content",children:[(0,b.jsx)(i._V,{className:"logo",src:"https://gw.alicdn.com/tfs/TB1x0fdQrvpK1RjSZFqXXcXUVXa-582-192.png"}),"wx"===m?(0,b.jsx)(i.$n,{className:"login-button",openType:"getUserInfo",onGetUserInfo:k,children:w()}):null,(0,b.jsx)(i.EY,{className:"tips",children:"若未绑定大麦账号, 需要绑定手机号"})]}),(0,b.jsxs)(i.Ss,{className:"bottom",children:[(0,b.jsx)(i.Ss,{className:"about",onTap:function(){d.A.sendClickEvent("".concat(d.A.spmA,".login.bottom.daboutdamai"),{clicktitle:"关于大麦"}),A.A.navigateToMiniProgram({appId:"wx5abcf700e248b745",envVersion:"release"})},children:"关于大麦"}),(0,b.jsx)(i.Ss,{className:"phone",onTap:function(){d.A.sendClickEvent("".concat(d.A.spmA,".login.bottom.dcustomer_service"),{clicktitle:"客服电话"}),A.A.makePhoneCall({phoneNumber:"1010-3721"})},children:"客服电话：1010-3721"})]})]})};Page((0,t.eU)(k,"pages/login/index",{root:{cn:[]}},{enablePullDownRefresh:!1,navigationBarTitleText:"",backgroundColor:"#FFFFFF",navigationBarBackgroundColor:"#FFFFFF",usingComponents:{},spmB:"login"}||{}))}},function(e){e.O(0,[6907,8096,2076],(function(){return n=2312,e(e.s=n);var n})),e.O()}]);