feat: 分享的文案 + 点击头像看模卡 + 提现文案 + 协议弹窗 + 进群限制

This commit is contained in:
chashaobao
2025-06-17 00:03:58 +08:00
parent 828497fcd6
commit 0ec366cc2e
14 changed files with 140 additions and 100 deletions

View File

@ -1,18 +1,12 @@
import { Button } from '@tarojs/components';
import { Dialog } from '@taroify/core';
import { useCallback, useState } from 'react';
import PhoneButton, { IPhoneButtonProps } from '@/components/phone-button';
import { ProtocolPrivacyCheckbox } from '@/components/protocol-privacy';
import Toast from '@/utils/toast';
import './index.less';
interface IProps {
title?: string;
onCancel: () => void;
disableCheck?: boolean;
needPhone?: IPhoneButtonProps['needPhone'];
onSuccess?: IPhoneButtonProps['onSuccess'];
onBindPhone?: IPhoneButtonProps['onBindPhone'];
@ -21,46 +15,21 @@ interface IProps {
const PREFIX = 'login-dialog';
export default function LoginDialog(props: IProps) {
const {
title = '使用播络服务前,请先登录',
disableCheck = false,
needPhone,
onSuccess,
onCancel,
onBindPhone,
} = props;
const [checked, setChecked] = useState(disableCheck);
const handleTipCheck = useCallback(() => {
Toast.info('请先阅读并同意协议');
}, []);
const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props;
return (
<Dialog open onClose={onCancel}>
<Dialog.Content>
<div className={`${PREFIX}__container`}>
<div className={`${PREFIX}__title`}>{title}</div>
{!checked && (
<Button className={`${PREFIX}__confirm-button`} onClick={handleTipCheck}>
</Button>
)}
{checked && (
<PhoneButton
className={`${PREFIX}__confirm-button`}
onSuccess={onSuccess}
onBindPhone={onBindPhone}
needPhone={needPhone}
>
</PhoneButton>
)}
<Button className={`${PREFIX}__cancel-button`} onClick={onCancel}>
</Button>
{!disableCheck && (
<ProtocolPrivacyCheckbox checked={checked} onChange={setChecked} className={`${PREFIX}__checkbox`} />
)}
<PhoneButton
className={`${PREFIX}__confirm-button`}
onSuccess={onSuccess}
onBindPhone={onBindPhone}
needPhone={needPhone}
>
</PhoneButton>
</div>
</Dialog.Content>
</Dialog>