From 6fb69f234a1e6a2186b5ebc65ab0533be9ab76f0 Mon Sep 17 00:00:00 2001 From: dongjf <1+dongjf@noreply.git.tutudog.com> Date: Thu, 26 Nov 2026 15:34:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(ios):=20=E5=86=99=E5=85=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=90=8E=E4=BF=9D=E7=95=99=E8=BD=AC=E5=86=99=E5=8E=9F?= =?UTF-8?q?=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ios/ItemAtlas/IntakeView.swift | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/ios/ItemAtlas/IntakeView.swift b/apps/ios/ItemAtlas/IntakeView.swift index c455652..5588a8a 100644 --- a/apps/ios/ItemAtlas/IntakeView.swift +++ b/apps/ios/ItemAtlas/IntakeView.swift @@ -101,8 +101,10 @@ struct IntakeView: View { if let operation { Section { Text(statusText(operation.status)) - if ["COMPLETED", "FAILED", "REJECTED"].contains(operation.status) { - Button("新的录入") { draft = nil; selections = [:]; text = ""; self.operation = nil } + if operation.status == "COMPLETED" { + Button("继续录入") { reset(clearText: true) } + } else if ["FAILED", "REJECTED"].contains(operation.status) { + Button("返回核对") { reset(clearText: false) } } else if operation.status == "NEEDS_REVIEW" { Button("重试交付") { Task { await retry(operation) } }.disabled(busy) } else { @@ -217,10 +219,12 @@ struct IntakeView: View { } private func submit(_ draft: Draft, automatic: Bool = false) async { + guard draft.originalText == text else { return } let items = draft.candidates.enumerated().compactMap { index, candidate -> ItemInput? in guard let location = selections[index], candidate.action != "SKIP" else { return nil } return ItemInput(name: candidate.name, quantity: candidate.quantity ?? 1, notes: "", locationId: location, aliases: []) } + guard !items.isEmpty else { return } busy = true defer { busy = false } do { @@ -234,6 +238,15 @@ struct IntakeView: View { } } + private func reset(clearText: Bool) { + if clearText { text = "" } + draft = nil + selections = [:] + operation = nil + receipt = nil + error = nil + } + private func retry(_ operation: Operation) async { busy = true defer { busy = false }