feat: search city & privacy checkbox remove

This commit is contained in:
eleanor.mao
2025-04-22 22:41:22 +08:00
parent 744928fab7
commit d3f8ae6fae
9 changed files with 375 additions and 29 deletions

View File

@ -16,6 +16,7 @@
&__confirm-button {
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
margin-top: 40px;
margin-bottom: 40px;
}
// &__cancel-button {
@ -31,8 +32,4 @@
// border-color: transparent
// }
// }
&__checkbox {
margin-top: 40px;
}
}

View File

@ -1,10 +1,8 @@
import { Button } from '@tarojs/components';
import { Dialog } from '@taroify/core';
import { useCallback, useState } from 'react';
import { ProtocolPrivacyCheckbox } from '@/components/protocol-privacy';
import Toast from '@/utils/toast';
import { ProtocolPrivacy } from '@/components/protocol-privacy';
import './index.less';
@ -18,28 +16,15 @@ const PREFIX = 'location-dialog';
export default function LocationDialog(props: IProps) {
const { open, onClick, onClose } = props;
const [checked, setChecked] = useState(false);
const handleTipCheck = useCallback(() => {
Toast.info('请先阅读并同意协议');
}, []);
return (
<Dialog open={open} onClose={onClose}>
<Dialog.Content>
<div className={`${PREFIX}__container`}>
<div className={`${PREFIX}__title`}>{`我们需要获取您的位置信息\n以便推荐附近的通告或主播`}</div>
{!checked && (
<Button className={`${PREFIX}__confirm-button`} onClick={handleTipCheck}>
</Button>
)}
{checked && (
<Button className={`${PREFIX}__confirm-button`} onClick={onClick}>
</Button>
)}
<ProtocolPrivacyCheckbox checked={checked} onChange={setChecked} className={`${PREFIX}__checkbox`} />
<Button className={`${PREFIX}__confirm-button`} onClick={onClick}>
</Button>
<ProtocolPrivacy />
</div>
</Dialog.Content>
</Dialog>