update pay ui
This commit is contained in:
@@ -152,8 +152,8 @@ const handleSZSEBatchMessage = (
|
|||||||
hasUpdate = true;
|
hasUpdate = true;
|
||||||
|
|
||||||
if (isIndexType) {
|
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;
|
const currentIndex = quoteData.current_index ?? quoteData.last_px ?? 0;
|
||||||
|
|
||||||
updated[fullCode] = {
|
updated[fullCode] = {
|
||||||
@@ -165,8 +165,8 @@ const handleSZSEBatchMessage = (
|
|||||||
high: quoteData.high_index ?? quoteData.high_px ?? 0,
|
high: quoteData.high_index ?? quoteData.high_px ?? 0,
|
||||||
low: quoteData.low_index ?? quoteData.low_px ?? 0,
|
low: quoteData.low_index ?? quoteData.low_px ?? 0,
|
||||||
close: quoteData.close_index,
|
close: quoteData.close_index,
|
||||||
volume: quoteData.volume ?? 0,
|
volume: quoteData.total_volume_trade ?? quoteData.volume ?? 0,
|
||||||
amount: quoteData.amount ?? 0,
|
amount: quoteData.total_value_trade ?? quoteData.amount ?? 0,
|
||||||
numTrades: quoteData.num_trades,
|
numTrades: quoteData.num_trades,
|
||||||
change: currentIndex - prevClose,
|
change: currentIndex - prevClose,
|
||||||
changePct: calcChangePct(currentIndex, prevClose),
|
changePct: calcChangePct(currentIndex, prevClose),
|
||||||
@@ -283,20 +283,25 @@ const handleSZSERealtimeMessage = (
|
|||||||
|
|
||||||
case 'index': {
|
case 'index': {
|
||||||
const indexData = data as SZSEIndexData;
|
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] = {
|
updated[fullCode] = {
|
||||||
code: fullCode,
|
code: fullCode,
|
||||||
name: prevQuotes[fullCode]?.name || '',
|
name: prevQuotes[fullCode]?.name || '',
|
||||||
price: indexData.current_index,
|
price: currentIndex,
|
||||||
prevClose: indexData.prev_close,
|
prevClose,
|
||||||
open: indexData.open_index,
|
open: indexData.open_index ?? anyIndexData.open_px ?? 0,
|
||||||
high: indexData.high_index,
|
high: indexData.high_index ?? anyIndexData.high_px ?? 0,
|
||||||
low: indexData.low_index,
|
low: indexData.low_index ?? anyIndexData.low_px ?? 0,
|
||||||
close: indexData.close_index,
|
close: indexData.close_index,
|
||||||
volume: indexData.volume,
|
volume: anyIndexData.total_volume_trade ?? indexData.volume ?? 0,
|
||||||
amount: indexData.amount,
|
amount: anyIndexData.total_value_trade ?? indexData.amount ?? 0,
|
||||||
numTrades: indexData.num_trades,
|
numTrades: indexData.num_trades,
|
||||||
change: indexData.current_index - indexData.prev_close,
|
change: currentIndex - prevClose,
|
||||||
changePct: calcChangePct(indexData.current_index, indexData.prev_close),
|
changePct: calcChangePct(currentIndex, prevClose),
|
||||||
bidPrices: [],
|
bidPrices: [],
|
||||||
bidVolumes: [],
|
bidVolumes: [],
|
||||||
askPrices: [],
|
askPrices: [],
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ const FlexScreen: React.FC = () => {
|
|||||||
const borderColor = 'rgba(255, 255, 255, 0.08)';
|
const borderColor = 'rgba(255, 255, 255, 0.08)';
|
||||||
const textColor = 'rgba(255, 255, 255, 0.95)';
|
const textColor = 'rgba(255, 255, 255, 0.95)';
|
||||||
const subTextColor = 'rgba(255, 255, 255, 0.6)';
|
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 hoverBg = 'rgba(255, 255, 255, 0.08)';
|
||||||
const accentColor = '#8b5cf6';
|
const accentColor = '#8b5cf6';
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ const StockOverview = () => {
|
|||||||
const cardBg = 'rgba(255, 255, 255, 0.03)'; // 玻璃态卡片背景
|
const cardBg = 'rgba(255, 255, 255, 0.03)'; // 玻璃态卡片背景
|
||||||
const borderColor = 'rgba(255, 255, 255, 0.08)'; // 边框
|
const borderColor = 'rgba(255, 255, 255, 0.08)'; // 边框
|
||||||
const hoverBg = 'rgba(255, 255, 255, 0.06)'; // 悬停背景
|
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 textColor = 'rgba(255, 255, 255, 0.95)'; // 主文字
|
||||||
const subTextColor = 'rgba(255, 255, 255, 0.6)'; // 次要文字
|
const subTextColor = 'rgba(255, 255, 255, 0.6)'; // 次要文字
|
||||||
const goldColor = '#8b5cf6'; // 使用紫色作为强调色
|
const goldColor = '#8b5cf6'; // 使用紫色作为强调色
|
||||||
|
|||||||
Reference in New Issue
Block a user