Commit e47473b1 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加协议页面

parent 66f9e491
import BottomTabs from './BottomTabs'; import BottomTabs from './BottomTabs';
import TestDetailsScreen from '../views/Test/TestDetailsScreen'; import TestDetailsScreen from '../views/Test/TestDetailsScreen';
import Login from '../views/Login'; import Login from '../views/Login';
import LoginAgreement from '../views/Login/Agreement';
import AccountInfo from '../views/AccountInfo'; import AccountInfo from '../views/AccountInfo';
export const ROUTERS = { export const ROUTERS = {
...@@ -19,6 +20,11 @@ export const ROUTERS = { ...@@ -19,6 +20,11 @@ export const ROUTERS = {
component: Login, component: Login,
headerShown: true, headerShown: true,
}, },
LoginAgreement: {
title: '', // 协议
component: LoginAgreement,
headerShown: true,
},
AccountInfo: { AccountInfo: {
title: '账号信息', title: '账号信息',
component: AccountInfo, component: AccountInfo,
......
...@@ -24,6 +24,7 @@ export type RootStackParamList = { ...@@ -24,6 +24,7 @@ export type RootStackParamList = {
BottomTabs: NavigatorScreenParams<RootTabParamList>; BottomTabs: NavigatorScreenParams<RootTabParamList>;
TestDetailsScreen: undefined; TestDetailsScreen: undefined;
Login: undefined; Login: undefined;
LoginAgreement: { id: number };
AccountInfo: undefined; AccountInfo: undefined;
}; };
...@@ -32,7 +33,7 @@ export type RootStackScreenProps<Screen extends keyof RootStackParamList> = ...@@ -32,7 +33,7 @@ export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
export type RootTabParamList = { export type RootTabParamList = {
// Home: NavigatorScreenParams<RootStackParamList>; // Home: NavigatorScreenParams<RootStackParamList>;
Home: { post: string }; Home: { post: string } | undefined;
Customer: undefined; Customer: undefined;
PWAS: undefined; PWAS: undefined;
PersonalCenter: 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