更新Company页面的UI为FUI风格

This commit is contained in:
2025-12-17 21:41:57 +08:00
parent 067b720263
commit 0d150f7b26
5 changed files with 32 additions and 1 deletions

17
app.py
View File

@@ -8686,6 +8686,8 @@ def get_stock_quote_detail(stock_code):
'eps': None,
'market_cap': None,
'circ_mv': None,
'total_shares': None, # 发行总股本(亿股)
'float_shares': None, # 流通股本(亿股)
'turnover_rate': None,
'week52_high': None,
'week52_low': None,
@@ -8746,9 +8748,22 @@ def get_stock_quote_detail(stock_code):
result_data['industry_l1'] = row.get('industry_l1') or ''
result_data['industry'] = row.get('sw_industry_l2') or row.get('sw_industry_l1') or ''
# 计算流通市值(亿元)
# 计算股本和市值
total_shares = float(row.get('total_shares') or 0)
float_shares = float(row.get('float_shares') or 0)
close_price = float(row.get('close_price') or 0)
# 发行总股本(亿股)
if total_shares > 0:
total_shares_yi = total_shares / 100000000 # 转为亿股
result_data['total_shares'] = round(total_shares_yi, 2)
# 流通股本(亿股)
if float_shares > 0:
float_shares_yi = float_shares / 100000000 # 转为亿股
result_data['float_shares'] = round(float_shares_yi, 2)
# 计算流通市值(亿元)
if float_shares > 0 and close_price > 0:
circ_mv = (float_shares * close_price) / 100000000 # 转为亿
result_data['circ_mv'] = round(circ_mv, 2)

View File

@@ -13,6 +13,8 @@ export interface KeyMetricsProps {
eps?: number;
pb: number;
marketCap: string;
totalShares?: number; // 发行总股本(亿股)
floatShares?: number; // 流通股本(亿股)
week52Low: number;
week52High: number;
}
@@ -22,6 +24,8 @@ export const KeyMetrics: React.FC<KeyMetricsProps> = memo(({
eps,
pb,
marketCap,
totalShares,
floatShares,
week52Low,
week52High,
}) => {
@@ -62,6 +66,12 @@ export const KeyMetrics: React.FC<KeyMetricsProps> = memo(({
{marketCap}
</Text>
</HStack>
<HStack justify="space-between">
<Text color={labelColor}></Text>
<Text color={valueColor} fontWeight="bold" fontSize="16px">
{totalShares ? `${totalShares}亿股` : '-'}
</Text>
</HStack>
<HStack justify="space-between">
<Text color={labelColor}>52</Text>
<Text color={valueColor} fontWeight="bold" fontSize="16px">

View File

@@ -38,6 +38,8 @@ const transformQuoteData = (apiData: any, stockCode: string): StockQuoteCardData
eps: apiData.eps || apiData.basic_eps || undefined,
pb: apiData.pb || apiData.pb_mrq || 0,
marketCap: apiData.market_cap || apiData.marketCap || apiData.circ_mv || '0',
totalShares: apiData.total_shares || apiData.totalShares || undefined,
floatShares: apiData.float_shares || apiData.floatShares || undefined,
week52Low: apiData.week52_low || apiData.week52Low || 0,
week52High: apiData.week52_high || apiData.week52High || 0,

View File

@@ -133,6 +133,8 @@ const StockQuoteCard: React.FC<StockQuoteCardProps> = ({
eps={quoteData.eps}
pb={quoteData.pb}
marketCap={quoteData.marketCap}
totalShares={quoteData.totalShares}
floatShares={quoteData.floatShares}
week52Low={quoteData.week52Low}
week52High={quoteData.week52High}
/>

View File

@@ -29,6 +29,8 @@ export interface StockQuoteCardData {
eps?: number; // 每股收益
pb: number; // 市净率
marketCap: string; // 流通市值(已格式化,如 "2.73万亿"
totalShares?: number; // 发行总股本(亿股)
floatShares?: number; // 流通股本(亿股)
week52Low: number; // 52周最低
week52High: number; // 52周最高