Files
suixinkan_ios_new/suixinkan/Features/TravelAlbum/Views/WiredTransfer/SpecifyUploadBottomSheet.swift
汉秋 c71b45bdfd 对齐有线传图页 Android UI,并改用相对路径持久化本地照片。
还原顶栏、浮动卡片、时间侧栏与底部交互;照片路径改为 CameraDownloads 相对路径并兼容旧数据;格式 Chip 固定 JPG 且不可点击。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 11:16:28 +08:00

98 lines
3.4 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// SpecifyUploadBottomSheet.swift
// suixinkan
//
import SwiftUI
/// Bottom Sheet Android SpecifyUploadBottomSheet
struct SpecifyUploadBottomSheet: View {
@Binding var isPresented: Bool
let onConfirm: (String) -> Void
@State private var selectedOption = WiredCameraTransferViewModel.specifyUploadAllPending
private let options = [
WiredCameraTransferViewModel.specifyUploadAllPending,
WiredCameraTransferViewModel.specifyUploadTodayCaptured
]
var body: some View {
VStack(spacing: 0) {
ZStack {
Button("取消") { isPresented = false }
.font(.system(size: 16))
.foregroundStyle(AppDesign.primary)
.frame(maxWidth: .infinity, alignment: .leading)
Text("指定上传")
.font(.system(size: 17, weight: .semibold))
.foregroundStyle(WiredTransferDesign.text333)
}
.padding(.horizontal, 16)
.frame(height: 52)
VStack(spacing: 12) {
ForEach(options, id: \.self) { option in
optionRow(option)
}
}
.padding(.horizontal, 16)
Spacer(minLength: 20)
HStack(spacing: 12) {
Button("取消") { isPresented = false }
.font(.system(size: 16, weight: .medium))
.foregroundStyle(AppDesign.primary)
.frame(maxWidth: .infinity)
.frame(height: 48)
.background(Color.white)
.overlay {
RoundedRectangle(cornerRadius: 10)
.stroke(AppDesign.primary, lineWidth: 1)
}
Button("确认上传") {
onConfirm(selectedOption)
}
.font(.system(size: 16, weight: .medium))
.foregroundStyle(.white)
.frame(maxWidth: .infinity)
.frame(height: 48)
.background(AppDesign.primary)
.clipShape(RoundedRectangle(cornerRadius: 10))
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
}
.background(WiredTransferDesign.pageBackground)
.onAppear {
selectedOption = options.first ?? WiredCameraTransferViewModel.specifyUploadAllPending
}
}
private func optionRow(_ option: String) -> some View {
Button {
selectedOption = option
} label: {
HStack {
Text(option)
.font(.system(size: 15))
.foregroundStyle(WiredTransferDesign.text333)
.frame(maxWidth: .infinity, alignment: .leading)
Image(systemName: selectedOption == option ? "largecircle.fill.circle" : "circle")
.foregroundStyle(selectedOption == option ? WiredTransferDesign.text333 : WiredTransferDesign.borderLight)
}
.padding(.horizontal, 14)
.padding(.vertical, 8)
.background(Color.white)
.clipShape(RoundedRectangle(cornerRadius: 10))
.overlay {
RoundedRectangle(cornerRadius: 10)
.stroke(WiredTransferDesign.borderLight, lineWidth: 1)
}
}
.buttonStyle(.plain)
}
}