update pay ui

This commit is contained in:
2025-12-11 13:16:03 +08:00
parent 7d1c89a6a4
commit 39ad523dad
3 changed files with 20 additions and 15 deletions

View File

@@ -152,8 +152,8 @@ const handleSZSEBatchMessage = (
hasUpdate = true;
if (isIndexType) {
// 指数数据格式
const prevClose = quoteData.prev_close ?? 0;
// 指数数据格式(兼容多种字段名)
const prevClose = quoteData.prev_close_px ?? quoteData.prev_close ?? quoteData.prevClose ?? 0;
const currentIndex = quoteData.current_index ?? quoteData.last_px ?? 0;
updated[fullCode] = {
@@ -165,8 +165,8 @@ const handleSZSEBatchMessage = (
high: quoteData.high_index ?? quoteData.high_px ?? 0,
low: quoteData.low_index ?? quoteData.low_px ?? 0,
close: quoteData.close_index,
volume: quoteData.volume ?? 0,
amount: quoteData.amount ?? 0,
volume: quoteData.total_volume_trade ?? quoteData.volume ?? 0,
amount: quoteData.total_value_trade ?? quoteData.amount ?? 0,
numTrades: quoteData.num_trades,
change: currentIndex - prevClose,
changePct: calcChangePct(currentIndex, prevClose),
@@ -283,20 +283,25 @@ const handleSZSERealtimeMessage = (
case 'index': {
const indexData = data as SZSEIndexData;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const anyIndexData = indexData as any;
const prevClose = anyIndexData.prev_close_px ?? indexData.prev_close ?? 0;
const currentIndex = anyIndexData.current_index ?? anyIndexData.last_px ?? 0;
updated[fullCode] = {
code: fullCode,
name: prevQuotes[fullCode]?.name || '',
price: indexData.current_index,
prevClose: indexData.prev_close,
open: indexData.open_index,
high: indexData.high_index,
low: indexData.low_index,
price: currentIndex,
prevClose,
open: indexData.open_index ?? anyIndexData.open_px ?? 0,
high: indexData.high_index ?? anyIndexData.high_px ?? 0,
low: indexData.low_index ?? anyIndexData.low_px ?? 0,
close: indexData.close_index,
volume: indexData.volume,
amount: indexData.amount,
volume: anyIndexData.total_volume_trade ?? indexData.volume ?? 0,
amount: anyIndexData.total_value_trade ?? indexData.amount ?? 0,
numTrades: indexData.num_trades,
change: indexData.current_index - indexData.prev_close,
changePct: calcChangePct(indexData.current_index, indexData.prev_close),
change: currentIndex - prevClose,
changePct: calcChangePct(currentIndex, prevClose),
bidPrices: [],
bidVolumes: [],
askPrices: [],

View File

@@ -128,7 +128,7 @@ const FlexScreen: React.FC = () => {
const borderColor = 'rgba(255, 255, 255, 0.08)';
const textColor = 'rgba(255, 255, 255, 0.95)';
const subTextColor = 'rgba(255, 255, 255, 0.6)';
const searchBg = 'rgba(255, 255, 255, 0.05)';
const searchBg = 'rgba(255, 255, 255, 0.12)'; // 调亮搜索框背景
const hoverBg = 'rgba(255, 255, 255, 0.08)';
const accentColor = '#8b5cf6';

View File

@@ -108,7 +108,7 @@ const StockOverview = () => {
const cardBg = 'rgba(255, 255, 255, 0.03)'; // 玻璃态卡片背景
const borderColor = 'rgba(255, 255, 255, 0.08)'; // 边框
const hoverBg = 'rgba(255, 255, 255, 0.06)'; // 悬停背景
const searchBg = 'rgba(255, 255, 255, 0.05)'; // 搜索框背景
const searchBg = 'rgba(255, 255, 255, 0.15)'; // 搜索框背景(调亮)
const textColor = 'rgba(255, 255, 255, 0.95)'; // 主文字
const subTextColor = 'rgba(255, 255, 255, 0.6)'; // 次要文字
const goldColor = '#8b5cf6'; // 使用紫色作为强调色