community增加事件详情

This commit is contained in:
2026-01-06 18:53:15 +08:00
parent c3fad3da13
commit 6fde1b90ba
3 changed files with 77 additions and 53 deletions

View File

@@ -179,36 +179,41 @@ const ShareButton = ({
</Box> </Box>
{/* 分享选项 */} {/* 分享选项 */}
<VStack spacing={2} align="stretch"> <VStack spacing={3} align="stretch">
{/* 微信分享提示(仅在微信环境显示) */} {/* 微信分享提示 */}
{isInWechat && (
<HStack <HStack
p={3} p={3}
borderWidth="1px" borderWidth="1px"
borderColor="green.200" borderColor={isInWechat ? 'green.200' : 'blue.200'}
borderRadius="md" borderRadius="md"
bg="green.50" bg={isInWechat ? 'green.50' : 'blue.50'}
_dark={{ bg: 'green.900', borderColor: 'green.700' }} _dark={{
bg: isInWechat ? 'green.900' : 'blue.900',
borderColor: isInWechat ? 'green.700' : 'blue.700'
}}
> >
<Icon as={MessageCircle} boxSize={5} color="green.500" /> <Icon as={MessageCircle} boxSize={5} color={isInWechat ? 'green.500' : 'blue.500'} />
<VStack align="start" spacing={0} flex={1}> <VStack align="start" spacing={0} flex={1}>
<Text fontSize="sm" fontWeight="medium" color="green.700" _dark={{ color: 'green.200' }}> <Text fontSize="sm" fontWeight="medium" color={isInWechat ? 'green.700' : 'blue.700'} _dark={{ color: isInWechat ? 'green.200' : 'blue.200' }}>
微信分享 分享到微信
</Text> </Text>
<Text fontSize="xs" color="green.600" _dark={{ color: 'green.300' }}> <Text fontSize="xs" color={isInWechat ? 'green.600' : 'blue.600'} _dark={{ color: isInWechat ? 'green.300' : 'blue.300' }}>
请点击右上角...选择分享方式 {isInWechat
? '请点击右上角「...」选择分享方式'
: '复制链接后,打开微信发送给好友'}
</Text> </Text>
</VStack> </VStack>
</HStack> </HStack>
)}
{/* 复制链接 */} {/* 复制链接按钮 */}
<HStack <HStack
as="button" as="button"
p={3} p={3}
borderWidth="1px" borderWidth="1px"
borderColor={borderColor} borderColor={copied ? 'green.300' : borderColor}
borderRadius="md" borderRadius="md"
bg={copied ? 'green.50' : 'transparent'}
_dark={{ bg: copied ? 'green.900' : 'transparent' }}
_hover={{ bg: hoverBg }} _hover={{ bg: hoverBg }}
transition="all 0.2s" transition="all 0.2s"
onClick={handleCopyLink} onClick={handleCopyLink}
@@ -221,8 +226,8 @@ const ShareButton = ({
color={copied ? 'green.500' : 'gray.500'} color={copied ? 'green.500' : 'gray.500'}
/> />
<VStack align="start" spacing={0} flex={1}> <VStack align="start" spacing={0} flex={1}>
<Text fontSize="sm" fontWeight="medium"> <Text fontSize="sm" fontWeight="medium" color={copied ? 'green.600' : undefined}>
{copied ? '已复制' : '复制链接'} {copied ? '链接已复制,去微信粘贴吧!' : '复制链接'}
</Text> </Text>
<Text fontSize="xs" color="gray.500" noOfLines={1}> <Text fontSize="xs" color="gray.500" noOfLines={1}>
{link || window.location.href} {link || window.location.href}

View File

@@ -5,12 +5,11 @@
*/ */
import React, { lazy } from 'react'; import React, { lazy } from 'react';
import { Building2, Brain, TrendingUp, Wallet, FileBarChart, Newspaper } from 'lucide-react'; import { Building2, Brain, TrendingUp, Wallet, Newspaper, Layers } from 'lucide-react';
import type { CompanyTheme, TabConfig } from './types'; import type { CompanyTheme, TabConfig } from './types';
// 骨架屏组件(同步导入,用于 Suspense fallback // 骨架屏组件(同步导入,用于 Suspense fallback
import { FinancialPanoramaSkeleton } from './components/FinancialPanorama/components'; import { FinancialPanoramaSkeleton } from './components/FinancialPanorama/components';
import { ForecastSkeleton } from './components/ForecastReport/components';
import { MarketDataSkeleton } from './components/MarketDataView/components'; import { MarketDataSkeleton } from './components/MarketDataView/components';
import DynamicTrackingNavSkeleton from './components/DynamicTracking/components/DynamicTrackingNavSkeleton'; import DynamicTrackingNavSkeleton from './components/DynamicTracking/components/DynamicTrackingNavSkeleton';
import CompanyOverviewNavSkeleton from './components/CompanyOverview/BasicInfoTab/components/CompanyOverviewNavSkeleton'; import CompanyOverviewNavSkeleton from './components/CompanyOverview/BasicInfoTab/components/CompanyOverviewNavSkeleton';
@@ -61,25 +60,29 @@ const MarketDataView = lazy(() =>
const FinancialPanorama = lazy(() => const FinancialPanorama = lazy(() =>
import(/* webpackChunkName: "company-financial" */ './components/FinancialPanorama') import(/* webpackChunkName: "company-financial" */ './components/FinancialPanorama')
); );
const ForecastReport = lazy(() =>
import(/* webpackChunkName: "company-forecast" */ './components/ForecastReport')
);
const DynamicTracking = lazy(() => const DynamicTracking = lazy(() =>
import(/* webpackChunkName: "company-tracking" */ './components/DynamicTracking') import(/* webpackChunkName: "company-tracking" */ './components/DynamicTracking')
); );
const ConceptSector = lazy(() =>
import(/* webpackChunkName: "company-concept" */ './components/ConceptSector')
);
// ============================================ // ============================================
// Tab 配置 // Tab 配置
// ============================================ // ============================================
/**
* Tab 配置
* 调整:
* - 深度分析作为首位
* - 股票行情
* - 概念板块(新增)
* - 动态跟踪
* - 财务全景
* - 公司档案(移到最后)
* - 去掉"盈利预测"
*/
export const TAB_CONFIG: TabConfig[] = [ export const TAB_CONFIG: TabConfig[] = [
{
key: 'overview',
name: '公司概览',
icon: Building2,
component: CompanyOverview,
fallback: React.createElement(CompanyOverviewNavSkeleton),
},
{ {
key: 'analysis', key: 'analysis',
name: '深度分析', name: '深度分析',
@@ -94,18 +97,10 @@ export const TAB_CONFIG: TabConfig[] = [
fallback: React.createElement(MarketDataSkeleton), fallback: React.createElement(MarketDataSkeleton),
}, },
{ {
key: 'financial', key: 'concept',
name: '财务全景', name: '概念板块',
icon: Wallet, icon: Layers,
component: FinancialPanorama, component: ConceptSector,
fallback: React.createElement(FinancialPanoramaSkeleton),
},
{
key: 'forecast',
name: '盈利预测',
icon: FileBarChart,
component: ForecastReport,
fallback: React.createElement(ForecastSkeleton),
}, },
{ {
key: 'tracking', key: 'tracking',
@@ -114,6 +109,20 @@ export const TAB_CONFIG: TabConfig[] = [
component: DynamicTracking, component: DynamicTracking,
fallback: React.createElement(DynamicTrackingNavSkeleton), fallback: React.createElement(DynamicTrackingNavSkeleton),
}, },
{
key: 'financial',
name: '财务全景',
icon: Wallet,
component: FinancialPanorama,
fallback: React.createElement(FinancialPanoramaSkeleton),
},
{
key: 'overview',
name: '公司档案',
icon: Building2,
component: CompanyOverview,
fallback: React.createElement(CompanyOverviewNavSkeleton),
},
]; ];
// ============================================ // ============================================

View File

@@ -55,7 +55,7 @@ import './theme/fui-animations.css';
// 第三方库导入 // 第三方库导入
// ============================================ // ============================================
// React Router - 用于读取和修改 URL 查询参数 // React Router - 用于读取和修改 URL 查询参数
import { useSearchParams } from 'react-router-dom'; import { useSearchParams, useParams } from 'react-router-dom';
// Chakra UI - 基础布局组件 // Chakra UI - 基础布局组件
import { Box } from '@chakra-ui/react'; import { Box } from '@chakra-ui/react';
@@ -111,6 +111,15 @@ const CompanyIndex: React.FC = () => {
// ========================================== // ==========================================
// URL 参数管理 // URL 参数管理
// ========================================== // ==========================================
/**
* useParams - React Router v6 的 Hook
* 用于读取 URL 路径参数 (path params)
*
* 示例 URL: /company/300394
* params.code 返回 '300394'
*/
const params = useParams<{ code?: string }>();
/** /**
* useSearchParams - React Router v6 的 Hook * useSearchParams - React Router v6 的 Hook
* 用于读取和修改 URL 中的查询参数 (query string) * 用于读取和修改 URL 中的查询参数 (query string)
@@ -122,10 +131,11 @@ const CompanyIndex: React.FC = () => {
/** /**
* 当前股票代码 * 当前股票代码
* - 从 URL 参数 `scode` 读取 * - 优先从 URL 路径参数 `code` 读取 (支持 /company/300394 格式)
* - 其次从 URL 查询参数 `scode` 读取 (支持 /company?scode=300394 格式)
* - 默认值 '000001' (平安银行) 作为兜底 * - 默认值 '000001' (平安银行) 作为兜底
*/ */
const stockCode = searchParams.get('scode') || '000001'; const stockCode = params.code || searchParams.get('scode') || '000001';
/** /**
* 前一个股票代码的引用 * 前一个股票代码的引用