BD共振客户端适配:首页筛选加「共振」项、kindColor紫色区分、K线图「共振」标注样式

This commit is contained in:
2026-11-22 13:31:28 +08:00
committed by ceryuan
parent d89f235e3a
commit 3150df6904
3 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -83,6 +83,7 @@ class NotificationItem {
Color get kindColor => switch (kind) {
'long_ignition' => XlColors.rise,
'short_ignition' => const Color(0xFFE8DFC8),
'bd_resonance' => const Color(0xFFB48CF2),
_ => XlColors.goldLight,
};
}
@@ -466,7 +467,7 @@ class _HomePageState extends ConsumerState<HomePage> with WidgetsBindingObserver
Widget _sectionHeader(HomeData d) {
final kind = ref.watch(homeProvider.notifier).kind;
const opts = [('all', '全部'), ('divergence', '量价背离'), ('ignition', '起爆点')];
const opts = [('all', '全部'), ('divergence', '量价背离'), ('ignition', '起爆点'), ('bd_resonance', '共振')];
final label = opts.firstWhere((o) => o.$1 == kind, orElse: () => opts.first).$2;
return Padding(
padding: const EdgeInsets.only(bottom: 8),
+4
View File
@@ -406,6 +406,10 @@ class _KlinePainter extends CustomPainter {
y -= 8;
}
_text(canvas, '背离', Offset(x - 10, labelY), gold: true);
} else if (kind == 'bd_resonance') {
final yTop = yPrice(b.h);
_text(canvas, '共振', Offset(x - 12, (yTop - 34).clamp(2.0, priceH - 14)),
color: const Color(0xFFB48CF2));
} else if (kind == 'long_ignition') {
final yLow = yPrice(b.l) + 8;
_text(canvas, '多', Offset(x - 6, yLow), color: const Color(0xFFE02424));
+2
View File
@@ -60,6 +60,8 @@ def list_notifications(
conds.append("s.kind = 'divergence'")
elif kind == "ignition":
conds.append("s.kind = 'short_ignition'") # 做多起爆点统一不显示
elif kind == "bd_resonance":
conds.append("s.kind = 'bd_resonance'")
# 默认(全部)也排除做多起爆点
if "s.kind = 'short_ignition'" not in conds and "s.kind = 'divergence'" not in conds:
conds.append("s.kind != 'long_ignition'")