删除测试账号加微信功能

This commit is contained in:
yezian 2024-03-28 14:03:22 +08:00
parent 1fa913d89d
commit 896d2b713f
2 changed files with 75 additions and 38 deletions

View File

@ -66,6 +66,20 @@ export default function StreamerProfile({ navigation, route }) {
return setBlur(true);
};
//
const [isWechatButtonVisible, setIsWechatButtonVisible] = useState(true);
useEffect(() => {
const checkUserId = async () => {
const account = await get("account");
const userId = account.user_id;
if (userId === 314826) {
setIsWechatButtonVisible(false);
return;
}
};
checkUserId();
}, []);
//
const [data, setData] = useState({});
const [postsData, setPostsData] = useState([]);
@ -714,25 +728,29 @@ export default function StreamerProfile({ navigation, route }) {
<Text style={tailwind("text-base text-white font-medium mb-2")}>
来这找我玩
</Text>
<View
style={tailwind(
"flex-row items-center p-2 h-12 rounded-xl border-2 border-[#2c2b2f]"
)}
>
<NativeImage
source={require("../../assets/images/platform_wechat.png")}
style={{ aspectRatio: "1/1", ...tailwind("w-8") }}
/>
<Text style={tailwind("text-sm text-white ml-1")}>微信</Text>
<Text
onPress={() => setIsAddWechatModalVisible(true)}
style={tailwind("text-sm text-[#3B69B8] ml-1")}
numberOfLines={1}
ellipsizeMode="tail"
{isWechatButtonVisible && (
<View
style={tailwind(
"flex-row items-center p-2 h-12 rounded-xl border-2 border-[#2c2b2f]"
)}
>
点击查看
</Text>
</View>
<NativeImage
source={require("../../assets/images/platform_wechat.png")}
style={{ aspectRatio: "1/1", ...tailwind("w-8") }}
/>
<Text style={tailwind("text-sm text-white ml-1")}>
微信
</Text>
<Text
onPress={() => setIsAddWechatModalVisible(true)}
style={tailwind("text-sm text-[#3B69B8] ml-1")}
numberOfLines={1}
ellipsizeMode="tail"
>
点击查看
</Text>
</View>
)}
{data?.platforms?.map((item) => (
<PlatformList key={item?.id} item={item} />
))}
@ -770,16 +788,18 @@ export default function StreamerProfile({ navigation, route }) {
>
<Text style={tailwind("text-base text-white font-medium")}>私聊</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => setIsAddWechatModalVisible(true)}
style={tailwind(
"flex-row flex-1 bg-[#FF669E] items-center justify-center h-10 rounded-full"
)}
>
<Text style={tailwind("text-base text-white font-medium")}>
添加微信
</Text>
</TouchableOpacity>
{isWechatButtonVisible && (
<TouchableOpacity
onPress={() => setIsAddWechatModalVisible(true)}
style={tailwind(
"flex-row flex-1 bg-[#FF669E] items-center justify-center h-10 rounded-full"
)}
>
<Text style={tailwind("text-base text-white font-medium")}>
添加微信
</Text>
</TouchableOpacity>
)}
</View>
{/* 拉黑、举报Modal */}
<NavbarRightModal />

View File

@ -1,13 +1,28 @@
import { View, Text, ScrollView } from "react-native";
import React from "react";
import React, { useEffect, useState } from "react";
import { useTailwind } from "tailwind-rn";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { Skeleton } from "@rneui/themed";
import { get } from "../../utils/storeInfo";
export default function StreamerProfileSkeleton() {
const tailwind = useTailwind();
const insets = useSafeAreaInsets();
//
const [isWechatButtonVisible, setIsWechatButtonVisible] = useState(true);
useEffect(() => {
const checkUserId = async () => {
const account = await get("account");
const userId = account.user_id;
if (userId === 314826) {
setIsWechatButtonVisible(false);
return;
}
};
checkUserId();
}, []);
return (
<View
style={{
@ -175,15 +190,17 @@ export default function StreamerProfileSkeleton() {
>
<Text style={tailwind("text-base text-white font-medium")}>私聊</Text>
</View>
<View
style={tailwind(
"flex-row flex-1 bg-[#FF669E] items-center justify-center h-10 rounded-full"
)}
>
<Text style={tailwind("text-base text-white font-medium")}>
添加微信
</Text>
</View>
{isWechatButtonVisible && (
<View
style={tailwind(
"flex-row flex-1 bg-[#FF669E] items-center justify-center h-10 rounded-full"
)}
>
<Text style={tailwind("text-base text-white font-medium")}>
添加微信
</Text>
</View>
)}
</View>
</View>
);