diff --git a/app.json b/app.json index e194aeb..0b3512d 100644 --- a/app.json +++ b/app.json @@ -2,7 +2,7 @@ "expo": { "name": "铁粉空间", "slug": "ironfans", - "version": "1.2.2", + "version": "1.2.3", "orientation": "portrait", "icon": "./assets/icon.png", "splash": { diff --git a/components/Post/index.jsx b/components/Post/index.jsx index 0f840af..be9570d 100644 --- a/components/Post/index.jsx +++ b/components/Post/index.jsx @@ -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 }) { > - {data.streamer_ext?.name} + {data?.streamer_ext?.name} - {data.text} + {data?.text} {/* 媒体展示 */} @@ -262,74 +261,6 @@ function ImageDisplay({ blur, media }) { const [imageIndex, setImageIndex] = useState(); const images = media.map((item) => ({ url: item.urls[0] })); - if (blur) { - return ( - - {media.length > 1 ? ( - media.map((item, index) => ( - - navigation.navigate("WebWithoutHeader", { - uri: process.env.EXPO_PUBLIC_WEB_URL + "/vip", - }) - } - style={{ - aspectRatio: 1, - ...tailwind("basis-1/3 p-0.5 relative"), - }} - > - - - - - - )) - ) : ( - - navigation.navigate("WebWithoutHeader", { - uri: process.env.EXPO_PUBLIC_WEB_URL + "/vip", - }) - } - style={{ - width: 200, - height: 250, - ...tailwind("relative"), - }} - > - - - - - - )} - - ); - } - if (images.length === 0) return null; return ( @@ -339,14 +270,22 @@ function ImageDisplay({ blur, media }) { { - 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") }} > { - 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 }) { > - - - - - - ); - } - return ( 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")} > - 开通会员订阅全部 + 即刻订阅全部精选内容 - 开通会员订阅全部 + 即刻订阅全部精选内容 - {blur && ( - - - - )} - {index === 3 && ( + {index === 3 && postsData.length > 4 && (