更新Company页面的UI为FUI风格

This commit is contained in:
2025-12-17 20:54:00 +08:00
parent c393e31eec
commit 318a83434a
2 changed files with 30 additions and 0 deletions

View File

@@ -116,6 +116,28 @@ const CompanyContent = memo<CompanyContentProps>(({ stockCode, onTabChange }) =>
CompanyContent.displayName = 'CompanyContent';
// ============================================
// 网页标题 Hook
// ============================================
const useDocumentTitle = (stockCode: string, stockName?: string) => {
useEffect(() => {
const baseTitle = '价值前沿';
if (stockName) {
document.title = `${stockName}(${stockCode}) - ${baseTitle}`;
} else if (stockCode) {
document.title = `${stockCode} - ${baseTitle}`;
} else {
document.title = baseTitle;
}
// 组件卸载时恢复默认标题
return () => {
document.title = baseTitle;
};
}, [stockCode, stockName]);
};
// ============================================
// 主页面组件
// ============================================
@@ -145,6 +167,9 @@ const CompanyIndex: React.FC = () => {
const { trackStockSearched, trackTabChanged, trackWatchlistAdded, trackWatchlistRemoved } = companyEvents;
// 设置网页标题
useDocumentTitle(stockCode, stockInfo?.stock_name);
// 股票代码变化追踪
useEffect(() => {
if (stockCode !== prevStockCodeRef.current) {