tiefen_space_app/screeens/StreamerVerification/AfterSubmitGuildVerification/index.jsx

109 lines
3.4 KiB
React
Raw Normal View History

import { View, Text, ScrollView } from "react-native";
import React, { useState, useEffect } from "react";
import { useTailwind } from "tailwind-rn";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { Icon, Button } from "@rneui/themed";
import baseRequest from "../../../utils/baseRequest";
import Toast from "react-native-toast-message";
import { generateSignature } from "../../../utils/crypto";
export default function AfterSubmitGuildVerification({ navigation, route }) {
const tailwind = useTailwind();
const insets = useSafeAreaInsets();
//获取运营微信
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 (
<ScrollView
style={{
paddingBottom: insets.bottom,
paddingLeft: insets.left,
paddingRight: insets.right,
...tailwind("flex-1"),
}}
>
<View style={tailwind("flex flex-col items-center p-4")}>
<Icon
name="checkmark-circle"
type="ionicon"
color="#27F5B7"
size={100}
/>
<Text style={tailwind("text-2xl text-white font-medium mb-2")}>
提交成功
</Text>
<Text style={tailwind("text-base text-center text-white font-medium")}>
您已成功提交审核材料我们的工作人员将在3个工作日内主动联系您如有疑问请联系微信
<Text style={tailwind("text-[#F53030]")}>微信{wechatList[0]}</Text>
</Text>
<View style={tailwind("mt-4")}>
{wechatList.map((item, index) => {
if (index === 0) return;
return (
<Text key={index} style={tailwind("text-base text-[#F53030]")}>
备用微信{index}{item}
</Text>
);
})}
</View>
<View style={tailwind("flex flex-col w-full px-4")}>
<Button
onPress={() => navigation.navigate("My")}
color="#FFFFFF1A"
radius="999"
size="md"
titleStyle={tailwind("text-base")}
containerStyle={{
marginBottom: insets.bottom + 60,
...tailwind("w-full"),
}}
>
<View style={tailwind("flex flex-col items-center")}>
<Text style={tailwind("text-base text-white")}>返回主页</Text>
</View>
</Button>
</View>
</View>
</ScrollView>
);
}