feat: login

This commit is contained in:
eleanor.mao
2025-05-22 18:08:31 +08:00
parent 8ebd3363b8
commit 6762973e14
9 changed files with 176 additions and 132 deletions

View File

@ -53,10 +53,17 @@ export interface SearchCityProps {
onSelectCity: (cityCode: string) => void;
currentCity?: string;
forGroup?: boolean;
banner?: string;
offset?: number;
}
export default function SearchCity({ onSelectCity, currentCity = '', forGroup = false, offset = 0 }: SearchCityProps) {
export default function SearchCity({
onSelectCity,
currentCity = '',
banner = '',
forGroup = false,
offset = 0,
}: SearchCityProps) {
const [winHeight, indexItemHeight] = useHeight();
const [touchAnchor, setTouchAnchor] = useState<string | undefined>();
const [touchMoving, setTouchMoving] = useState(false);
@ -134,13 +141,13 @@ export default function SearchCity({ onSelectCity, currentCity = '', forGroup =
<div className={PREFIX}>
<ScrollView scrollY style={{ height: winHeight - offset }} scrollIntoView={touchAnchor}>
<div className={`${PREFIX}__search-wrapper ${forGroup ? 'group' : ''}`}>
{forGroup && (
{forGroup && banner ? (
<div className={`${PREFIX}__banner`}>
<div className="dash"></div>
<div className="text"></div>
<div className="text">{banner}</div>
<div className="dash"></div>
</div>
)}
) : null}
<Search
className={`${PREFIX}__search`}
placeholder="输入城市名称"
@ -211,7 +218,7 @@ export default function SearchCity({ onSelectCity, currentCity = '', forGroup =
onTouchMove={handleTouchMove}
onTouchEnd={handleTouchEnd}
onTouchCancel={handleTouchEnd}
style={{ top: indexItemHeight * OFFSET_INDEX_SIZE + offset }}
style={{ top: indexItemHeight * OFFSET_INDEX_SIZE + (forGroup ? 72 : 0) }}
>
{CITY_LIST.map(item => {
return (