revert 限制appstore测试账号查看付费功能
This commit is contained in:
yezian 2024-05-27 13:21:36 +08:00
parent 91b8399554
commit d41253352e
7 changed files with 290 additions and 380 deletions

View File

@ -57,16 +57,6 @@ export function ImageViewer({
return false;
}, []);
const [isTester, setIsTester] = useState(false);
useEffect(() => {
const checkIsTester = async () => {
const account = await get("account");
if (account.user_id === 314826 || account.user_id === 989430)
setIsTester(true);
};
checkIsTester();
}, []);
const MenusComponent = useCallback(
({ cancel, saveToLocal }) => (
<Modal
@ -198,10 +188,7 @@ export function ImageViewer({
}
return <Image {...props} />;
}}
renderFooter={
isTester
? () => null
: (index) => (
renderFooter={(index) => (
<TouchableOpacity
onPress={() => hanldSaveImage(index)}
style={{
@ -222,8 +209,7 @@ export function ImageViewer({
/>
)}
</TouchableOpacity>
)
}
)}
onSave={(url) => {
saveImage(url);
}}

View File

@ -20,17 +20,6 @@ import { get } from "../../utils/storeInfo";
import { useImageViewer } from "../../context/ImageViewProvider";
export default function Post({ data }) {
//
const [isTester, setIsTester] = useState(false);
useEffect(() => {
const checkIsTester = async () => {
const account = await get("account");
if (account.user_id === 314826 || account.user_id === 989430)
setIsTester(true);
};
checkIsTester();
}, []);
const tailwind = useTailwind();
const navigation = useNavigation();
const [like, setLike] = useState(data?.is_thumbed_up === 1 ? true : false);
@ -176,8 +165,7 @@ export default function Post({ data }) {
<View
style={tailwind("flex flex-row items-center justify-between h-8")}
>
{data?.streamer_ext?.is_active_within_a_week === 1 &&
!isTester ? (
{data?.streamer_ext?.is_active_within_a_week === 1 ? (
<TouchableOpacity
onPress={() =>
navigation.navigate("SpaceIntroduce", { mid: data?.mid })
@ -200,8 +188,7 @@ export default function Post({ data }) {
/>
</TouchableOpacity>
) : (
data?.streamer_ext?.zones?.length !== 0 &&
!isTester && (
data?.streamer_ext?.zones?.length !== 0 && (
<TouchableOpacity
onPress={() =>
navigation.navigate("SpaceIntroduce", { mid: data?.mid })

View File

@ -7,7 +7,7 @@ import {
Text,
ActivityIndicator,
} from "react-native";
import React, { useState, useRef, useCallback, useEffect } from "react";
import React, { useState, useRef, useCallback } from "react";
import { useTailwind } from "tailwind-rn";
import { Icon } from "@rneui/themed";
import { Video, ResizeMode } from "expo-av";
@ -37,16 +37,6 @@ export default function VideoModal({ visible, setVisible, url }) {
return false;
}, []);
const [isTester, setIsTester] = useState(false);
useEffect(() => {
const checkIsTester = async () => {
const account = await get("account");
if (account.user_id === 314826 || account.user_id === 989430)
setIsTester(true);
};
checkIsTester();
}, []);
const [isVipModalVisible, setIsVipModalVisible] = useState(false);
const [isSaving, setIsSaving] = useState(false);
const [progress, setProgress] = useState(0);
@ -130,7 +120,6 @@ export default function VideoModal({ visible, setVisible, url }) {
}}
/>
</TouchableOpacity>
{!isTester && (
<TouchableOpacity
onPress={hanldSaveVideo}
style={{
@ -153,7 +142,6 @@ export default function VideoModal({ visible, setVisible, url }) {
/>
)}
</TouchableOpacity>
)}
</View>
</TouchableWithoutFeedback>
<Toast />

View File

@ -12,13 +12,10 @@ const Tab = createBottomTabNavigator();
export default function HomeTab({ navigation, route }) {
const [isCreatePostTabVisible, setIsCreatePostTabVisible] = useState(false);
const [isTester, setIsTester] = useState(false);
useEffect(() => {
const checkRole = async () => {
const account = await get("account");
if (account.role === 3) setIsCreatePostTabVisible(true);
if (account.user_id === 314826 || account.user_id === 989430)
setIsTester(true);
};
checkRole();
}, []);
@ -84,7 +81,6 @@ export default function HomeTab({ navigation, route }) {
},
}}
/>
{!isTester && (
<Tab.Screen
name="Space"
component={Space}
@ -108,7 +104,6 @@ export default function HomeTab({ navigation, route }) {
},
}}
/>
)}
{isCreatePostTabVisible && (
<Tab.Screen
name="Publish"

View File

@ -314,7 +314,6 @@ export default function My({ navigation }) {
粉丝
</Text>
</TouchableOpacity>
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
<TouchableOpacity
onPress={() => navigation.navigate("Wallet")}
style={tailwind("flex flex-col items-center w-1/4")}
@ -331,8 +330,6 @@ export default function My({ navigation }) {
金币
</Text>
</TouchableOpacity>
)}
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
<TouchableOpacity
onPress={() => navigation.navigate("Wallet")}
style={tailwind("flex flex-col items-center w-1/4")}
@ -349,10 +346,8 @@ export default function My({ navigation }) {
钻石
</Text>
</TouchableOpacity>
)}
</View>
{/* 会员 */}
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
<TouchableOpacity
activeOpacity={1}
onPress={() =>
@ -380,9 +375,7 @@ export default function My({ navigation }) {
: "尊贵的永久会员"}
</Text>
</View>
<Text
style={tailwind("text-sm text-[#FFFFFF40] font-medium")}
>
<Text style={tailwind("text-sm text-[#FFFFFF40] font-medium")}>
{data?.is_a_member !== 1
? "限时优惠活动"
: "已解锁全部会员权益"}
@ -401,7 +394,6 @@ export default function My({ navigation }) {
)}
</View>
</TouchableOpacity>
)}
{/* 纵向列表设置区 */}
{data?.role === 3 && (
<View
@ -537,7 +529,6 @@ export default function My({ navigation }) {
borderColor: "#2c2b2f",
}}
>
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
<TouchableOpacity
onPress={() => navigation.navigate("Wallet")}
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
@ -552,8 +543,6 @@ export default function My({ navigation }) {
source={require("../../assets/icon/32DP/smalllink.png")}
/>
</TouchableOpacity>
)}
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
<TouchableOpacity
onPress={() => navigation.navigate("UnlockedWechat")}
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
@ -568,8 +557,6 @@ export default function My({ navigation }) {
source={require("../../assets/icon/32DP/smalllink.png")}
/>
</TouchableOpacity>
)}
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
<TouchableOpacity
onPress={() => navigation.navigate("StreamerVerification")}
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
@ -584,7 +571,6 @@ export default function My({ navigation }) {
source={require("../../assets/icon/32DP/smalllink.png")}
/>
</TouchableOpacity>
)}
<TouchableOpacity
onPress={() =>
navigation.navigate("MessageDetail", {

View File

@ -37,17 +37,6 @@ export default function StreamerProfile({ navigation, route }) {
const insets = useSafeAreaInsets();
const headerHeight = useHeaderHeight();
//
const [isTester, setIsTester] = useState(false);
useEffect(() => {
const checkTester = async () => {
const account = await get("account");
if (account.user_id === 314826 || account.user_id === 989430)
setIsTester(true);
};
checkTester();
}, []);
//header
useEffect(() => {
navigation.setOptions({
@ -650,9 +639,7 @@ export default function StreamerProfile({ navigation, route }) {
style={tailwind("h-[3px] rounded-full bg-[#FFFFFF26]")}
></View>
{/* 空间动态 */}
{spaceData &&
spaceData?.previews?.images?.length > 0 &&
!isTester && (
{spaceData && spaceData?.previews?.images?.length > 0 && (
<View>
<View style={tailwind("my-4")}>
<TouchableOpacity
@ -820,7 +807,6 @@ export default function StreamerProfile({ navigation, route }) {
<Text style={tailwind("text-base text-white font-semibold mb-2")}>
来这找我玩
</Text>
{!isTester && (
<View
style={tailwind(
"flex-row items-center p-2 h-12 rounded-xl border-2 border-[#2c2b2f]"
@ -830,9 +816,7 @@ export default function StreamerProfile({ navigation, route }) {
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 style={tailwind("text-sm text-white ml-1")}>微信</Text>
<Text
onPress={() => setIsAddWechatModalVisible(true)}
style={tailwind("text-sm text-[#3B69B8] ml-1")}
@ -842,7 +826,6 @@ export default function StreamerProfile({ navigation, route }) {
点击查看
</Text>
</View>
)}
{data?.platforms?.map((item) => (
<PlatformList key={item?.id} item={item} />
))}
@ -880,7 +863,6 @@ export default function StreamerProfile({ navigation, route }) {
>
<Text style={tailwind("text-base text-white font-medium")}>私聊</Text>
</TouchableOpacity>
{!isTester && (
<TouchableOpacity
onPress={() => setIsAddWechatModalVisible(true)}
style={tailwind(
@ -891,7 +873,6 @@ export default function StreamerProfile({ navigation, route }) {
添加微信
</Text>
</TouchableOpacity>
)}
</View>
{/* 拉黑、举报Modal */}
<NavbarRightModal />

View File

@ -1,24 +1,13 @@
import { View, Text, ScrollView } from "react-native";
import React, { useState, useEffect } from "react";
import React 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 [isTester, setIsTester] = useState(false);
useEffect(() => {
const checkIsTester = async () => {
const account = await get("account");
if (account.user_id === 314826 || account.user_id === 989430)
setIsTester(true);
};
checkIsTester();
}, []);
return (
<View
style={{
@ -184,7 +173,6 @@ export default function StreamerProfileSkeleton() {
>
<Text style={tailwind("text-base text-white font-medium")}>私聊</Text>
</View>
{!isTester && (
<View
style={tailwind(
"flex-row flex-1 bg-[#FF669E] items-center justify-center h-10 rounded-full"
@ -194,7 +182,6 @@ export default function StreamerProfileSkeleton() {
添加微信
</Text>
</View>
)}
</View>
</View>
);