import { View, Text } from "react-native"; import React, { useState, useEffect } from "react"; import { useTailwind } from "tailwind-rn"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Icon } from "@rneui/themed"; import baseRequest from "../../../utils/baseRequest"; import Toast from "react-native-toast-message"; import { generateSignature } from "../../../utils/crypto"; export default function AfterSubmitStreamerVerification({ navigation, route }) { const tailwind = useTailwind(); const insets = useSafeAreaInsets(); //获取运营微信 const wechat = "xxxxxx"; const [wechatList, setWechatList] = useState([]); useEffect(() => { const getWechat = async () => { const apiUrl = process.env.EXPO_PUBLIC_API_URL; try { const base = await baseRequest(); const signature = await generateSignature({ ...base, }); const response = await fetch( `${apiUrl}/api/support_wx_id/list?signature=${signature}`, { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ ...base, }), } ); const data = await response.json(); if (data.ret === -1) { Toast.show({ type: "error", text1: data.msg, topOffset: 60, }); return; } const temWechat = Object.entries(data.data); const temWechatList = temWechat.map((item) => item[1]); setWechatList(temWechatList); } catch (error) { console.error(error); } }; getWechat(); }, []); return ( 提交成功 工作人员将在3日内联系您。您也可添加 微信:{wechatList[0]} 直接商讨合作事宜。 {wechatList.map((item, index) => { if (index === 0) return; return ( 备用微信{index}:{item} ); })} ); }