feat: 行情K线优先CTP tick聚合,修复手续费同步主力列表解析

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-24 13:18:43 +08:00
parent 09f4649d79
commit 3fe4add8e1
8 changed files with 390 additions and 24 deletions
+20 -2
View File
@@ -574,6 +574,12 @@
}
}
function klineSourceLabel(src) {
if (src === 'ctp') return 'CTP';
if (src === 'local') return '本地缓存';
return '新浪';
}
function updateRefreshHint(disconnected) {
var el = document.getElementById('market-refresh-hint');
if (!el) return;
@@ -589,7 +595,10 @@
el.textContent = '';
return;
}
var src = lastData && lastData.source === 'local' ? ' · 本地缓存' : '';
var src = '';
if (lastData && lastData.source) {
src = ' · ' + klineSourceLabel(lastData.source);
}
if (isTradingSession()) {
el.textContent = '交易中 · 后台刷新 · SSE 推送(约1秒)' + src;
} else {
@@ -614,6 +623,9 @@
if (priceEl) {
priceEl.textContent = data.price != null ? Number(data.price).toFixed(2) : '—';
}
if (data.quote_source && lastData) {
updateQuoteMeta(Object.assign({}, lastData, { quote_source: data.quote_source }));
}
if (data.prev_close != null) {
lastPrevClose = data.prev_close;
updatePrevCloseDisplay(data.prev_close);
@@ -689,7 +701,13 @@
function updateQuoteMeta(data) {
var meta = document.getElementById('market-quote-meta');
if (meta) {
meta.textContent = data.count ? ('共 ' + data.count + ' 根 · ' + periodLabel(data.period)) : '';
var parts = [];
if (data.count) parts.push('共 ' + data.count + ' 根 · ' + periodLabel(data.period));
if (data.source) parts.push('K线 ' + klineSourceLabel(data.source));
if (data.quote_source) {
parts.push('报价 ' + (data.quote_source === 'ctp' ? 'CTP' : '新浪'));
}
meta.textContent = parts.join(' · ');
}
var nameEl = document.getElementById('market-quote-name');
var hiddenName = document.getElementById('market-symbol-name');