community增加事件详情
This commit is contained in:
@@ -179,36 +179,41 @@ const ShareButton = ({
|
||||
</Box>
|
||||
|
||||
{/* 分享选项 */}
|
||||
<VStack spacing={2} align="stretch">
|
||||
{/* 微信分享提示(仅在微信环境显示) */}
|
||||
{isInWechat && (
|
||||
<HStack
|
||||
p={3}
|
||||
borderWidth="1px"
|
||||
borderColor="green.200"
|
||||
borderRadius="md"
|
||||
bg="green.50"
|
||||
_dark={{ bg: 'green.900', borderColor: 'green.700' }}
|
||||
>
|
||||
<Icon as={MessageCircle} boxSize={5} color="green.500" />
|
||||
<VStack align="start" spacing={0} flex={1}>
|
||||
<Text fontSize="sm" fontWeight="medium" color="green.700" _dark={{ color: 'green.200' }}>
|
||||
微信分享
|
||||
</Text>
|
||||
<Text fontSize="xs" color="green.600" _dark={{ color: 'green.300' }}>
|
||||
请点击右上角「...」选择分享方式
|
||||
</Text>
|
||||
</VStack>
|
||||
</HStack>
|
||||
)}
|
||||
<VStack spacing={3} align="stretch">
|
||||
{/* 微信分享提示 */}
|
||||
<HStack
|
||||
p={3}
|
||||
borderWidth="1px"
|
||||
borderColor={isInWechat ? 'green.200' : 'blue.200'}
|
||||
borderRadius="md"
|
||||
bg={isInWechat ? 'green.50' : 'blue.50'}
|
||||
_dark={{
|
||||
bg: isInWechat ? 'green.900' : 'blue.900',
|
||||
borderColor: isInWechat ? 'green.700' : 'blue.700'
|
||||
}}
|
||||
>
|
||||
<Icon as={MessageCircle} boxSize={5} color={isInWechat ? 'green.500' : 'blue.500'} />
|
||||
<VStack align="start" spacing={0} flex={1}>
|
||||
<Text fontSize="sm" fontWeight="medium" color={isInWechat ? 'green.700' : 'blue.700'} _dark={{ color: isInWechat ? 'green.200' : 'blue.200' }}>
|
||||
分享到微信
|
||||
</Text>
|
||||
<Text fontSize="xs" color={isInWechat ? 'green.600' : 'blue.600'} _dark={{ color: isInWechat ? 'green.300' : 'blue.300' }}>
|
||||
{isInWechat
|
||||
? '请点击右上角「...」选择分享方式'
|
||||
: '复制链接后,打开微信发送给好友'}
|
||||
</Text>
|
||||
</VStack>
|
||||
</HStack>
|
||||
|
||||
{/* 复制链接 */}
|
||||
{/* 复制链接按钮 */}
|
||||
<HStack
|
||||
as="button"
|
||||
p={3}
|
||||
borderWidth="1px"
|
||||
borderColor={borderColor}
|
||||
borderColor={copied ? 'green.300' : borderColor}
|
||||
borderRadius="md"
|
||||
bg={copied ? 'green.50' : 'transparent'}
|
||||
_dark={{ bg: copied ? 'green.900' : 'transparent' }}
|
||||
_hover={{ bg: hoverBg }}
|
||||
transition="all 0.2s"
|
||||
onClick={handleCopyLink}
|
||||
@@ -221,8 +226,8 @@ const ShareButton = ({
|
||||
color={copied ? 'green.500' : 'gray.500'}
|
||||
/>
|
||||
<VStack align="start" spacing={0} flex={1}>
|
||||
<Text fontSize="sm" fontWeight="medium">
|
||||
{copied ? '已复制' : '复制链接'}
|
||||
<Text fontSize="sm" fontWeight="medium" color={copied ? 'green.600' : undefined}>
|
||||
{copied ? '链接已复制,去微信粘贴吧!' : '复制链接'}
|
||||
</Text>
|
||||
<Text fontSize="xs" color="gray.500" noOfLines={1}>
|
||||
{link || window.location.href}
|
||||
|
||||
@@ -5,12 +5,11 @@
|
||||
*/
|
||||
|
||||
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';
|
||||
|
||||
// 骨架屏组件(同步导入,用于 Suspense fallback)
|
||||
import { FinancialPanoramaSkeleton } from './components/FinancialPanorama/components';
|
||||
import { ForecastSkeleton } from './components/ForecastReport/components';
|
||||
import { MarketDataSkeleton } from './components/MarketDataView/components';
|
||||
import DynamicTrackingNavSkeleton from './components/DynamicTracking/components/DynamicTrackingNavSkeleton';
|
||||
import CompanyOverviewNavSkeleton from './components/CompanyOverview/BasicInfoTab/components/CompanyOverviewNavSkeleton';
|
||||
@@ -61,25 +60,29 @@ const MarketDataView = lazy(() =>
|
||||
const FinancialPanorama = lazy(() =>
|
||||
import(/* webpackChunkName: "company-financial" */ './components/FinancialPanorama')
|
||||
);
|
||||
const ForecastReport = lazy(() =>
|
||||
import(/* webpackChunkName: "company-forecast" */ './components/ForecastReport')
|
||||
);
|
||||
const DynamicTracking = lazy(() =>
|
||||
import(/* webpackChunkName: "company-tracking" */ './components/DynamicTracking')
|
||||
);
|
||||
const ConceptSector = lazy(() =>
|
||||
import(/* webpackChunkName: "company-concept" */ './components/ConceptSector')
|
||||
);
|
||||
|
||||
// ============================================
|
||||
// Tab 配置
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* Tab 配置
|
||||
* 调整:
|
||||
* - 深度分析作为首位
|
||||
* - 股票行情
|
||||
* - 概念板块(新增)
|
||||
* - 动态跟踪
|
||||
* - 财务全景
|
||||
* - 公司档案(移到最后)
|
||||
* - 去掉"盈利预测"
|
||||
*/
|
||||
export const TAB_CONFIG: TabConfig[] = [
|
||||
{
|
||||
key: 'overview',
|
||||
name: '公司概览',
|
||||
icon: Building2,
|
||||
component: CompanyOverview,
|
||||
fallback: React.createElement(CompanyOverviewNavSkeleton),
|
||||
},
|
||||
{
|
||||
key: 'analysis',
|
||||
name: '深度分析',
|
||||
@@ -94,18 +97,10 @@ export const TAB_CONFIG: TabConfig[] = [
|
||||
fallback: React.createElement(MarketDataSkeleton),
|
||||
},
|
||||
{
|
||||
key: 'financial',
|
||||
name: '财务全景',
|
||||
icon: Wallet,
|
||||
component: FinancialPanorama,
|
||||
fallback: React.createElement(FinancialPanoramaSkeleton),
|
||||
},
|
||||
{
|
||||
key: 'forecast',
|
||||
name: '盈利预测',
|
||||
icon: FileBarChart,
|
||||
component: ForecastReport,
|
||||
fallback: React.createElement(ForecastSkeleton),
|
||||
key: 'concept',
|
||||
name: '概念板块',
|
||||
icon: Layers,
|
||||
component: ConceptSector,
|
||||
},
|
||||
{
|
||||
key: 'tracking',
|
||||
@@ -114,6 +109,20 @@ export const TAB_CONFIG: TabConfig[] = [
|
||||
component: DynamicTracking,
|
||||
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),
|
||||
},
|
||||
];
|
||||
|
||||
// ============================================
|
||||
|
||||
@@ -55,7 +55,7 @@ import './theme/fui-animations.css';
|
||||
// 第三方库导入
|
||||
// ============================================
|
||||
// React Router - 用于读取和修改 URL 查询参数
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { useSearchParams, useParams } from 'react-router-dom';
|
||||
// Chakra UI - 基础布局组件
|
||||
import { Box } from '@chakra-ui/react';
|
||||
|
||||
@@ -111,6 +111,15 @@ const CompanyIndex: React.FC = () => {
|
||||
// ==========================================
|
||||
// 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
|
||||
* 用于读取和修改 URL 中的查询参数 (query string)
|
||||
@@ -122,10 +131,11 @@ const CompanyIndex: React.FC = () => {
|
||||
|
||||
/**
|
||||
* 当前股票代码
|
||||
* - 从 URL 参数 `scode` 读取
|
||||
* - 优先从 URL 路径参数 `code` 读取 (支持 /company/300394 格式)
|
||||
* - 其次从 URL 查询参数 `scode` 读取 (支持 /company?scode=300394 格式)
|
||||
* - 默认值 '000001' (平安银行) 作为兜底
|
||||
*/
|
||||
const stockCode = searchParams.get('scode') || '000001';
|
||||
const stockCode = params.code || searchParams.get('scode') || '000001';
|
||||
|
||||
/**
|
||||
* 前一个股票代码的引用
|
||||
|
||||
Reference in New Issue
Block a user