From 7b2d4965ff351fbb1e4146761100a3ec505040f0 Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Sun, 26 Jul 2026 08:27:27 +0200 Subject: [PATCH] =?UTF-8?q?iOS:=20Einzelst=C3=BCck-Ansicht=20zeigt=20Produ?= =?UTF-8?q?ktbild=20statt=20QR-Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Beim Nachschlagen/Öffnen eines Einzelstuecks stand oben das QR-Bild - unnoetig, den hat man ja gerade gescannt. Jetzt oben das Produktbild plus Name/Marke; die stueckspezifischen Angaben (UID, Kaufdatum, Garantie, Ort, Notiz) bleiben. Co-Authored-By: Claude Opus 4.8 --- ios/Sources/ItemViews.swift | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ios/Sources/ItemViews.swift b/ios/Sources/ItemViews.swift index 27032c8..2229b80 100644 --- a/ios/Sources/ItemViews.swift +++ b/ios/Sources/ItemViews.swift @@ -88,6 +88,7 @@ struct ItemEditView: View { @State private var locations: [StorageLocation] = [] @State private var shops: [ShopItem] = [] + @State private var photo: Data? @State private var locationId: Int? @State private var shopId: Int? @State private var hasAcquired = false @@ -104,15 +105,19 @@ struct ItemEditView: View { var body: some View { Form { Section { - if let img = QRImage.make(qrLink(forUid: item.uid)) { - Image(uiImage: img) - .interpolation(.none).resizable().scaledToFit() - .frame(maxWidth: .infinity).frame(height: 180) + if let photo, let ui = UIImage(data: photo) { + Image(uiImage: ui) + .resizable().scaledToFit() + .frame(maxWidth: .infinity).frame(maxHeight: 220) + .clipShape(RoundedRectangle(cornerRadius: 8)) } - LabeledContent("UID", value: item.uid) if let name = item.productName { LabeledContent("Artikel", value: name) } + if let brand = item.productBrand, !brand.isEmpty { + LabeledContent("Marke", value: brand) + } + LabeledContent("UID", value: item.uid) } Section { @@ -165,6 +170,7 @@ struct ItemEditView: View { private func load() async { locations = (try? await APIClient.shared.locations()) ?? [] shops = (try? await APIClient.shared.shops()) ?? [] + photo = try? await APIClient.shared.productImage(id: item.productId) locationId = item.locationId shopId = item.shopId note = item.note ?? ""