From d354fd4d6742e0a53dcf8cb8c5b6a13980081da8 Mon Sep 17 00:00:00 2001 From: heheer Date: Tue, 9 Dec 2025 12:18:59 +0800 Subject: [PATCH] fix: price page back button display (#6060) --- projects/app/src/pages/price/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/app/src/pages/price/index.tsx b/projects/app/src/pages/price/index.tsx index 331b8bfc3..1b6857f3a 100644 --- a/projects/app/src/pages/price/index.tsx +++ b/projects/app/src/pages/price/index.tsx @@ -21,7 +21,7 @@ const PriceBox = () => { const router = useRouter(); const backButtonRef = useRef(null); - const [isButtonInView, setIsButtonInView] = useState(true); + const [isButtonInView, setIsButtonInView] = useState(false); const { data: teamSubPlan } = useRequest2(getTeamPlanStatus, { manual: false, @@ -30,6 +30,11 @@ const PriceBox = () => { // TODO: 封装成一个 hook 来判断滚动态 useEffect(() => { + if (!teamSubPlan?.standard?.teamId) { + setIsButtonInView(false); + return; + } + const observer = new IntersectionObserver( ([entry]) => { setIsButtonInView(entry.isIntersecting); @@ -50,7 +55,7 @@ const PriceBox = () => { } observer.disconnect(); }; - }, []); + }, [teamSubPlan?.standard?.teamId]); const onPaySuccess = () => { setTimeout(() => {