动态遮挡改为模糊;优化动态tab底部文案;修复充了会员前四条动态会重复bug;修改版本号到1.2.3

This commit is contained in:
yezian 2024-02-06 20:34:51 +08:00
parent 320aab978b
commit aad1d35eb1
5 changed files with 45 additions and 133 deletions

View File

@ -2,7 +2,7 @@
"expo": {
"name": "铁粉空间",
"slug": "ironfans",
"version": "1.2.2",
"version": "1.2.3",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {

View File

@ -5,6 +5,7 @@ import {
Modal,
TouchableWithoutFeedback,
ActivityIndicator,
Platform,
Image as NativeImage,
} from "react-native";
import React, { useEffect, useState } from "react";
@ -22,8 +23,6 @@ import { get } from "../../utils/storeInfo";
const blurhash = "LcKUTa%gOYWBYRt6xuoJo~s8V@fk";
const vipBlurhash = "LhPFg0K+TZs;G^G9n5WVEen%n,WV";
export default function Post({ isBlur, data }) {
const blur = data?.top ? false : isBlur;
@ -106,7 +105,7 @@ export default function Post({ isBlur, data }) {
>
<Image
style={tailwind("w-9 h-9 rounded-full")}
source={data.streamer_ext?.avatar?.images[0]?.urls[0]}
source={data?.streamer_ext?.avatar?.images[0]?.urls[0]}
placeholder={blurhash}
contentFit="cover"
transition={100}
@ -120,7 +119,7 @@ export default function Post({ isBlur, data }) {
style={tailwind("flex flex-row items-center justify-between")}
>
<Text style={tailwind("text-base font-medium text-white")}>
{data.streamer_ext?.name}
{data?.streamer_ext?.name}
</Text>
<TouchableOpacity
onPress={handleFollow}
@ -139,7 +138,7 @@ export default function Post({ isBlur, data }) {
</TouchableOpacity>
</View>
<Text style={tailwind("text-base text-white font-medium my-2")}>
{data.text}
{data?.text}
</Text>
{/* 媒体展示 */}
<View style={tailwind("pr-10 mb-1")}>
@ -262,74 +261,6 @@ function ImageDisplay({ blur, media }) {
const [imageIndex, setImageIndex] = useState();
const images = media.map((item) => ({ url: item.urls[0] }));
if (blur) {
return (
<View style={tailwind("flex flex-row flex-wrap")}>
{media.length > 1 ? (
media.map((item, index) => (
<TouchableOpacity
activeOpacity={1}
key={index}
onPress={() =>
navigation.navigate("WebWithoutHeader", {
uri: process.env.EXPO_PUBLIC_WEB_URL + "/vip",
})
}
style={{
aspectRatio: 1,
...tailwind("basis-1/3 p-0.5 relative"),
}}
>
<Image
style={tailwind("w-full h-full rounded")}
placeholder={vipBlurhash}
contentFit="cover"
transition={100}
cachePolicy="disk"
/>
<View
style={tailwind(
"flex absolute top-0 left-0 items-center justify-center w-full h-full"
)}
>
<NativeImage source={require("../../assets/images/lock.png")} />
</View>
</TouchableOpacity>
))
) : (
<TouchableOpacity
activeOpacity={1}
onPress={() =>
navigation.navigate("WebWithoutHeader", {
uri: process.env.EXPO_PUBLIC_WEB_URL + "/vip",
})
}
style={{
width: 200,
height: 250,
...tailwind("relative"),
}}
>
<Image
style={tailwind("w-full h-full rounded")}
placeholder={vipBlurhash}
contentFit="cover"
transition={100}
cachePolicy="disk"
/>
<View
style={tailwind(
"flex absolute top-0 left-0 items-center justify-center w-full h-full"
)}
>
<NativeImage source={require("../../assets/images/lock.png")} />
</View>
</TouchableOpacity>
)}
</View>
);
}
if (images.length === 0) return null;
return (
@ -339,14 +270,22 @@ function ImageDisplay({ blur, media }) {
<TouchableOpacity
activeOpacity={1}
key={index}
onPress={() => {
setIsModalVisible(true);
setImageIndex(index);
}}
onPress={
blur
? () =>
navigation.navigate("WebWithoutHeader", {
uri: process.env.EXPO_PUBLIC_WEB_URL + "/vip",
})
: () => {
setIsModalVisible(true);
setImageIndex(index);
}
}
style={{ aspectRatio: 1, ...tailwind("basis-1/3 p-0.5") }}
>
<Image
style={tailwind("w-full h-full rounded")}
blurRadius={blur ? (Platform.OS === "ios" ? 100 : 10) : 0}
source={item.urls[0]}
placeholder={blurhash}
contentFit="cover"
@ -358,10 +297,17 @@ function ImageDisplay({ blur, media }) {
) : (
<TouchableOpacity
activeOpacity={1}
onPress={() => {
setIsModalVisible(true);
setImageIndex(0);
}}
onPress={
blur
? () =>
navigation.navigate("WebWithoutHeader", {
uri: process.env.EXPO_PUBLIC_WEB_URL + "/vip",
})
: () => {
setIsModalVisible(true);
setImageIndex(index);
}
}
style={{
width:
media[0].w < media[0].h ? (media[0].w / media[0].h) * 200 : 250,
@ -371,6 +317,7 @@ function ImageDisplay({ blur, media }) {
>
<Image
style={tailwind("w-full h-full rounded")}
blurRadius={blur ? (Platform.OS === "ios" ? 130 : 10) : 0}
source={media[0].urls[0]}
placeholder={blurhash}
contentFit="contain"
@ -400,32 +347,6 @@ function ImageDisplay({ blur, media }) {
function PosterDisplay({ blur, media }) {
const tailwind = useTailwind();
if (blur) {
return (
<View
style={{
width: 200,
height: 250,
}}
>
<Image
style={tailwind("w-full h-full rounded")}
placeholder={vipBlurhash}
contentFit="cover"
transition={100}
cachePolicy="disk"
/>
<View
style={tailwind(
"flex absolute w-full h-full left-0 top-0 z-10 justify-center items-center"
)}
>
<NativeImage source={require("../../assets/images/lock.png")} />
</View>
</View>
);
}
return (
<View
style={{
@ -441,6 +362,7 @@ function PosterDisplay({ blur, media }) {
>
<Image
style={tailwind("w-full h-full rounded")}
blurRadius={blur ? (Platform.OS === "ios" ? 130 : 10) : 0}
source={media.cover_urls[0]}
placeholder={blurhash}
contentFit="cover"

View File

@ -62,7 +62,7 @@ export default function FeedPosts({ blur }) {
const role = account.role;
const isVip = account.is_a_member;
if (role !== 0 || isVip === 1) {
return;
return [];
}
try {
const apiUrl = process.env.EXPO_PUBLIC_API_URL;
@ -92,11 +92,11 @@ export default function FeedPosts({ blur }) {
text1: _data.msg,
topOffset: 60,
});
return;
return [];
}
//id
if (!_data.data.app_config.config_value) return;
if (!_data.data.app_config.config_value) return [];
const intIds = _data.data.app_config.config_value?.map((item) =>
parseInt(item, 10)
);
@ -124,7 +124,7 @@ export default function FeedPosts({ blur }) {
text1: _data2.msg,
topOffset: 60,
});
return;
return [];
}
const topPostsData = _data2.data.list.map((item) => {
return { ...item, top: true };
@ -132,6 +132,7 @@ export default function FeedPosts({ blur }) {
return topPostsData;
} catch (error) {
console.error(error);
return [];
}
};
@ -189,10 +190,6 @@ export default function FeedPosts({ blur }) {
}
if (type === "top") {
const topPosts = await getTopPostsData();
if (!topPosts) {
setData((prev) => _data.data.list);
return;
}
setData((prev) => [...topPosts, ..._data.data.list]);
} else {
setData((prev) => [...prev, ..._data.data.list]);
@ -273,7 +270,7 @@ export default function FeedPosts({ blur }) {
ellipsizeMode="tail"
style={tailwind("text-[#FF669E] text-base font-medium ml-1")}
>
开通会员订阅全部
即刻订阅全部精选内容
</Text>
</View>
<View

View File

@ -228,7 +228,7 @@ export default function FollowPosts({ blur }) {
ellipsizeMode="tail"
style={tailwind("text-[#FF669E] text-base font-medium ml-1")}
>
开通会员订阅全部
即刻订阅全部精选内容
</Text>
</View>
<View

View File

@ -8,6 +8,7 @@ import {
Text,
Alert,
ScrollView,
Platform,
Image as NativeImage,
} from "react-native";
import React, { useState, useEffect } from "react";
@ -31,7 +32,7 @@ import StreamerProfileSkeleton from "./skeleton";
import { generateSignature } from "../../utils/crypto";
import Svg, { Path } from "react-native-svg";
const vipBlurhash = "LhPFg0K+TZs;G^G9n5WVEen%n,WV";
const blurhash = "LcKUTa%gOYWBYRt6xuoJo~s8V@fk";
export default function StreamerProfile({ navigation, route }) {
const screenWidth = Dimensions.get("window").width;
@ -673,24 +674,16 @@ export default function StreamerProfile({ navigation, route }) {
<View style={tailwind("relative w-full h-full")}>
<Image
style={tailwind("w-full h-full rounded")}
placeholder={vipBlurhash}
source={blur ? null : mediaUrl}
blurRadius={
blur ? (Platform.OS === "ios" ? 130 : 10) : 0
}
placeholder={blurhash}
source={mediaUrl}
contentFit="cover"
transition={100}
cachePolicy="disk"
/>
{blur && (
<View
style={tailwind(
"w-full h-full rounded absolute top-0 left-0 flex justify-center items-center"
)}
>
<NativeImage
source={require("../../assets/images/lock.png")}
/>
</View>
)}
{index === 3 && (
{index === 3 && postsData.length > 4 && (
<View
style={{
backgroundColor: "rgba(0,0,0,0.5)",