This commit is contained in:
eric
2026-03-16 20:39:19 -05:00
parent 473fa1a1cf
commit 9d45fede7f
4 changed files with 22 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
"use client";
import { useState, useEffect, useRef, type FormEvent } from "react";
import { usePathname } from "next/navigation";
import { useCompleteOrderPolling } from "@/app/hooks/useCompleteOrderPolling";
import Link from "next/link";
import ThemeToggle from "../components/ThemeToggle";
@@ -524,6 +525,15 @@ export default function JoinPage() {
retryDelays: [500, 1000, 1500, 2500, 4000],
});
const pathname = usePathname();
// 每次进入报名页时强制重新拉取,避免预取/缓存导致显示旧状态
useEffect(() => {
if (pathname === "/join") {
const w = (localStorage.getItem(WECHAT_STORAGE_KEY) || "").trim();
if (w && WECHAT_REGEX.test(w)) fetchByWechatRef.current(w);
}
}, [pathname]);
// 微信内/手机浏览器支付后:页面可能被关闭或跳转,返回时 notify 可能未到。轮询 fetchByWechat 检测支付成功
// 手机浏览器唤醒微信 app 支付完成后,用户可能直接回 /join故 h5 也需轮询(参考 nomadvip
useEffect(() => {