import { StackScreenProps } from '@react-navigation/stack'; import * as React from 'react'; import { useFocusEffect } from '@react-navigation/native'; import { Div, Button, Image, Text, Avatar } from 'react-native-magnus'; import { ScrollView, FlatList } from 'react-native-gesture-handler'; import { useNavigation } from '@react-navigation/native'; import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs'; import Constants from 'expo-constants'; import useModel from 'flooks'; import { useMount } from 'ahooks'; import { RootStackParamList } from '../types'; import IM from './model'; import User from '../stores/User'; import { useTranslation } from 'react-i18next'; import NoticeCom from './NoticeCom'; import { SoundPlay } from '../utils/SoundUtils'; const NoticeTab = createMaterialTopTabNavigator(); export default function NoticeScreen({ navigation, }: StackScreenProps) { const { t } = useTranslation(); const webRef = React.useRef(); const { initChat } = useModel(IM, []); useFocusEffect( React.useCallback(() => { initChat(); }, []) ); return (
{t('xiao-xi-zhong-xin')}
); } function SysNoticeScreen({ navigation }) { const { sysNoticeList, sendPushNotification } = useModel(IM, [ 'sysNoticeList', ]); const { t } = useTranslation(); return ( <> {/* */} { return ( { navigation.navigate('NoticeStack', { screen: 'EmailDetail', params: { emailId: item.id, }, }); }} /> ); }} data={sysNoticeList} keyExtractor={(item, index) => `email${index}`} ListEmptyComponent={() => { return ( {t('zan-wu-shu-ju')} ); }} contentContainerStyle={{ flexGrow: 1, backgroundColor: '#fff' }} /> ); } function UserChatScreen({ navigation }) { const { chatList } = useModel(IM, ['chatList']); const { id } = useModel(User, ['id']); const { t } = useTranslation(); return ( { const isReceive = item.receiveUserId === id; const toUserId = isReceive ? item.sendUserId : item.receiveUserId; const toUserName = isReceive ? item.sendNickname : item.receiveNickname; return ( { navigation.navigate('NoticeStack', { screen: 'Chat', params: { toUserId, toUserName, }, }); }} /> ); }} data={chatList} keyExtractor={(item, index) => `chat${index}`} contentContainerStyle={{ flexGrow: 1, backgroundColor: '#fff' }} ListEmptyComponent={() => { return ( {t('zan-wu-shu-ju')} ); }} /> ); }