update pay ui
This commit is contained in:
@@ -117,7 +117,7 @@ const handleSZSERealtimeMessage = (
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 'index': {
|
case 'index': {
|
||||||
const indexData = quote as SZSEIndexData;
|
const indexData = quote as SZSEIndexData;
|
||||||
const prevClose = indexData.prev_close || 0;
|
const prevClose = indexData.prev_close_px || 0;
|
||||||
const currentIndex = indexData.current_index || 0;
|
const currentIndex = indexData.current_index || 0;
|
||||||
|
|
||||||
updated[fullCode] = {
|
updated[fullCode] = {
|
||||||
@@ -129,8 +129,8 @@ const handleSZSERealtimeMessage = (
|
|||||||
high: indexData.high_index || 0,
|
high: indexData.high_index || 0,
|
||||||
low: indexData.low_index || 0,
|
low: indexData.low_index || 0,
|
||||||
close: indexData.close_index,
|
close: indexData.close_index,
|
||||||
volume: indexData.volume || 0,
|
volume: indexData.total_volume_trade || 0,
|
||||||
amount: indexData.amount || 0,
|
amount: indexData.total_value_trade || 0,
|
||||||
numTrades: indexData.num_trades,
|
numTrades: indexData.num_trades,
|
||||||
change: currentIndex - prevClose,
|
change: currentIndex - prevClose,
|
||||||
changePct: calcChangePct(currentIndex, prevClose),
|
changePct: calcChangePct(currentIndex, prevClose),
|
||||||
@@ -138,6 +138,7 @@ const handleSZSERealtimeMessage = (
|
|||||||
bidVolumes: [],
|
bidVolumes: [],
|
||||||
askPrices: [],
|
askPrices: [],
|
||||||
askVolumes: [],
|
askVolumes: [],
|
||||||
|
tradingPhase: indexData.trading_phase_code,
|
||||||
updateTime: indexData.update_time || timestamp,
|
updateTime: indexData.update_time || timestamp,
|
||||||
exchange: 'SZSE',
|
exchange: 'SZSE',
|
||||||
} as QuoteData;
|
} as QuoteData;
|
||||||
|
|||||||
@@ -168,19 +168,23 @@ export interface SZSEStockData {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 深交所指数行情数据 (消息类型 309011)
|
* 深交所指数行情数据 (消息类型 309011)
|
||||||
|
* 字段名与 WebSocket 返回保持一致
|
||||||
*/
|
*/
|
||||||
export interface SZSEIndexData {
|
export interface SZSEIndexData {
|
||||||
security_id: string;
|
security_id: string;
|
||||||
md_stream_id?: string;
|
md_stream_id?: string;
|
||||||
prev_close: number;
|
orig_time?: number;
|
||||||
num_trades?: number;
|
channel_no?: number;
|
||||||
volume: number;
|
trading_phase_code?: string;
|
||||||
amount: number;
|
prev_close_px: number; // 昨收
|
||||||
current_index: number;
|
num_trades?: number; // 成交笔数
|
||||||
open_index: number;
|
total_volume_trade: number; // 成交量
|
||||||
high_index: number;
|
total_value_trade: number; // 成交额
|
||||||
low_index: number;
|
current_index: number; // 当前点位
|
||||||
close_index?: number;
|
open_index: number; // 开盘点位
|
||||||
|
high_index: number; // 最高点位
|
||||||
|
low_index: number; // 最低点位
|
||||||
|
close_index?: number; // 收盘点位
|
||||||
update_time?: string;
|
update_time?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user