v ? `日期: ${v}` : '',
@@ -141,6 +140,8 @@ const Community = () => {
// 加载事件列表
const loadEvents = useCallback(async (page = 1) => {
+ console.log('[Community] loadEvents 被调用,页码:', page);
+ console.log('[Community] 调用栈:', new Error().stack);
setLoading(true);
try {
const filters = getFiltersFromUrl();
@@ -255,19 +256,23 @@ const Community = () => {
});
// 初始化加载
+ // 注意: 只监听 searchParams 变化,不监听 loadEvents 等函数
+ // 这是为了避免 StockDetailPanel 打开时触发不必要的重新加载
+ // 如果未来 loadEvents 添加了新的状态依赖,需要在此处同步更新
useEffect(() => {
+ console.log('[Community] useEffect 触发,searchParams 变化:', searchParams.toString());
const page = parseInt(searchParams.get('page') || '1', 10);
loadEvents(page);
loadPopularKeywords();
loadHotEvents();
- }, [searchParams, loadEvents, loadPopularKeywords, loadHotEvents]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [searchParams]); // 只监听 URL 参数变化
return (
- {/* 导航栏 - 可以保留原有的或改用Chakra UI版本 */}
-
+ {/* 导航栏已由 MainLayout 提供 */}
{/* Midjourney风格英雄区域 */}
diff --git a/src/views/Concept/index.js b/src/views/Concept/index.js
index 404529e9..3e103ed0 100644
--- a/src/views/Concept/index.js
+++ b/src/views/Concept/index.js
@@ -83,8 +83,7 @@ import { BsGraphUp, BsLightningFill } from 'react-icons/bs';
import { keyframes } from '@emotion/react';
import ConceptTimelineModal from './ConceptTimelineModal';
import ConceptStatsPanel from './components/ConceptStatsPanel';
-// 导入导航栏组件
-import HomeNavbar from '../../components/Navbars/HomeNavbar';
+// 导航栏已由 MainLayout 提供,无需在此导入
// 导入订阅权限管理
import { useSubscription } from '../../hooks/useSubscription';
import SubscriptionUpgradeModal from '../../components/SubscriptionUpgradeModal';
@@ -1080,8 +1079,7 @@ const ConceptCenter = () => {
return (
- {/* 导航栏 */}
-
+ {/* 导航栏已由 MainLayout 提供 */}
{/* Hero Section */}
- {/* 导航栏 */}
-
-
+ {/* 导航栏已由 MainLayout 提供 */}
+
{/* 顶部Header */}
diff --git a/src/views/StockOverview/index.js b/src/views/StockOverview/index.js
index d5b4225c..8984974c 100644
--- a/src/views/StockOverview/index.js
+++ b/src/views/StockOverview/index.js
@@ -61,7 +61,8 @@ import { FaChartLine, FaFire, FaRocket, FaBrain, FaCalendarAlt, FaChevronRight,
import { BsGraphUp, BsLightningFill } from 'react-icons/bs';
import { keyframes } from '@emotion/react';
import * as echarts from 'echarts';
-import HomeNavbar from '../../components/Navbars/HomeNavbar';
+// Navigation bar now provided by MainLayout
+// import HomeNavbar from '../../components/Navbars/HomeNavbar';
// 动画定义
const pulseAnimation = keyframes`
@@ -524,10 +525,9 @@ const StockOverview = () => {
return (
- {/* 导航栏 */}
-
+ {/* 导航栏已由 MainLayout 提供 */}
+
-
{/* Hero Section */}
- {/* 导航栏 */}
-
-
+ {/* 导航栏已由 MainLayout 提供 */}
{!isAuthenticated ? (