feat: add checkbox
This commit is contained in:
parent
65eebfd16f
commit
87278c3d15
@ -16,7 +16,6 @@
|
|||||||
&__confirm-button {
|
&__confirm-button {
|
||||||
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
|
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
margin-bottom: 40px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// &__cancel-button {
|
// &__cancel-button {
|
||||||
@ -32,4 +31,8 @@
|
|||||||
// border-color: transparent
|
// border-color: transparent
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
&__checkbox {
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { Button } from '@tarojs/components';
|
import { Button } from '@tarojs/components';
|
||||||
|
|
||||||
import { Dialog } from '@taroify/core';
|
import { Dialog } from '@taroify/core';
|
||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { ProtocolPrivacy } from '@/components/protocol-privacy';
|
import { ProtocolPrivacyCheckbox } from '@/components/protocol-privacy';
|
||||||
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -16,15 +18,28 @@ const PREFIX = 'location-dialog';
|
|||||||
|
|
||||||
export default function LocationDialog(props: IProps) {
|
export default function LocationDialog(props: IProps) {
|
||||||
const { open, onClick, onClose } = props;
|
const { open, onClick, onClose } = props;
|
||||||
|
const [checked, setChecked] = useState(false);
|
||||||
|
|
||||||
|
const handleTipCheck = useCallback(() => {
|
||||||
|
Toast.info('请先阅读并同意协议');
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={onClose}>
|
<Dialog open={open} onClose={onClose}>
|
||||||
<Dialog.Content>
|
<Dialog.Content>
|
||||||
<div className={`${PREFIX}__container`}>
|
<div className={`${PREFIX}__container`}>
|
||||||
<div className={`${PREFIX}__title`}>{`我们需要获取您的位置信息\n以便推荐附近的通告或主播`}</div>
|
<div className={`${PREFIX}__title`}>{`我们需要获取您的位置信息\n以便推荐附近的通告或主播`}</div>
|
||||||
<Button className={`${PREFIX}__confirm-button`} onClick={onClick}>
|
{!checked && (
|
||||||
授权
|
<Button className={`${PREFIX}__confirm-button`} onClick={handleTipCheck}>
|
||||||
</Button>
|
授权
|
||||||
<ProtocolPrivacy />
|
</Button>
|
||||||
|
)}
|
||||||
|
{checked && (
|
||||||
|
<Button className={`${PREFIX}__confirm-button`} onClick={onClick}>
|
||||||
|
授权
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
<ProtocolPrivacyCheckbox checked={checked} onChange={setChecked} className={`${PREFIX}__checkbox`} />
|
||||||
</div>
|
</div>
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
Loading…
Reference in New Issue
Block a user