fix: price page back button display (#6060)
Some checks are pending
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions

This commit is contained in:
heheer 2025-12-09 12:18:59 +08:00 committed by GitHub
parent bdee2db74a
commit d354fd4d67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,7 @@ const PriceBox = () => {
const router = useRouter();
const backButtonRef = useRef<HTMLButtonElement>(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(() => {