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

@ -4,7 +4,6 @@ import { Tabs } from '@taroify/core';
import { useCallback, useEffect, useRef, useState } from 'react';
import HomePage from '@/components/home-page';
import LocationDialog from '@/components/location-dialog';
import { LoginGuide } from '@/components/login-guide';
import MaterialGuide from '@/components/material-guide';
import { EventName, OpenSource, PageUrl } from '@/constants/app';
@ -82,13 +81,6 @@ export default function Job() {
}
}, []);
const handleCloseAuthorize = useCallback(() => setShowAuthorize(false), []);
const handleClickAuthorize = useCallback(() => {
requestLocation(true);
setShowAuthorize(false);
}, []);
useEffect(() => {
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
return () => {
@ -116,6 +108,7 @@ export default function Job() {
} else {
log('show authorize location dialog');
setShowAuthorize(true);
requestLocation(true);
}
});
@ -154,7 +147,6 @@ export default function Job() {
))}
</Tabs>
<div>
<LocationDialog open={showAuthorize} onClose={handleCloseAuthorize} onClick={handleClickAuthorize} />
<LoginGuide disabled={showAuthorize} onAfterBind={handleAfterBindPhone} />
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
</div>