From d41253352e465c5b2ed286965fdefe45a2666632 Mon Sep 17 00:00:00 2001 From: yezian Date: Mon, 27 May 2024 13:21:36 +0800 Subject: [PATCH] revert 00b37499dac5ae1d3dc62e152548ab429573d46b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit revert 限制appstore测试账号查看付费功能 --- components/ImageViewer/index.jsx | 58 +++---- components/Post/index.jsx | 17 +- components/VideoModal/index.jsx | 58 +++---- screeens/HomeTab/index.jsx | 51 +++--- screeens/My/index.jsx | 236 ++++++++++++-------------- screeens/StreamerProfile/index.jsx | 217 +++++++++++------------ screeens/StreamerProfile/skeleton.jsx | 33 ++-- 7 files changed, 290 insertions(+), 380 deletions(-) diff --git a/components/ImageViewer/index.jsx b/components/ImageViewer/index.jsx index d2f08ef..0cb8cfc 100644 --- a/components/ImageViewer/index.jsx +++ b/components/ImageViewer/index.jsx @@ -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 }) => ( ; }} - renderFooter={ - isTester - ? () => null - : (index) => ( - hanldSaveImage(index)} - style={{ - marginLeft: 20, - marginBottom: insets.bottom, - ...tailwind( - "flex justify-center items-center w-12 h-12 bg-[#FFFFFF1A] rounded-full" - ), - }} - > - {isSaving && } - {!isSaving && ( - - )} - - ) - } + renderFooter={(index) => ( + hanldSaveImage(index)} + style={{ + marginLeft: 20, + marginBottom: insets.bottom, + ...tailwind( + "flex justify-center items-center w-12 h-12 bg-[#FFFFFF1A] rounded-full" + ), + }} + > + {isSaving && } + {!isSaving && ( + + )} + + )} onSave={(url) => { saveImage(url); }} diff --git a/components/Post/index.jsx b/components/Post/index.jsx index 8b70ae1..332d3ca 100644 --- a/components/Post/index.jsx +++ b/components/Post/index.jsx @@ -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 }) { - {data?.streamer_ext?.is_active_within_a_week === 1 && - !isTester ? ( + {data?.streamer_ext?.is_active_within_a_week === 1 ? ( navigation.navigate("SpaceIntroduce", { mid: data?.mid }) @@ -200,8 +188,7 @@ export default function Post({ data }) { /> ) : ( - data?.streamer_ext?.zones?.length !== 0 && - !isTester && ( + data?.streamer_ext?.zones?.length !== 0 && ( navigation.navigate("SpaceIntroduce", { mid: data?.mid }) diff --git a/components/VideoModal/index.jsx b/components/VideoModal/index.jsx index a4fac07..dec6f1e 100644 --- a/components/VideoModal/index.jsx +++ b/components/VideoModal/index.jsx @@ -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 }) { }} /> - {!isTester && ( - - {isSaving && ( - {progress}% - )} - {!isSaving && ( - - )} - - )} + + {isSaving && ( + {progress}% + )} + {!isSaving && ( + + )} + diff --git a/screeens/HomeTab/index.jsx b/screeens/HomeTab/index.jsx index bfc4644..1c64d07 100644 --- a/screeens/HomeTab/index.jsx +++ b/screeens/HomeTab/index.jsx @@ -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 && ( - { - if (focused) { - return ( - - ); - } else { - return ( - - ); - } - }, - }} - /> - )} + { + if (focused) { + return ( + + ); + } else { + return ( + + ); + } + }, + }} + /> {isCreatePostTabVisible && ( - {data?.user_id !== 314826 && data?.user_id !== 989430 && ( - navigation.navigate("Wallet")} - style={tailwind("flex flex-col items-center w-1/4")} + navigation.navigate("Wallet")} + style={tailwind("flex flex-col items-center w-1/4")} + > + + {data?.gold_num} + + - - {data?.gold_num} - - - 金币 - - - )} - {data?.user_id !== 314826 && data?.user_id !== 989430 && ( - navigation.navigate("Wallet")} - style={tailwind("flex flex-col items-center w-1/4")} + 金币 + + + navigation.navigate("Wallet")} + style={tailwind("flex flex-col items-center w-1/4")} + > + + {data?.diamond_num} + + - - {data?.diamond_num} - - - 钻石 - - - )} + 钻石 + + {/* 会员 */} - {data?.user_id !== 314826 && data?.user_id !== 989430 && ( - - 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]" - )} + + 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]" + )} + > + - - - - - - {data?.is_a_member !== 1 - ? "开通会员保存图片" - : "尊贵的永久会员"} - - + + + {data?.is_a_member !== 1 - ? "限时优惠活动" - : "已解锁全部会员权益"} + ? "开通会员保存图片" + : "尊贵的永久会员"} - {data?.is_a_member !== 1 && ( - - - ¥{vipPrice}/永久 - - - )} + + {data?.is_a_member !== 1 + ? "限时优惠活动" + : "已解锁全部会员权益"} + - - )} + {data?.is_a_member !== 1 && ( + + + ¥{vipPrice}/永久 + + + )} + + {/* 纵向列表设置区 */} {data?.role === 3 && ( - {data?.user_id !== 314826 && data?.user_id !== 989430 && ( - navigation.navigate("Wallet")} - style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")} - > - - - 我的钱包 - - - - )} - {data?.user_id !== 314826 && data?.user_id !== 989430 && ( - navigation.navigate("UnlockedWechat")} - style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")} - > - - - 已解锁微信 - - - - )} - {data?.user_id !== 314826 && data?.user_id !== 989430 && ( - navigation.navigate("StreamerVerification")} - style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")} - > - - - 申请入驻 - - - - )} + navigation.navigate("Wallet")} + style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")} + > + + + 我的钱包 + + + + navigation.navigate("UnlockedWechat")} + style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")} + > + + + 已解锁微信 + + + + navigation.navigate("StreamerVerification")} + style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")} + > + + + 申请入驻 + + + navigation.navigate("MessageDetail", { diff --git a/screeens/StreamerProfile/index.jsx b/screeens/StreamerProfile/index.jsx index 1a28978..5b7771c 100644 --- a/screeens/StreamerProfile/index.jsx +++ b/screeens/StreamerProfile/index.jsx @@ -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]")} > {/* 空间动态 */} - {spaceData && - spaceData?.previews?.images?.length > 0 && - !isTester && ( - - + {spaceData && spaceData?.previews?.images?.length > 0 && ( + + + + navigation.navigate("SpaceIntroduce", { + mid: route.params.mid, + }) + : () => + navigation.navigate("StreamerSpace", { + mid: route.params.mid, + }) + } + style={tailwind( + "flex flex-row justify-between items-center" + )} + > + + 空间动态 + + + + 查看{spaceData?.zone_moment_count}条 + + + + + - - 空间动态 - - - - 查看{spaceData?.zone_moment_count}条 - - - + {spaceData?.previews?.images?.map((item, index) => { + if (index > 3) return; + return ( + + ); + })} - - - 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 ( - - ); - })} - - - - + - )} + + + )} {/* 动态 */} {!spaceData && postsData.length !== 0 && ( @@ -820,29 +807,25 @@ export default function StreamerProfile({ navigation, route }) { 来这找我玩 - {!isTester && ( - + + 微信: + setIsAddWechatModalVisible(true)} + style={tailwind("text-sm text-[#3B69B8] ml-1")} + numberOfLines={1} + ellipsizeMode="tail" > - - - 微信: - - setIsAddWechatModalVisible(true)} - style={tailwind("text-sm text-[#3B69B8] ml-1")} - numberOfLines={1} - ellipsizeMode="tail" - > - 点击查看 - - - )} + 点击查看 + + {data?.platforms?.map((item) => ( ))} @@ -880,18 +863,16 @@ export default function StreamerProfile({ navigation, route }) { > 私聊 - {!isTester && ( - setIsAddWechatModalVisible(true)} - style={tailwind( - "flex-row flex-1 bg-[#FF669E] items-center justify-center h-10 rounded-full" - )} - > - - 添加微信 - - - )} + setIsAddWechatModalVisible(true)} + style={tailwind( + "flex-row flex-1 bg-[#FF669E] items-center justify-center h-10 rounded-full" + )} + > + + 添加微信 + + {/* 拉黑、举报Modal */} diff --git a/screeens/StreamerProfile/skeleton.jsx b/screeens/StreamerProfile/skeleton.jsx index 33fa715..5acfc43 100644 --- a/screeens/StreamerProfile/skeleton.jsx +++ b/screeens/StreamerProfile/skeleton.jsx @@ -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 ( 私聊 - {!isTester && ( - - - 添加微信 - - - )} + + + 添加微信 + + );