import { View, TouchableOpacity, Image as NativeImage, Text, } from "react-native"; import React, { useState, useEffect, useCallback } from "react"; import { useTailwind } from "tailwind-rn"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import baseRequest from "../../../utils/baseRequest"; import { generateSignature } from "../../../utils/crypto"; export default function Message({ navigation }) { const [data, setData] = useState([]); const tailwind = useTailwind(); const insets = useSafeAreaInsets(); useEffect(() => { getData(); }, []); const getData = async (searchValue) => { const apiUrl = process.env.EXPO_PUBLIC_API_URL; try { const base = await baseRequest(); const body = { mid: base.b_mid, ...base, }; const signature = await generateSignature(body); const _response = await fetch( `${apiUrl}/api/notification/list_unread_by_mid?signature=${signature}`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(body), } ); const _data = await _response.json(); if (_data.ret === -1) { Toast.show({ type: "error", text1: _data.msg, topOffset: 60, }); return; } setData(_data.data.list); console.log("_data.data.list", _data.data); } catch (error) { console.error(error); } }; return ( {/* 广告轮播 */} {/* 官方消息 */} navigation.navigate("SystemNotice")} style={{ ...tailwind("flex flex-row items-center py-4 mb-2 rounded-xl"), backgroundColor: "#ffffff1a", }} > 系统通知 官方 官方消息通知 11:00 1 navigation.navigate("ActiveNotice")} style={{ ...tailwind("flex flex-row items-center py-4 rounded-xl"), backgroundColor: "#ffffff1a", }} > 活动消息 官方 展示相关活动推送信息 11:00 99 {/* 私聊消息 */} navigation.navigate("MessageDetail", { mid: 1, }) } style={{ ...tailwind("flex flex-row items-center py-4 mb-2 rounded-xl"), backgroundColor: "#333333", }} > 铁粉空间官网 官方客服 请回复您的相关消息 11:00 1 ); }