2022-09-15 19:59:19 +08:00

1 line
6.9 KiB
JavaScript

"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[3],{8140:function(e,o,n){var _=n(9975),i=n(4165),c=n(1413),l=n(5861),r=n(885),d=n(1515),a={common_safe_area_y:"index-module__common_safe_area_y___WG0Zx","full-100":"index-module__full-100___VroVO","color-blue":"index-module__color-blue___SL25_","color-yellow":"index-module__color-yellow___vIjlN","color-green":"index-module__color-green___AXrYn","color-grey":"index-module__color-grey___kkCNC","color-white":"index-module__color-white___Utiga",divider:"index-module__divider___Aiv7G","divider-vertical":"index-module__divider-vertical___lWrav","divider-horizontal":"index-module__divider-horizontal___ON8jW","divider-text":"index-module__divider-text___MH66U","is-center":"index-module__is-center___nY8ha","is-left":"index-module__is-left___wlB1T","is-right":"index-module__is-right___AlAX6"},s=n(6408),t=n.n(s),u=n(5513),x=function Divider(e){var o=e.direction,n=void 0===o?"horizontal":o,_=e.borderStyle,i=void 0===_?"solid":_,c=e.contentPosition,l=void 0===c?"center":c,r=e.customClassName,s=void 0===r?"":r,x=t()(a.divider,a["divider-"+n],s),m=t()(a["divider-text"],a["is-"+l]),h="horizontal"===n?{borderTopStyle:i}:{borderLeftStyle:i};return(0,u.jsx)(d.G7,{className:x,style:h,children:e.children&&"vertical"!==n&&(0,u.jsx)(d.G7,{className:m,children:e.children})})},m=n(6666),h=n(9792),k="index-module__login___EqvJi",v="index-module__login-panel___EQuDb",b="index-module__login-title___dkk8O",f="index-module__input-bar___VMnKd",j="index-module__input-bar--account___X4zuk",g="index-module__input-bar--password___Gb5Q_",p="index-module__login-options___QEaXx",N="index-module__login-option___RbES2",Z="index-module__login-button___xuvF4",w="index-module__isForgetPwd___Mb3Qd",G="index-module__quick-login___TPdk0",y="index-module__quick-login--options___KSNBY",C="index-module__quick-login--divider___uC_UV",z="index-module__quick-login--iconCard___LFNc2",S=n(4942),I={common_safe_area_y:"index-module__common_safe_area_y___XX8GE","full-100":"index-module__full-100___RF5Ip","color-blue":"index-module__color-blue___ugBP0","color-yellow":"index-module__color-yellow___QU8FH","color-green":"index-module__color-green___f6loP","color-grey":"index-module__color-grey___TFwUE","color-white":"index-module__color-white___fVsN_",checkbox:"index-module__checkbox___TACBL","checkbox--text":"index-module__checkbox--text___jZ0c1",checkbox_main:"index-module__checkbox_main___UmU9Y","checkbox_main--normal":"index-module__checkbox_main--normal___RAO_W","checkbox_main--small":"index-module__checkbox_main--small___jupkE","checkbox_main--round":"index-module__checkbox_main--round___LNQN0","checkbox_main--circle":"index-module__checkbox_main--circle___J6dZj","checkbox_main--selected":"index-module__checkbox_main--selected___zxt27",checkbox_item:"index-module__checkbox_item___klx8o",no_checkbox_item:"index-module__no_checkbox_item___aT1GX",checkbox_item_select:"index-module__checkbox_item_select___m0dLJ"},E=(0,h.forwardRef)((function(e,o){var n=e.onSelect,_=e.onClose,i=e.status,c=void 0!==i&&i,l=e.disabled,a=void 0!==l&&l,s=e.circle,x=void 0!==s&&s,k=e.round,v=void 0===k||k,b=e.size,f=void 0===b?"normal":b,j=e.children,g=(0,h.useState)(!1),p=(0,r.Z)(g,2),N=p[0],Z=p[1],w=function onSelectEven(){if(a)return!1;var e=!N;e?null==n||n():null==_||_(),Z(e)};return(0,h.useImperativeHandle)(o,(function(){return{onSelectEven:w}})),(0,h.useEffect)((function(){Z(c)}),[c]),(0,u.jsxs)(d.G7,{className:I.checkbox,onClick:function onClick(){return w()},children:[(0,u.jsx)(d.G7,{className:t()(I.checkbox_main,function getMainClassName(){var e;return e={},(0,S.Z)(e,I["checkbox_main--selected"],N),(0,S.Z)(e,I["checkbox_main--".concat(f)],f),(0,S.Z)(e,I["checkbox_main--round"],v),(0,S.Z)(e,I["checkbox_main--circle"],x),e}()),children:(0,u.jsx)(d.G7,{className:t()(I.checkbox_item,function getClassName(){var e;return e={},(0,S.Z)(e,I.no_checkbox_item,a),(0,S.Z)(e,I.checkbox_item_select,N),e}()),children:N&&(0,u.jsx)(m.Z,{name:"icon-a-jizhumima",size:22,color:"#fff"})})}),j&&(0,u.jsx)(d.G7,{className:I["checkbox--text"],children:j})]})})),T=n(7594),P=n(8560),F=n(9771),L=n(2535),U=n.n(L),A=n(1115),B=n(3929),V=(0,h.memo)((function(){return(0,u.jsxs)(d.G7,{className:G,children:[(0,u.jsx)(x,{direction:"horizontal",customClassName:C,children:"或通过以下方式登录"}),(0,u.jsx)(d.G7,{className:y,children:(0,u.jsx)(P.Z,{iconName:"icon-weixindenglu",title:"微信登录",customClass:z})})]})})),X=function Login(){var e=(0,h.useState)(!1),o=(0,r.Z)(e,2),n=o[0],_=o[1],a=(0,h.useState)(!0),s=(0,r.Z)(a,2),t=s[0],G=s[1],y=(0,h.useState)(""),C=(0,r.Z)(y,2),z=C[0],S=C[1],I=(0,h.useState)(""),P=(0,r.Z)(I,2),L=P[0],X=P[1],q=function formatInput(e){return e.trim()},O=(0,B.Z)(),Q=O.setToken,J=O.setUserInfo,M=(0,F.Ig)().fetchData,R=function(){var e=(0,l.Z)((0,i.Z)().mark((function _callee(){var e;return(0,i.Z)().wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:if(""!==z&&""!==L){o.next=2;break}return o.abrupt("return",A.Z9.error("账号密码不能为空!"));case 2:return o.next=5,M({account:z,password:L});case 5:(e=o.sent).success?(A.Z9.success("登陆成功"),Q(e.data.token),J((0,c.Z)({},e.data)),U().redirectTo({url:"/pages/index/index"})):A.Z9.error("登陆失败");case 8:case"end":return o.stop()}}),_callee)})));return function handleLogin(){return e.apply(this,arguments)}}();return(0,u.jsxs)(d.G7,{className:k,children:[(0,u.jsx)(d.Ee,{className:"full-100",mode:"widthFix",src:"https://s1.ax1x.com/2022/09/08/vqiVZF.png"}),(0,u.jsxs)(d.G7,{className:v,children:[(0,u.jsxs)(d.G7,{className:b,children:[(0,u.jsx)(d.xv,{children:"您好,"}),(0,u.jsx)(d.xv,{children:"欢迎来到蜘蛛管家"})]}),(0,u.jsxs)(d.G7,{className:f,children:[(0,u.jsx)(m.Z,{name:"icon-yonghuming",size:48,color:"#999999"}),(0,u.jsx)(x,{direction:"vertical"}),(0,u.jsx)(d.II,{onInput:function handleInputAccount(e){var o=q(e.detail.value);S(o)},className:j,placeholder:"请输入用户名"})]}),(0,u.jsxs)(d.G7,{className:f,children:[(0,u.jsx)(m.Z,{name:"icon-mima",size:48,color:"#999999"}),(0,u.jsx)(x,{direction:"vertical"}),(0,u.jsx)(d.II,{onInput:function handleInputPassword(e){var o=q(e.detail.value);X(o)},password:t,className:g,type:"safe-password",placeholder:"请输入密码"}),(0,u.jsx)(d.G7,{onClick:function handlePwdVisible(){G((function(e){return!e}))},children:t?(0,u.jsx)(m.Z,{name:"icon-biyan",size:48,color:"#999999"}):(0,u.jsx)(m.Z,{name:"icon-yanjing",size:48,color:"#999999"})})]}),(0,u.jsxs)(d.G7,{className:p,children:[(0,u.jsx)(d.G7,{className:N,children:(0,u.jsx)(E,{status:n,size:"small",circle:!0,onSelect:function selectCallBack(){_(!0)},onClose:function closeCallBack(){_(!1)},children:"记住密码"})}),(0,u.jsx)(d.G7,{className:N,children:(0,u.jsx)(d.xv,{className:w,children:"忘记密码?"})})]}),(0,u.jsx)(T.Z,{circle:!0,plain:!0,onClick:R,customClassName:Z,children:"登录"}),(0,u.jsx)(V,{})]})]})};Page((0,_.createPageConfig)(X,"pages/login/index",{root:{cn:[]}},{navigationBarTitleText:"登录"}||{}))}},function(e){e.O(0,[107,216,592],(function(){return o=8140,e(e.s=o);var o}));e.O()}]);