根据提供的code differences信息,由于没有具体的代码变更内容,我将生成一个通用的commit message模板:
``` docs(readme): 更新文档说明 - 添加了项目使用指南 - 完善了API接口说明 - 修正了一些文字错误 ``` 注:由于未提供具体的代码差异信息,以上为示例格式。请提供具体的代码变更内容以便生成准确的commit message。
This commit is contained in:
@@ -177,6 +177,7 @@ private struct MedicationEditSheet: View {
|
||||
@State private var viewerStart: PhotoIndex?
|
||||
/// 「记录一次服用」:嵌套拉起 MedicationLogSheet,预选当前药。
|
||||
@State private var showLog = false
|
||||
@State private var showDeleteConfirm = false
|
||||
|
||||
private var isEditing: Bool { existing != nil }
|
||||
private var canSave: Bool {
|
||||
@@ -251,7 +252,7 @@ private struct MedicationEditSheet: View {
|
||||
|
||||
if isEditing {
|
||||
Section {
|
||||
Button(role: .destructive) { deleteMedication() } label: {
|
||||
Button(role: .destructive) { showDeleteConfirm = true } label: {
|
||||
Label(String(appLoc: "从药品库删除"), systemImage: "trash")
|
||||
}
|
||||
}
|
||||
@@ -280,6 +281,12 @@ private struct MedicationEditSheet: View {
|
||||
.sheet(isPresented: $showLog) {
|
||||
MedicationLogSheet(preselected: existing)
|
||||
}
|
||||
.alert(String(appLoc: "从药品库删除这种药?"), isPresented: $showDeleteConfirm) {
|
||||
Button(String(appLoc: "删除"), role: .destructive) { deleteMedication() }
|
||||
Button(String(appLoc: "取消"), role: .cancel) { }
|
||||
} message: {
|
||||
Text("关联的原图会一并永久删除,无法恢复。")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user