fix: 登录页白底+渐变边框/胶囊加大/底部提示/今日健康优化/发送按钮蓝紫渐变
- 登录页:输入框白底+渐变紫蓝外框,去掉focus内框;登录按钮白底紫字;协议勾选白底 - 首页胶囊:适老化加大(内边距14x8/字号15/图标17/圆角18) - 欢迎卡片底部提示:各智能体专属引导文案,字号加大颜色加深 - 今日健康卡片:健康指标改一行总结(异常提醒/正常显示);用药显示具体药品名+状态 - 发送按钮:蓝→紫渐变 - 设置页菜单:白色卡片+圆角16+轻阴影 - IP改localhost:adb reverse解决IP变动问题 - 服药打卡快捷按钮:改为跳转打卡页,不再一键全打
This commit is contained in:
@@ -232,7 +232,11 @@ class _HomePageState extends ConsumerState<HomePage> {
|
||||
width: 40, height: 40,
|
||||
margin: EdgeInsets.only(bottom: _pickedImagePath != null ? 0 : 4),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.blueMeasure,
|
||||
gradient: const LinearGradient(
|
||||
colors: [AppColors.blueMeasure, AppColors.primary],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: const Icon(LucideIcons.send, size: 20, color: Colors.white),
|
||||
|
||||
@@ -196,11 +196,18 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 14, 16, 0),
|
||||
child: features.any((f) => f.imageAsset != null)
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Image.asset(
|
||||
features.firstWhere((f) => f.imageAsset != null).imageAsset!,
|
||||
width: double.infinity, height: 170, fit: BoxFit.fill,
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: iconGradient,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
child: Image.asset(
|
||||
features.firstWhere((f) => f.imageAsset != null).imageAsset!,
|
||||
width: double.infinity, height: 170, fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
@@ -289,7 +296,7 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
child: Row(children: [
|
||||
Icon(Icons.lightbulb_outline, size: 18, color: agentColors.accent),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: Text('直接描述您的需求,AI 会自动为您记录和分析', style: TextStyle(fontSize: 14, color: agentColors.accent, fontWeight: FontWeight.w500))),
|
||||
Expanded(child: Text(_agentTip(agent), style: TextStyle(fontSize: 15, color: AppColors.textPrimary.withAlpha(180), fontWeight: FontWeight.w500))),
|
||||
]),
|
||||
),
|
||||
),
|
||||
@@ -304,7 +311,7 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
if (a.label == '服药打卡') {
|
||||
_medicationCheckIn(ref, context);
|
||||
pushRoute(ref, 'medCheckIn');
|
||||
} else if (a.action == 'pickFoodCamera' || a.action == 'pickFoodGallery') {
|
||||
ref.read(dietActionProvider.notifier).trigger(a.action!);
|
||||
} else if (a.route != null) {
|
||||
@@ -346,7 +353,7 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
List<_AgentFeature> _getAgentFeatures(ActiveAgent agent) {
|
||||
return switch (agent) {
|
||||
ActiveAgent.health => [
|
||||
_AgentFeature(Icons.trending_up, '趋势分析', '查看历史数据'),
|
||||
_AgentFeature(Icons.trending_up, '趋势分析', '查看历史数据', imageAsset: 'assets/images/Data.png'),
|
||||
_AgentFeature(Icons.add, '快速录入', '血压心率血糖'),
|
||||
],
|
||||
ActiveAgent.diet => [
|
||||
@@ -354,7 +361,7 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
_AgentFeature(Icons.bar_chart, '营养分析', '热量营养成分'),
|
||||
],
|
||||
ActiveAgent.medication => [
|
||||
_AgentFeature(Icons.list, '用药清单', '管理所有药品'),
|
||||
_AgentFeature(Icons.list, '用药清单', '管理所有药品', imageAsset: 'assets/images/Medicine.png'),
|
||||
_AgentFeature(Icons.alarm, '智能提醒', '按时服药提醒'),
|
||||
],
|
||||
ActiveAgent.consultation => [
|
||||
@@ -1195,6 +1202,16 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
};
|
||||
}
|
||||
|
||||
static String _agentTip(ActiveAgent agent) => switch (agent) {
|
||||
ActiveAgent.health => '直接说出您的症状或数据,如"血压130/85,心率72"',
|
||||
ActiveAgent.diet => '拍照或描述您吃了什么,如"早餐吃了两个鸡蛋一杯牛奶"',
|
||||
ActiveAgent.medication => '说出药品名称和用法,如"每天早晚各一片阿司匹林"',
|
||||
ActiveAgent.consultation => '描述您的症状和不适感,如"最近总是头晕胸闷"',
|
||||
ActiveAgent.report => '上传您的检查报告,AI 将自动提取指标并解读',
|
||||
ActiveAgent.exercise => '说出运动计划,如"每天散步30分钟坚持一周"',
|
||||
_ => '直接描述您的需求,AI 会自动为您记录和分析',
|
||||
};
|
||||
|
||||
static ActiveAgent _parseAgentFromName(String? name) {
|
||||
switch (name) {
|
||||
case 'consultation': return ActiveAgent.consultation;
|
||||
@@ -1246,25 +1263,20 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
trailing: '今日暂无记录,点击录入',
|
||||
status: 'pending', iconColor: healthIconColor, iconBg: healthIconBg,
|
||||
onTap: () => pushRoute(ref, 'trend')));
|
||||
} else {
|
||||
final parts = <String>[];
|
||||
if (bpText != null) parts.add('血压 $bpText');
|
||||
if (hrText != null) parts.add('心率 $hrText');
|
||||
if (bsText != null) parts.add('血糖 $bsText');
|
||||
if (boText != null) parts.add('血氧 $boText');
|
||||
if (wtText != null) parts.add('体重 $wtText');
|
||||
tasks.add(_taskRow(context, Icons.check_circle, '健康指标',
|
||||
trailing: parts.join(' · '),
|
||||
status: hasAbnormal ? 'warning' : 'done',
|
||||
iconColor: healthIconColor, iconBg: healthIconBg,
|
||||
} else if (hasAbnormal) {
|
||||
// 有异常时显示异常指标
|
||||
final abnormalParts = <String>[];
|
||||
if (bpAbnormal) abnormalParts.add('血压 ${bp['systolic']}/${bp['diastolic']} 偏高');
|
||||
tasks.add(_taskRow(context, Icons.warning_amber_rounded, '健康指标',
|
||||
trailing: abnormalParts.join(' · '),
|
||||
status: 'warning', iconColor: healthIconColor, iconBg: healthIconBg,
|
||||
onTap: () => pushRoute(ref, 'trend')));
|
||||
} else {
|
||||
// 全部正常
|
||||
tasks.add(_taskRow(context, Icons.check_circle, '健康指标',
|
||||
trailing: '指标正常',
|
||||
status: 'done', iconColor: healthIconColor, iconBg: healthIconBg,
|
||||
onTap: () => pushRoute(ref, 'trend')));
|
||||
}
|
||||
if (bpAbnormal) {
|
||||
final s = bp['systolic'];
|
||||
final d = bp['diastolic'] ?? '--';
|
||||
tasks.add(_taskRow(context, Icons.warning_amber_rounded, '血压 $s/$d 偏高,请关注',
|
||||
status: 'warning',
|
||||
onTap: () => pushRoute(ref, 'trend', params: {'type': 'blood_pressure'})));
|
||||
}
|
||||
|
||||
// ── 2. 运动 ──
|
||||
@@ -1302,21 +1314,29 @@ class ChatMessagesView extends ConsumerWidget {
|
||||
const medIconColor = Color(0xFFEC4899);
|
||||
const medIconBg = Color(0xFFFCE7F3);
|
||||
reminders.whenOrNull(data: (meds) {
|
||||
final overdue = meds.where((m) => m['status'] == 'overdue').length;
|
||||
final upcoming = meds.where((m) => m['status'] == 'upcoming').length;
|
||||
final taken = meds.where((m) => m['status'] == 'taken').length;
|
||||
final total = overdue + upcoming + taken;
|
||||
if (total > 0) {
|
||||
final parts = <String>[];
|
||||
if (overdue > 0) parts.add('$overdue项过期');
|
||||
if (upcoming > 0) parts.add('$upcoming项待服');
|
||||
if (taken > 0) parts.add('$taken项已服');
|
||||
tasks.add(_taskRow(context, Icons.medication_rounded, '用药打卡 ($total项)',
|
||||
trailing: parts.join(' · '),
|
||||
status: overdue > 0 ? 'overdue' : upcoming > 0 ? 'pending' : 'done',
|
||||
iconColor: medIconColor, iconBg: medIconBg,
|
||||
onTap: () => pushRoute(ref, 'medCheckIn'),
|
||||
));
|
||||
if (meds.isNotEmpty) {
|
||||
final overdueMeds = meds.where((m) => m['status'] == 'overdue').toList();
|
||||
final upcomingMeds = meds.where((m) => m['status'] == 'upcoming').toList();
|
||||
final takenMeds = meds.where((m) => m['status'] == 'taken').toList();
|
||||
// 未服/过期的在前面
|
||||
for (final m in [...overdueMeds, ...upcomingMeds]) {
|
||||
final name = m['name']?.toString() ?? '药品';
|
||||
final time = m['scheduledTime']?.toString() ?? '';
|
||||
final isOverdue = m['status'] == 'overdue';
|
||||
tasks.add(_taskRow(context, Icons.medication_rounded, name,
|
||||
trailing: '${isOverdue ? "❗过期" : "⏳待服"} $time',
|
||||
status: isOverdue ? 'overdue' : 'pending',
|
||||
iconColor: medIconColor, iconBg: medIconBg,
|
||||
onTap: () => pushRoute(ref, 'medCheckIn')));
|
||||
}
|
||||
// 已服的合并显示
|
||||
if (takenMeds.isNotEmpty) {
|
||||
final names = takenMeds.map((m) => m['name']?.toString() ?? '药品').join('、');
|
||||
tasks.add(_taskRow(context, Icons.check_circle, names,
|
||||
trailing: '已服用 (${takenMeds.length}项)',
|
||||
status: 'done',
|
||||
iconColor: medIconColor, iconBg: medIconBg));
|
||||
}
|
||||
}
|
||||
});
|
||||
final hasMeds = reminders.asData?.value != null && (reminders.asData!.value).isNotEmpty;
|
||||
|
||||
Reference in New Issue
Block a user