Commit e47473b1 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加协议页面

parent 66f9e491
import BottomTabs from './BottomTabs';
import TestDetailsScreen from '../views/Test/TestDetailsScreen';
import Login from '../views/Login';
import LoginAgreement from '../views/Login/Agreement';
import AccountInfo from '../views/AccountInfo';
export const ROUTERS = {
......@@ -19,6 +20,11 @@ export const ROUTERS = {
component: Login,
headerShown: true,
},
LoginAgreement: {
title: '', // 协议
component: LoginAgreement,
headerShown: true,
},
AccountInfo: {
title: '账号信息',
component: AccountInfo,
......
......@@ -24,6 +24,7 @@ export type RootStackParamList = {
BottomTabs: NavigatorScreenParams<RootTabParamList>;
TestDetailsScreen: undefined;
Login: undefined;
LoginAgreement: { id: number };
AccountInfo: undefined;
};
......@@ -32,7 +33,7 @@ export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
export type RootTabParamList = {
// Home: NavigatorScreenParams<RootStackParamList>;
Home: { post: string };
Home: { post: string } | undefined;
Customer: undefined;
PWAS: undefined;
PersonalCenter: undefined;
......
/* eslint-disable react-hooks/exhaustive-deps */
import React, { useEffect, useState } from 'react';
import { View } from 'react-native';
import { WebView } from 'react-native-webview';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { RootStackScreenProps } from '../../../routers/types';
import { getManageContentNoticeGet } from '../../../services/ManageV2Api';
import type { GetManageContentNoticeGetResponse } from '../../../services/ManageV2Api';
type LoginAgreementScreenNavigationProp =
RootStackScreenProps<'LoginAgreement'>;
/**
* 协议
* @returns null
*/
const LoginAgreement: React.FC<LoginAgreementScreenNavigationProp> = ({
route,
navigation,
}) => {
const {
params: { id },
} = route;
const [columnTypeList, setcolumnTypeList] =
useState<GetManageContentNoticeGetResponse | null>(null);
const safeInset = useSafeAreaInsets();
const findAllByColumnType = async () => {
const res = await getManageContentNoticeGet({ id: `${id}` });
if (res.code === 1000) {
setcolumnTypeList(res.data);
navigation.setOptions({ title: res.data.title });
}
};
useEffect(() => {
findAllByColumnType();
}, []);
return (
<View style={{ flex: 1, paddingBottom: safeInset.bottom }}>
<WebView source={{ html: columnTypeList?.content || '' }} />
</View>
);
};
export default LoginAgreement;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment