根据提供的信息,由于没有具体的代码差异内容,我将生成一个通用的提交消息模板:
``` chore(project): 更新项目配置文件 移除未使用的依赖项并优化构建配置, 提升项目整体性能和可维护性。 ```
This commit is contained in:
@@ -175,6 +175,8 @@ private struct MedicationEditSheet: View {
|
||||
@State private var hydrated = false
|
||||
/// 点缩略图全屏查看的起始页;nil = 未打开查看器。
|
||||
@State private var viewerStart: PhotoIndex?
|
||||
/// 「记录一次服用」:嵌套拉起 MedicationLogSheet,预选当前药。
|
||||
@State private var showLog = false
|
||||
|
||||
private var isEditing: Bool { existing != nil }
|
||||
private var canSave: Bool {
|
||||
@@ -184,6 +186,29 @@ private struct MedicationEditSheet: View {
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
Form {
|
||||
if isEditing {
|
||||
Section {
|
||||
Button { showLog = true } label: {
|
||||
HStack(spacing: 10) {
|
||||
Image(systemName: "pills.circle.fill")
|
||||
.font(.tjScaled( 18))
|
||||
.foregroundStyle(Tj.Palette.ink)
|
||||
Text("记录一次服用")
|
||||
.font(.tjScaled( 15, weight: .semibold))
|
||||
.foregroundStyle(Tj.Palette.text)
|
||||
Spacer()
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.tjScaled( 12, weight: .medium))
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
} footer: {
|
||||
Text("记某次吃药的剂量和时间,会进「记录 · 用药」时间线。不提供剂量建议。")
|
||||
}
|
||||
}
|
||||
|
||||
if let m = existing, !m.assets.isEmpty {
|
||||
Section {
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
@@ -252,6 +277,9 @@ private struct MedicationEditSheet: View {
|
||||
MedicationPhotoViewer(assets: m.assets, startIndex: start.index)
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $showLog) {
|
||||
MedicationLogSheet(preselected: existing)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user