From 93e54c7afcbde138a6c9b56a7101c6c548973359 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 4 Jan 2024 13:20:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AD=8C=E6=9B=B2=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E5=B0=81=E9=9D=A2=E5=9C=A8=E6=97=8B=E8=BD=AC?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E5=90=8E=E5=88=87=E6=AD=8C=E4=B8=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/screens/PlayDetail/Horizontal/Pic.tsx | 5 ++++- src/screens/PlayDetail/Vertical/Pic.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/screens/PlayDetail/Horizontal/Pic.tsx b/src/screens/PlayDetail/Horizontal/Pic.tsx index e06f5b5..8eabbdb 100644 --- a/src/screens/PlayDetail/Horizontal/Pic.tsx +++ b/src/screens/PlayDetail/Horizontal/Pic.tsx @@ -11,6 +11,7 @@ import { BTN_WIDTH } from './MoreBtn/Btn' import { marginLeft } from './constant' import Image from '@/components/common/Image' import { useStatusbarHeight } from '@/store/common/hook' +import commonState from '@/store/common/state' export default memo(({ componentId }: { componentId: string }) => { @@ -21,7 +22,9 @@ export default memo(({ componentId }: { componentId: string }) => { const [animated, setAnimated] = useState(false) const [pic, setPic] = useState(musicInfo.pic) useEffect(() => { - if (animated) setPic(musicInfo.pic) + if (commonState.componentIds.playDetail) setAnimated(true) + else if (!animated) return + setPic(musicInfo.pic) }, [musicInfo.pic, animated]) useNavigationComponentDidAppear(componentId, () => { diff --git a/src/screens/PlayDetail/Vertical/Pic.tsx b/src/screens/PlayDetail/Vertical/Pic.tsx index 77c13ba..5614382 100644 --- a/src/screens/PlayDetail/Vertical/Pic.tsx +++ b/src/screens/PlayDetail/Vertical/Pic.tsx @@ -9,6 +9,7 @@ import { useNavigationComponentDidAppear } from '@/navigation' import { HEADER_HEIGHT } from './components/Header' import Image from '@/components/common/Image' import { useStatusbarHeight } from '@/store/common/hook' +import commonState from '@/store/common/state' export default ({ componentId }: { componentId: string }) => { @@ -19,7 +20,9 @@ export default ({ componentId }: { componentId: string }) => { const [animated, setAnimated] = useState(false) const [pic, setPic] = useState(musicInfo.pic) useEffect(() => { - if (animated) setPic(musicInfo.pic) + if (commonState.componentIds.playDetail) setAnimated(true) + else if (!animated) return + setPic(musicInfo.pic) }, [musicInfo.pic, animated]) useNavigationComponentDidAppear(componentId, () => {