fix: 趋势页恢复体重 + 图标换Material Icons + VLM禁用思考模式
- 健康概览页恢复体重指标的标签/单位/加载/筛选/录入 - 历史记录图标从emoji改为Material Icons - VLM请求显式设置enable_thinking=false,禁用混合思考加速识图
This commit is contained in:
@@ -119,6 +119,7 @@ public sealed class VisionClient(HttpClient http, IConfiguration config)
|
|||||||
{
|
{
|
||||||
Model = _model, Messages = messages, MaxTokens = maxTokens, Stream = false,
|
Model = _model, Messages = messages, MaxTokens = maxTokens, Stream = false,
|
||||||
Temperature = 0.1f, VlHighResolutionImages = true,
|
Temperature = 0.1f, VlHighResolutionImages = true,
|
||||||
|
EnableThinking = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
var json = JsonSerializer.Serialize(request, _jsonOptions);
|
var json = JsonSerializer.Serialize(request, _jsonOptions);
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ public sealed class ChatCompletionRequest
|
|||||||
|
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("vl_high_resolution_images")]
|
[System.Text.Json.Serialization.JsonPropertyName("vl_high_resolution_images")]
|
||||||
public bool VlHighResolutionImages { get; set; }
|
public bool VlHighResolutionImages { get; set; }
|
||||||
|
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("enable_thinking")]
|
||||||
|
public bool? EnableThinking { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class ChatMessage
|
public sealed class ChatMessage
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class _TrendPageState extends ConsumerState<TrendPage> {
|
|||||||
{'key': 'heart_rate', 'label': '心率', 'color': Color(0xFFF59E0B)},
|
{'key': 'heart_rate', 'label': '心率', 'color': Color(0xFFF59E0B)},
|
||||||
{'key': 'glucose', 'label': '血糖', 'color': Color(0xFF4F6EF7)},
|
{'key': 'glucose', 'label': '血糖', 'color': Color(0xFF4F6EF7)},
|
||||||
{'key': 'spo2', 'label': '血氧', 'color': Color(0xFF20C997)},
|
{'key': 'spo2', 'label': '血氧', 'color': Color(0xFF20C997)},
|
||||||
|
{'key': 'weight', 'label': '体重', 'color': Color(0xFF845EF7)},
|
||||||
];
|
];
|
||||||
|
|
||||||
static const _units = {
|
static const _units = {
|
||||||
@@ -34,6 +35,7 @@ class _TrendPageState extends ConsumerState<TrendPage> {
|
|||||||
'heart_rate': 'bpm',
|
'heart_rate': 'bpm',
|
||||||
'glucose': 'mmol/L',
|
'glucose': 'mmol/L',
|
||||||
'spo2': '%',
|
'spo2': '%',
|
||||||
|
'weight': 'kg',
|
||||||
};
|
};
|
||||||
|
|
||||||
static const _names = {
|
static const _names = {
|
||||||
@@ -41,6 +43,7 @@ class _TrendPageState extends ConsumerState<TrendPage> {
|
|||||||
'heart_rate': '心率',
|
'heart_rate': '心率',
|
||||||
'glucose': '血糖',
|
'glucose': '血糖',
|
||||||
'spo2': '血氧',
|
'spo2': '血氧',
|
||||||
|
'weight': '体重',
|
||||||
};
|
};
|
||||||
|
|
||||||
String get _unit => _units[_selected] ?? '';
|
String get _unit => _units[_selected] ?? '';
|
||||||
@@ -60,7 +63,7 @@ class _TrendPageState extends ConsumerState<TrendPage> {
|
|||||||
setState(() => _loading = true);
|
setState(() => _loading = true);
|
||||||
try {
|
try {
|
||||||
final api = ref.read(apiClientProvider);
|
final api = ref.read(apiClientProvider);
|
||||||
final types = ['BloodPressure', 'HeartRate', 'Glucose', 'SpO2'];
|
final types = ['BloodPressure', 'HeartRate', 'Glucose', 'SpO2', 'Weight'];
|
||||||
final all = <Map<String, dynamic>>[];
|
final all = <Map<String, dynamic>>[];
|
||||||
for (final t in types) {
|
for (final t in types) {
|
||||||
try {
|
try {
|
||||||
@@ -110,7 +113,9 @@ class _TrendPageState extends ConsumerState<TrendPage> {
|
|||||||
? 'HeartRate'
|
? 'HeartRate'
|
||||||
: _selected == 'glucose'
|
: _selected == 'glucose'
|
||||||
? 'Glucose'
|
? 'Glucose'
|
||||||
: 'SpO2';
|
: _selected == 'spo2'
|
||||||
|
? 'SpO2'
|
||||||
|
: 'Weight';
|
||||||
setState(() {
|
setState(() {
|
||||||
_filtered = _allRecords.where((r) => r['type'] == typeName).toList();
|
_filtered = _allRecords.where((r) => r['type'] == typeName).toList();
|
||||||
_filtered.sort(
|
_filtered.sort(
|
||||||
@@ -200,7 +205,9 @@ class _TrendPageState extends ConsumerState<TrendPage> {
|
|||||||
? 'HeartRate'
|
? 'HeartRate'
|
||||||
: _selected == 'glucose'
|
: _selected == 'glucose'
|
||||||
? 'Glucose'
|
? 'Glucose'
|
||||||
: 'SpO2',
|
: _selected == 'spo2'
|
||||||
|
? 'SpO2'
|
||||||
|
: 'Weight',
|
||||||
'source': 'Manual',
|
'source': 'Manual',
|
||||||
'recordedAt': DateTime.now().toUtc().toIso8601String(),
|
'recordedAt': DateTime.now().toUtc().toIso8601String(),
|
||||||
'unit': _unit,
|
'unit': _unit,
|
||||||
@@ -607,9 +614,10 @@ class _TrendPageState extends ConsumerState<TrendPage> {
|
|||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Icon(
|
||||||
_getMetricIcon(_selected),
|
_getMetricIcon(_selected),
|
||||||
style: const TextStyle(fontSize: 21),
|
size: 21,
|
||||||
|
color: _color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -667,18 +675,20 @@ class _TrendPageState extends ConsumerState<TrendPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String _getMetricIcon(String key) {
|
IconData _getMetricIcon(String key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'blood_pressure':
|
case 'blood_pressure':
|
||||||
return '🫀';
|
return Icons.monitor_heart_outlined;
|
||||||
case 'heart_rate':
|
case 'heart_rate':
|
||||||
return '💓';
|
return Icons.favorite_border;
|
||||||
case 'glucose':
|
case 'glucose':
|
||||||
return '🩸';
|
return Icons.water_drop_outlined;
|
||||||
case 'spo2':
|
case 'spo2':
|
||||||
return '🫁';
|
return Icons.air_outlined;
|
||||||
|
case 'weight':
|
||||||
|
return Icons.monitor_weight_outlined;
|
||||||
default:
|
default:
|
||||||
return '📊';
|
return Icons.show_chart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user