From 80c0d719219e259cef6e0129f37296c017ea986d Mon Sep 17 00:00:00 2001 From: chashaobao Date: Sun, 15 Jun 2025 01:09:30 +0800 Subject: [PATCH] feat: login whatever --- src/components/agreement-popup/index.tsx | 1 - src/components/login-button/index.tsx | 9 ++++++--- src/components/login-dialog/index.tsx | 16 +++++++++++++--- src/components/partner-banner/index.tsx | 4 +++- src/components/partner-entry/index.tsx | 4 +++- src/fragments/profile/intention/index.tsx | 2 +- 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/components/agreement-popup/index.tsx b/src/components/agreement-popup/index.tsx index acf98c3..1cb9c7c 100644 --- a/src/components/agreement-popup/index.tsx +++ b/src/components/agreement-popup/index.tsx @@ -8,7 +8,6 @@ import PhoneButton from '@/components/phone-button'; import { ProtocolPrivacy } from '@/components/protocol-privacy'; import SafeBottomPadding from '@/components/safe-bottom-padding'; - import './index.less'; interface IProps { diff --git a/src/components/login-button/index.tsx b/src/components/login-button/index.tsx index 33aa42f..7145561 100644 --- a/src/components/login-button/index.tsx +++ b/src/components/login-button/index.tsx @@ -5,7 +5,7 @@ import { useCallback, useState } from 'react'; import LoginDialog from '@/components/login-dialog'; import useUserInfo from '@/hooks/use-user-info'; -import { isNeedLogin } from '@/utils/user'; +import { getAgreementSigned, isNeedLogin } from '@/utils/user'; import './index.less'; @@ -26,6 +26,7 @@ function LoginButton(props: ILoginButtonProps) { const userInfo = useUserInfo(); const [visible, setVisible] = useState(false); const needLogin = isNeedLogin(userInfo); + const needSign = !getAgreementSigned(); const onSuccess = useCallback( e => { @@ -40,11 +41,13 @@ function LoginButton(props: ILoginButtonProps) { - {visible && setVisible(false)} onSuccess={onSuccess} needPhone={needPhone} />} + {visible && ( + setVisible(false)} onSuccess={onSuccess} needPhone={needPhone} /> + )} ); } diff --git a/src/components/login-dialog/index.tsx b/src/components/login-dialog/index.tsx index 3e4b26c..8a65571 100644 --- a/src/components/login-dialog/index.tsx +++ b/src/components/login-dialog/index.tsx @@ -12,6 +12,7 @@ import './index.less'; interface IProps { title?: string; onCancel: () => void; + disableCheck?: boolean; needPhone?: IPhoneButtonProps['needPhone']; onSuccess?: IPhoneButtonProps['onSuccess']; onBindPhone?: IPhoneButtonProps['onBindPhone']; @@ -20,8 +21,15 @@ interface IProps { const PREFIX = 'login-dialog'; export default function LoginDialog(props: IProps) { - const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props; - const [checked, setChecked] = useState(false); + const { + title = '使用播络服务前,请先登录', + disableCheck = false, + needPhone, + onSuccess, + onCancel, + onBindPhone, + } = props; + const [checked, setChecked] = useState(disableCheck); const handleTipCheck = useCallback(() => { Toast.info('请先阅读并同意协议'); @@ -50,7 +58,9 @@ export default function LoginDialog(props: IProps) { - + {!disableCheck && ( + + )} diff --git a/src/components/partner-banner/index.tsx b/src/components/partner-banner/index.tsx index 920c2fe..2109357 100644 --- a/src/components/partner-banner/index.tsx +++ b/src/components/partner-banner/index.tsx @@ -60,7 +60,9 @@ export default function PartnerBanner() { )}
- {visible && setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />} + {visible && ( + setVisible(false)} onSuccess={handleBind} needPhone={needPhone} /> + )} ); } diff --git a/src/components/partner-entry/index.tsx b/src/components/partner-entry/index.tsx index 9413d16..e741bfc 100644 --- a/src/components/partner-entry/index.tsx +++ b/src/components/partner-entry/index.tsx @@ -39,7 +39,9 @@ function JoinEntry({ onBindSuccess }: JoinEntryProps) { )} - {visible && setVisible(false)} onSuccess={onBindSuccess} needPhone={needPhone} />} + {visible && ( + setVisible(false)} onSuccess={onBindSuccess} needPhone={needPhone} /> + )} ); } diff --git a/src/fragments/profile/intention/index.tsx b/src/fragments/profile/intention/index.tsx index 3e21d98..fbcc909 100644 --- a/src/fragments/profile/intention/index.tsx +++ b/src/fragments/profile/intention/index.tsx @@ -62,7 +62,7 @@ const getSalaryPrice = (fullSalary?: SalaryRange, partSalary?: SalaryRange) => { function ProfileIntentionFragment(props: IProps, ref) { const { profile } = props; - const [cityCodes, setCityCodes] = useState(calcInitCityCodes(profile.cityCodes)); + const [cityCodes, setCityCodes] = useState(calcInitCityCodes(profile.cityCodes || '')); const [employType, setEmployType] = useState(profile.employType); const [fullSalary, setFullSalary] = useState(calcSalarySelect(profile, true)); const [partSalary, setPartSalary] = useState(calcSalarySelect(profile, false));