feat: login

This commit is contained in:
魔力叉烧包
2025-06-08 22:57:23 +08:00
parent 082c5483c5
commit 5acc25c8c9
9 changed files with 190 additions and 36 deletions

View File

@ -0,0 +1,66 @@
import { Button } from '@tarojs/components';
import { Popup } from '@taroify/core';
import { useCallback } from 'react';
import { BindPhoneStatus } from '@/components/login-button';
import PhoneButton from '@/components/phone-button';
import { ProtocolPrivacy } from '@/components/protocol-privacy';
import SafeBottomPadding from '@/components/safe-bottom-padding';
import './index.less';
interface IProps {
open: boolean;
onCancel: () => void;
onConfirm: () => void;
needPhone?: boolean;
}
const PREFIX = 'agreement-popup';
export function AgreementPopup({ open, onCancel, onConfirm, needPhone }: IProps) {
const handleBindPhone = useCallback(
status => {
if (status === BindPhoneStatus.Success) {
onConfirm();
} else {
onCancel();
}
},
[onCancel, onConfirm]
);
if (!open) {
return null;
}
return (
<Popup rounded className={PREFIX} placement="bottom" open={open} onClose={onCancel}>
<div className={`${PREFIX}__content`}>
<div className={`${PREFIX}__title`}></div>
<div className={`${PREFIX}__body`}>
<div></div>
<div>使</div>
</div>
<ProtocolPrivacy divider />
<div className={`${PREFIX}__btn-group`}>
<Button className={`${PREFIX}__cancel-button`} onClick={onCancel}>
</Button>
{needPhone ? (
<PhoneButton className={`${PREFIX}__confirm-button`} needPhone onBindPhone={handleBindPhone}>
</PhoneButton>
) : (
<Button className={`${PREFIX}__confirm-button`} onClick={onConfirm}>
</Button>
)}
</div>
</div>
<SafeBottomPadding />
</Popup>
);
}