import { StackScreenProps } from '@react-navigation/stack'; import * as React from 'react'; import { RefreshControl } from 'react-native'; import { Div, Button, Image, Text, Avatar } from 'react-native-magnus'; import { ScrollView } from 'react-native-gesture-handler'; import { useRequest } from 'ahooks'; import { RootStackParamList } from '../types'; import { getChatTime } from '../utils/TimeUtils'; import request from '../utils/RequestUtils'; export default function RegisterScreen({ navigation, route }) { const { params } = route; const { emailId } = params; const { data, loading, reload, run } = useRequest(`/email/get/${emailId}`, { refreshDeps: [emailId], initialData: {}, onSuccess: (res) => { if (!res.isRead) { request.post('/email/save', { data: { ...data, isRead: true, }, }); } }, }); return (
} >
{data.title} {getChatTime(data.sendTime)}
{data.content}
); }