From aad1d35eb1c23022367bb6e007ae857d7653bbbf Mon Sep 17 00:00:00 2001 From: yezian Date: Tue, 6 Feb 2024 20:34:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=81=AE=E6=8C=A1=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=A8=A1=E7=B3=8A=EF=BC=9B=E4=BC=98=E5=8C=96=E5=8A=A8?= =?UTF-8?q?=E6=80=81tab=E5=BA=95=E9=83=A8=E6=96=87=E6=A1=88=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=85=E4=BA=86=E4=BC=9A=E5=91=98=E5=89=8D?= =?UTF-8?q?=E5=9B=9B=E6=9D=A1=E5=8A=A8=E6=80=81=E4=BC=9A=E9=87=8D=E5=A4=8D?= =?UTF-8?q?bug=EF=BC=9B=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E5=88=B01.2.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 2 +- components/Post/index.jsx | 136 ++++++--------------------- screeens/Posts/FeedPosts/index.jsx | 15 ++- screeens/Posts/FollowPosts/index.jsx | 2 +- screeens/StreamerProfile/index.jsx | 23 ++--- 5 files changed, 45 insertions(+), 133 deletions(-) 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 && (