Compare commits
1 Commits
main
...
ios-new-ne
Author | SHA1 | Date |
---|---|---|
yezian | 6862ae92f9 |
|
@ -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,36 +188,7 @@ 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>
|
||||
)
|
||||
}
|
||||
onSave={(url) => {
|
||||
saveImage(url);
|
||||
}}
|
||||
saveToLocalByLongPress
|
||||
saveToLocalByLongPress={false}
|
||||
menus={MenusComponent}
|
||||
loadingRender={() => <ActivityIndicator size="large" />}
|
||||
/>
|
||||
|
|
|
@ -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,50 +165,6 @@ 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 ? (
|
||||
<TouchableOpacity
|
||||
onPress={() =>
|
||||
navigation.navigate("SpaceIntroduce", { mid: data?.mid })
|
||||
}
|
||||
style={tailwind("flex flex-row items-center")}
|
||||
>
|
||||
<NativeImage
|
||||
source={require("../../assets/icon/others/space_new_post.png")}
|
||||
/>
|
||||
<Text style={tailwind("text-[#FF669E] font-medium text-xs")}>
|
||||
空间
|
||||
{formatZoneUpdateTime(
|
||||
data?.streamer_ext
|
||||
?.days_elapsed_since_the_last_zones_update
|
||||
)}
|
||||
有更新
|
||||
</Text>
|
||||
<NativeImage
|
||||
source={require("../../assets/icon/others/pinklink.png")}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
) : (
|
||||
data?.streamer_ext?.zones?.length !== 0 &&
|
||||
!isTester && (
|
||||
<TouchableOpacity
|
||||
onPress={() =>
|
||||
navigation.navigate("SpaceIntroduce", { mid: data?.mid })
|
||||
}
|
||||
style={tailwind("flex flex-row items-center")}
|
||||
>
|
||||
<Text
|
||||
style={tailwind("text-[#FFFFFFB2] font-medium text-xs")}
|
||||
>
|
||||
查看TA的空间
|
||||
</Text>
|
||||
<NativeImage
|
||||
style={{ right: 10, transform: [{ scale: 0.75 }] }}
|
||||
source={require("../../assets/icon/32DP/smalllink.png")}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
)}
|
||||
<View style={tailwind("flex flex-row items-center ml-auto")}>
|
||||
<TouchableOpacity
|
||||
style={tailwind("flex flex-row items-center")}
|
||||
|
|
|
@ -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,6 @@ 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>
|
||||
)}
|
||||
</View>
|
||||
</TouchableWithoutFeedback>
|
||||
<Toast />
|
||||
|
|
|
@ -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,6 @@ 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")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
},
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{isCreatePostTabVisible && (
|
||||
<Tab.Screen
|
||||
name="Publish"
|
||||
|
|
|
@ -314,7 +314,7 @@ export default function My({ navigation }) {
|
|||
粉丝
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
|
||||
{data?.role === 3 && (
|
||||
<TouchableOpacity
|
||||
onPress={() => navigation.navigate("Wallet")}
|
||||
style={tailwind("flex flex-col items-center w-1/4")}
|
||||
|
@ -332,7 +332,7 @@ export default function My({ navigation }) {
|
|||
</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
|
||||
{data?.role === 3 && (
|
||||
<TouchableOpacity
|
||||
onPress={() => navigation.navigate("Wallet")}
|
||||
style={tailwind("flex flex-col items-center w-1/4")}
|
||||
|
@ -352,7 +352,7 @@ export default function My({ navigation }) {
|
|||
)}
|
||||
</View>
|
||||
{/* 会员 */}
|
||||
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
|
||||
{data?.role === 3 && (
|
||||
<TouchableOpacity
|
||||
activeOpacity={1}
|
||||
onPress={() =>
|
||||
|
@ -537,7 +537,7 @@ export default function My({ navigation }) {
|
|||
borderColor: "#2c2b2f",
|
||||
}}
|
||||
>
|
||||
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
|
||||
{data?.role === 3 && (
|
||||
<TouchableOpacity
|
||||
onPress={() => navigation.navigate("Wallet")}
|
||||
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
|
||||
|
@ -553,7 +553,7 @@ export default function My({ navigation }) {
|
|||
/>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
|
||||
{data?.role === 3 && (
|
||||
<TouchableOpacity
|
||||
onPress={() => navigation.navigate("UnlockedWechat")}
|
||||
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
|
||||
|
@ -569,7 +569,7 @@ export default function My({ navigation }) {
|
|||
/>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{data?.user_id !== 314826 && data?.user_id !== 989430 && (
|
||||
{data?.role === 3 && (
|
||||
<TouchableOpacity
|
||||
onPress={() => navigation.navigate("StreamerVerification")}
|
||||
style={tailwind("flex flex-row h-12 items-center pr-2 pl-4")}
|
||||
|
|
|
@ -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({
|
||||
|
@ -649,98 +638,8 @@ export default function StreamerProfile({ navigation, route }) {
|
|||
<View
|
||||
style={tailwind("h-[3px] rounded-full bg-[#FFFFFF26]")}
|
||||
></View>
|
||||
{/* 空间动态 */}
|
||||
{spaceData &&
|
||||
spaceData?.previews?.images?.length > 0 &&
|
||||
!isTester && (
|
||||
<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={
|
||||
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>
|
||||
</View>
|
||||
)}
|
||||
{/* 动态 */}
|
||||
{!spaceData && postsData.length !== 0 && (
|
||||
{postsData.length !== 0 && (
|
||||
<View>
|
||||
<View style={tailwind("my-4")}>
|
||||
<Text
|
||||
|
@ -820,29 +719,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]"
|
||||
)}
|
||||
>
|
||||
<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} />
|
||||
))}
|
||||
|
@ -854,6 +730,7 @@ export default function StreamerProfile({ navigation, route }) {
|
|||
<View
|
||||
style={{
|
||||
borderTopColor: "#FFFFFF26",
|
||||
gap: 20,
|
||||
...tailwind(
|
||||
"flex-row py-2 px-4 h-[4.5rem] border-t items-center justify-between"
|
||||
),
|
||||
|
@ -864,7 +741,7 @@ export default function StreamerProfile({ navigation, route }) {
|
|||
style={{
|
||||
backgroundColor: "#FFFFFF1A",
|
||||
...tailwind(
|
||||
"flex-row items-center justify-center h-10 px-6 rounded-full mr-4"
|
||||
"flex flex-1 flex-row items-center justify-center h-10 px-6 rounded-full"
|
||||
),
|
||||
}}
|
||||
>
|
||||
|
@ -875,23 +752,11 @@ export default function StreamerProfile({ navigation, route }) {
|
|||
<TouchableOpacity
|
||||
onPress={handleSendMessage}
|
||||
style={tailwind(
|
||||
"flex-row bg-[#FFFFFF1A] items-center justify-center h-10 px-6 rounded-full mr-4"
|
||||
"flex flex-1 flex-row bg-[#FFFFFF1A] items-center justify-center h-10 px-6 rounded-full"
|
||||
)}
|
||||
>
|
||||
<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>
|
||||
)}
|
||||
</View>
|
||||
{/* 拉黑、举报Modal */}
|
||||
<NavbarRightModal />
|
||||
|
|
|
@ -162,6 +162,7 @@ export default function StreamerProfileSkeleton() {
|
|||
<View
|
||||
style={{
|
||||
borderTopColor: "#FFFFFF26",
|
||||
gap: 20,
|
||||
...tailwind(
|
||||
"flex-row py-2 px-4 h-[4.5rem] border-t items-center justify-between"
|
||||
),
|
||||
|
@ -171,7 +172,7 @@ export default function StreamerProfileSkeleton() {
|
|||
style={{
|
||||
backgroundColor: "#FFFFFF1A",
|
||||
...tailwind(
|
||||
"flex-row items-center justify-center h-10 px-6 rounded-full mr-4"
|
||||
"flex flex-1 flex-row items-center justify-center h-10 px-6 rounded-full"
|
||||
),
|
||||
}}
|
||||
>
|
||||
|
@ -179,22 +180,11 @@ export default function StreamerProfileSkeleton() {
|
|||
</View>
|
||||
<View
|
||||
style={tailwind(
|
||||
"flex-row bg-[#FFFFFF1A] items-center justify-center h-10 px-6 rounded-full mr-4"
|
||||
"flex flex-1 flex-row bg-[#FFFFFF1A] items-center justify-center h-10 px-6 rounded-full"
|
||||
)}
|
||||
>
|
||||
<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>
|
||||
</View>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue