feat: 添加拍药盒功能和语音直达入口

- 实现拍药盒扫描流程,支持本地OCR识别药品信息
- 在日记页面添加拍药盒和记症状的三选一入口
- 优化按钮点击区域,确保符合苹果HIG最小命中区标准
- 添加用药记录到时间线的独立分类显示
- 实现长按+号语音直达功能,支持语音意图分类跳转
- 更新项目配置文件,启用代码分析和死代码剥离选项
- 增加多项本地化字符串支持新功能
```
This commit is contained in:
link2026
2026-06-13 09:16:25 +08:00
parent f58d6064ba
commit 6c6a950140
30 changed files with 1856 additions and 64 deletions

View File

@@ -5,8 +5,15 @@ enum RecordKind: String, Identifiable, CaseIterable {
var id: String { rawValue }
/// RecordSheet () enum ,
/// :`.quick`() `.indicator`(),
static let displayOrder: [RecordKind] = [.diary, .reminder, .symptom, .indicator, .healthExport, .archive]
/// :`.quick`() `.indicator`();
/// `.symptom`() `.diary`(),
static let displayOrder: [RecordKind] = [.diary, .reminder, .indicator, .healthExport, .archive]
/// pill( subtitle,"/")
/// :,( ProfileEditView presets )
static var diaryFeaturePills: [String] {
[String(appLoc: "写日记"), String(appLoc: "拍药盒"), String(appLoc: "记症状")]
}
var title: String {
switch self {
@@ -25,7 +32,7 @@ enum RecordKind: String, Identifiable, CaseIterable {
case .indicator: return String(appLoc: "手动填写,或拍照自动识别")
case .healthExport: return String(appLoc: "多轮问答后生成给医生看的整理报告")
case .archive: return String(appLoc: "完整保存整份报告(可多页)")
case .diary: return String(appLoc: "记录身体状态、用药、感受 · 可让 AI 辅助")
case .diary: return String(appLoc: "写日记或拍药盒记录用药 · 可让 AI 辅助")
case .symptom: return String(appLoc: "开始一个持续症状,结束时再点结束")
case .reminder: return String(appLoc: "管理用药、复查、监测的周期提醒")
}
@@ -93,13 +100,27 @@ struct RecordSheet: View {
}
.frame(width: 44, height: 44)
VStack(alignment: .leading, spacing: 2) {
VStack(alignment: .leading, spacing: 3) {
Text(kind.title)
.font(.tjScaled( 15, weight: .semibold))
.foregroundStyle(Tj.Palette.text)
Text(kind.subtitle)
.font(.tjScaled( 12))
.foregroundStyle(Tj.Palette.text3)
if kind == .diary {
// :/, pill
HStack(spacing: 5) {
ForEach(RecordKind.diaryFeaturePills, id: \.self) { pill in
Text(pill)
.font(.tjScaled( 10, weight: .medium))
.foregroundStyle(Tj.Palette.ink)
.padding(.horizontal, 7)
.padding(.vertical, 2)
.background(Capsule().fill(Tj.Palette.sand2))
}
}
} else {
Text(kind.subtitle)
.font(.tjScaled( 12))
.foregroundStyle(Tj.Palette.text3)
}
}
Spacer()
Image(systemName: "chevron.right")
@@ -111,6 +132,17 @@ struct RecordSheet: View {
}
.buttonStyle(.plain)
}
// : + ,
HStack(spacing: 5) {
Image(systemName: "mic.fill")
.font(.tjScaled( 10))
Text("下次试试长按 + ,直接说出想记的内容")
.font(.tjScaled( 11))
}
.foregroundStyle(Tj.Palette.text3)
.frame(maxWidth: .infinity)
.padding(.top, 6)
}
.padding(.bottom, 22)
}