fix(mp): 医生端添加底部导航栏解决无法退出登录问题
医生端工作台是分包页面,不在 TabBar 配置中,redirectTo 后底部 导航消失导致无法到达"我的"页面退出登录。新增 DoctorTabBar 组件 模拟底部导航,包含工作台/患者/咨询/我的四个入口,使用 reLaunch 切换避免页栈溢出。
This commit is contained in:
@@ -11,6 +11,7 @@ import LoadingCard from '@/components/ui/LoadingCard';
|
||||
import ErrorState from '@/components/ErrorState';
|
||||
import EmptyState from '@/components/EmptyState';
|
||||
import { useDoctorClass } from '@/hooks/useDoctorClass';
|
||||
import DoctorTabBar from '@/components/ui/DoctorTabBar';
|
||||
import { safeNavigateTo } from '@/utils/navigate';
|
||||
import { formatDateTime } from '@/utils/date';
|
||||
import './index.scss';
|
||||
@@ -125,6 +126,7 @@ export default function ConsultationList() {
|
||||
))}
|
||||
</ScrollView>
|
||||
)}
|
||||
<DoctorTabBar active="consultation" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { usePageData } from '@/hooks/usePageData';
|
||||
import { getDashboard, type DoctorDashboard } from '@/services/doctor/dashboard';
|
||||
import Loading from '@/components/Loading';
|
||||
import ContentCard from '@/components/ui/ContentCard';
|
||||
import DoctorTabBar from '@/components/ui/DoctorTabBar';
|
||||
import ShortcutButton from '@/components/ui/ShortcutButton';
|
||||
import TodoAlert from '@/components/ui/TodoAlert';
|
||||
import './index.scss';
|
||||
@@ -137,6 +138,7 @@ export default function DoctorHome() {
|
||||
)}
|
||||
</View>
|
||||
</ScrollView>
|
||||
<DoctorTabBar active="workbench" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import LoadingCard from '@/components/ui/LoadingCard';
|
||||
import EmptyState from '@/components/EmptyState';
|
||||
import Loading from '@/components/Loading';
|
||||
import { useDoctorClass } from '@/hooks/useDoctorClass';
|
||||
import DoctorTabBar from '@/components/ui/DoctorTabBar';
|
||||
import './index.scss';
|
||||
|
||||
const AVATAR_COLORS: Array<'pri' | 'acc' | 'wrn' | 'dan'> = ['pri', 'acc', 'wrn', 'dan'];
|
||||
@@ -169,6 +170,7 @@ export default function PatientList() {
|
||||
{loading && patients.length > 0 && <Loading />}
|
||||
</ScrollView>
|
||||
)}
|
||||
<DoctorTabBar active="patients" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,11 +6,13 @@ import { useAuthStore } from '../../../stores/auth';
|
||||
import { invalidateHeadersCache, clearRequestCache } from '@/services/request';
|
||||
import { useElderClass } from '../../../hooks/useElderClass';
|
||||
import PageShell from '@/components/ui/PageShell';
|
||||
import DoctorTabBar from '@/components/ui/DoctorTabBar';
|
||||
import './index.scss';
|
||||
|
||||
export default function Settings() {
|
||||
const modeClass = useElderClass();
|
||||
const logout = useAuthStore((s) => s.logout);
|
||||
const isMedicalStaff = useAuthStore((s) => s.isMedicalStaff);
|
||||
|
||||
const handleClearCache = async () => {
|
||||
const { confirm } = await Taro.showModal({
|
||||
@@ -99,6 +101,7 @@ export default function Settings() {
|
||||
<Text className='settings-label logout-label'>退出登录</Text>
|
||||
</View>
|
||||
</View>
|
||||
{isMedicalStaff() && <DoctorTabBar active="settings" />}
|
||||
</PageShell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user