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,32 +188,28 @@ export function ImageViewer({
}
return <Image {...props} />;
}}
renderFooter={
isTester
? () => null
: (index) => (
<TouchableOpacity
onPress={() => hanldSaveImage(index)}
style={{
marginLeft: 20,
marginBottom: insets.bottom,
...tailwind(
"flex justify-center items-center w-12 h-12 bg-[#FFFFFF1A] rounded-full"
),
}}
>
{isSaving && <ActivityIndicator size="small" />}
{!isSaving && (
<Icon
type="ionicon"
name="save-outline"
size={20}
color="white"
/>
)}
</TouchableOpacity>
)
}
renderFooter={(index) => (
<TouchableOpacity
onPress={() => hanldSaveImage(index)}
style={{
marginLeft: 20,
marginBottom: insets.bottom,
...tailwind(
"flex justify-center items-center w-12 h-12 bg-[#FFFFFF1A] rounded-full"
),
}}
>
{isSaving && <ActivityIndicator size="small" />}
{!isSaving && (
<Icon
type="ionicon"
name="save-outline"
size={20}
color="white"
/>
)}
</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,30 +120,28 @@ export default function VideoModal({ visible, setVisible, url }) {
}}
/>
</TouchableOpacity>
{!isTester && (
<TouchableOpacity
onPress={hanldSaveVideo}
style={{
left: 20,
bottom: insets.bottom,
...tailwind(
"flex absolute justify-center items-center w-12 h-12 bg-[#FFFFFF1A] rounded-full"
),
}}
>
{isSaving && (
<Text style={tailwind("text-white")}>{progress}%</Text>
)}
{!isSaving && (
<Icon
type="ionicon"
name="save-outline"
size={20}
color="white"
/>
)}
</TouchableOpacity>
)}
<TouchableOpacity
onPress={hanldSaveVideo}
style={{
left: 20,
bottom: insets.bottom,
...tailwind(
"flex absolute justify-center items-center w-12 h-12 bg-[#FFFFFF1A] rounded-full"
),
}}
>
{isSaving && (
<Text style={tailwind("text-white")}>{progress}%</Text>
)}
{!isSaving && (
<Icon
type="ionicon"
name="save-outline"
size={20}
color="white"
/>
)}
</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,31 +81,29 @@ export default function HomeTab({ navigation, route }) {
},
}}
/>
{!isTester && (
<Tab.Screen
name="Space"
component={Space}
options={{
title: "空间",
headerShown: false,
tabBarIcon: ({ focused, color, size }) => {
if (focused) {
return (
<Image
source={require("../../assets/icon/others/space_focus.png")}
/>
);
} else {
return (
<Image
source={require("../../assets/icon/others/space_blur.png")}
/>
);
}
},
}}
/>
)}
<Tab.Screen
name="Space"
component={Space}
options={{
title: "空间",
headerShown: false,
tabBarIcon: ({ focused, color, size }) => {
if (focused) {
return (
<Image
source={require("../../assets/icon/others/space_focus.png")}
/>
);
} else {
return (
<Image
source={require("../../assets/icon/others/space_blur.png")}
/>
);
}
},
}}
/>
{isCreatePostTabVisible && (
<Tab.Screen
name="Publish"

View File

@ -314,94 +314,86 @@ 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")}
<TouchableOpacity
onPress={() => navigation.navigate("Wallet")}
style={tailwind("flex flex-col items-center w-1/4")}
>
<Text style={tailwind("text-2xl font-medium text-white")}>
{data?.gold_num}
</Text>
<Text
style={{
color: "#FFFFFF80",
...tailwind("text-sm font-medium"),
}}
>
<Text style={tailwind("text-2xl font-medium text-white")}>
{data?.gold_num}
</Text>
<Text
style={{
color: "#FFFFFF80",
...tailwind("text-sm font-medium"),
}}
>
金币
</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")}
金币
</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("Wallet")}
style={tailwind("flex flex-col items-center w-1/4")}
>
<Text style={tailwind("text-2xl font-medium text-white")}>
{data?.diamond_num}
</Text>
<Text
style={{
color: "#FFFFFF80",
...tailwind("text-sm font-medium"),
}}
>
<Text style={tailwind("text-2xl font-medium text-white")}>
{data?.diamond_num}
</Text>
<Text
style={{
color: "#FFFFFF80",
...tailwind("text-sm font-medium"),
}}
>
钻石
</Text>
</TouchableOpacity>
)}
钻石
</Text>
</TouchableOpacity>
</View>
{/* 会员 */}
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
<TouchableOpacity
activeOpacity={1}
onPress={() =>
navigation.navigate("WebWithoutHeader", {
uri: process.env.EXPO_PUBLIC_WEB_URL + "/vip",
})
}
style={tailwind(
"flex flex-col p-2.5 rounded-2xl mt-3.5 bg-[#301024]"
)}
<TouchableOpacity
activeOpacity={1}
onPress={() =>
navigation.navigate("WebWithoutHeader", {
uri: process.env.EXPO_PUBLIC_WEB_URL + "/vip",
})
}
style={tailwind(
"flex flex-col p-2.5 rounded-2xl mt-3.5 bg-[#301024]"
)}
>
<View
style={tailwind("flex flex-row justify-between items-center")}
>
<View
style={tailwind("flex flex-row justify-between items-center")}
>
<View style={tailwind("flex flex-col")}>
<View style={tailwind("flex flex-row items-center")}>
<NativeImage
source={require("../../assets/icon/others/vipsmall.png")}
/>
<Text
style={tailwind("text-base text-[#FF669E] font-medium")}
>
{data?.is_a_member !== 1
? "开通会员保存图片"
: "尊贵的永久会员"}
</Text>
</View>
<View style={tailwind("flex flex-col")}>
<View style={tailwind("flex flex-row items-center")}>
<NativeImage
source={require("../../assets/icon/others/vipsmall.png")}
/>
<Text
style={tailwind("text-sm text-[#FFFFFF40] font-medium")}
style={tailwind("text-base text-[#FF669E] font-medium")}
>
{data?.is_a_member !== 1
? "限时优惠活动"
: "已解锁全部会员权益"}
? "开通会员保存图片"
: "尊贵的永久会员"}
</Text>
</View>
{data?.is_a_member !== 1 && (
<View
style={tailwind(
"flex justify-center items-center h-9 bg-[#FF669E] rounded-full px-4"
)}
>
<Text style={tailwind("text-white text-sm font-medium")}>
¥{vipPrice}/永久
</Text>
</View>
)}
<Text style={tailwind("text-sm text-[#FFFFFF40] font-medium")}>
{data?.is_a_member !== 1
? "限时优惠活动"
: "已解锁全部会员权益"}
</Text>
</View>
</TouchableOpacity>
)}
{data?.is_a_member !== 1 && (
<View
style={tailwind(
"flex justify-center items-center h-9 bg-[#FF669E] rounded-full px-4"
)}
>
<Text style={tailwind("text-white text-sm font-medium")}>
¥{vipPrice}/永久
</Text>
</View>
)}
</View>
</TouchableOpacity>
{/* 纵向列表设置区 */}
{data?.role === 3 && (
<View
@ -537,54 +529,48 @@ 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")}
>
<NativeImage
source={require("../../assets/icon/32DP/wallet.png")}
/>
<Text style={tailwind("text-base text-white ml-2 flex-1")}>
我的钱包
</Text>
<NativeImage
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")}
>
<NativeImage
source={require("../../assets/icon/32DP/wechat.png")}
/>
<Text style={tailwind("text-base text-white ml-2 flex-1")}>
已解锁微信
</Text>
<NativeImage
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")}
>
<NativeImage
source={require("../../assets/icon/32DP/join.png")}
/>
<Text style={tailwind("text-base text-white ml-2 flex-1")}>
申请入驻
</Text>
<NativeImage
source={require("../../assets/icon/32DP/smalllink.png")}
/>
</TouchableOpacity>
)}
<TouchableOpacity
onPress={() => navigation.navigate("Wallet")}
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
>
<NativeImage
source={require("../../assets/icon/32DP/wallet.png")}
/>
<Text style={tailwind("text-base text-white ml-2 flex-1")}>
我的钱包
</Text>
<NativeImage
source={require("../../assets/icon/32DP/smalllink.png")}
/>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("UnlockedWechat")}
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
>
<NativeImage
source={require("../../assets/icon/32DP/wechat.png")}
/>
<Text style={tailwind("text-base text-white ml-2 flex-1")}>
已解锁微信
</Text>
<NativeImage
source={require("../../assets/icon/32DP/smalllink.png")}
/>
</TouchableOpacity>
<TouchableOpacity
onPress={() => navigation.navigate("StreamerVerification")}
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
>
<NativeImage
source={require("../../assets/icon/32DP/join.png")}
/>
<Text style={tailwind("text-base text-white ml-2 flex-1")}>
申请入驻
</Text>
<NativeImage
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,11 +639,43 @@ export default function StreamerProfile({ navigation, route }) {
style={tailwind("h-[3px] rounded-full bg-[#FFFFFF26]")}
></View>
{/* 空间动态 */}
{spaceData &&
spaceData?.previews?.images?.length > 0 &&
!isTester && (
<View>
<View style={tailwind("my-4")}>
{spaceData && spaceData?.previews?.images?.length > 0 && (
<View>
<View style={tailwind("my-4")}>
<TouchableOpacity
activeOpacity={1}
onPress={
spaceData?.visitor_role === 4
? () =>
navigation.navigate("SpaceIntroduce", {
mid: route.params.mid,
})
: () =>
navigation.navigate("StreamerSpace", {
mid: route.params.mid,
})
}
style={tailwind(
"flex flex-row justify-between items-center"
)}
>
<Text
style={tailwind(
"text-base font-semibold text-white mb-2"
)}
>
空间动态
</Text>
<View style={tailwind("flex flex-row items-center")}>
<Text style={tailwind("text-sm text-[#FFFFFFB2]")}>
查看{spaceData?.zone_moment_count}
</Text>
<NativeImage
source={require("../../assets/icon/32DP/smalllink.png")}
/>
</View>
</TouchableOpacity>
<ScrollView horizontal>
<TouchableOpacity
activeOpacity={1}
onPress={
@ -668,77 +689,43 @@ export default function StreamerProfile({ navigation, route }) {
mid: route.params.mid,
})
}
style={tailwind(
"flex flex-row justify-between items-center"
)}
style={{
height: 100,
gap: 4,
...tailwind("flex flex-row"),
}}
>
<Text
style={tailwind(
"text-base font-semibold text-white mb-2"
)}
>
空间动态
</Text>
<View style={tailwind("flex flex-row items-center")}>
<Text style={tailwind("text-sm text-[#FFFFFFB2]")}>
查看{spaceData?.zone_moment_count}
</Text>
<NativeImage
source={require("../../assets/icon/32DP/smalllink.png")}
/>
</View>
{spaceData?.previews?.images?.map((item, index) => {
if (index > 3) return;
return (
<Image
key={index}
style={{
aspectRatio: "1",
...tailwind("h-full rounded"),
}}
blurRadius={
spaceData?.visitor_role === 4
? Platform.OS === "ios"
? 130
: 10
: 0
}
source={item?.urls[0]}
contentFit="cover"
transition={100}
cachePolicy="disk"
/>
);
})}
</TouchableOpacity>
<ScrollView horizontal>
<TouchableOpacity
activeOpacity={1}
onPress={
spaceData?.visitor_role === 4
? () =>
navigation.navigate("SpaceIntroduce", {
mid: route.params.mid,
})
: () =>
navigation.navigate("StreamerSpace", {
mid: route.params.mid,
})
}
style={{
height: 100,
gap: 4,
...tailwind("flex flex-row"),
}}
>
{spaceData?.previews?.images?.map((item, index) => {
if (index > 3) return;
return (
<Image
key={index}
style={{
aspectRatio: "1",
...tailwind("h-full rounded"),
}}
blurRadius={
spaceData?.visitor_role === 4
? Platform.OS === "ios"
? 130
: 10
: 0
}
source={item?.urls[0]}
contentFit="cover"
transition={100}
cachePolicy="disk"
/>
);
})}
</TouchableOpacity>
</ScrollView>
</View>
<View
style={tailwind("h-[3px] rounded-full bg-[#FFFFFF26]")}
></View>
</ScrollView>
</View>
)}
<View
style={tailwind("h-[3px] rounded-full bg-[#FFFFFF26]")}
></View>
</View>
)}
{/* 动态 */}
{!spaceData && postsData.length !== 0 && (
<View>
@ -820,29 +807,25 @@ 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]"
)}
<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"
>
<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>
)}
点击查看
</Text>
</View>
{data?.platforms?.map((item) => (
<PlatformList key={item?.id} item={item} />
))}
@ -880,18 +863,16 @@ export default function StreamerProfile({ navigation, route }) {
>
<Text style={tailwind("text-base text-white font-medium")}>私聊</Text>
</TouchableOpacity>
{!isTester && (
<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>
)}
<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,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,17 +173,15 @@ 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"
)}
>
<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>
</View>
</View>
);