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 { useModel } from "flooks"; 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 { httpGet,httpPost } = useModel("httpModel"); const { data, loading, reload, run } = useRequest( () => { return httpGet(`/email/get/${emailId}`); }, { refreshDeps: [emailId], initialData: {}, onSuccess: res => { if (!res.isRead) { httpPost( "/email/save", { ...data, isRead: true, }, { body: "json" } ); } }, } ); return (
} >
{data.title} {getChatTime(data.sendTime)}
{data.content}
); }