恢复 USB 相机连接、边拍边传、三品牌驱动与 SwiftUI 历史导入页,通过适配层对接现有本地上传与 OSS 管道。 Co-authored-by: Cursor <cursoragent@cursor.com>
72 lines
2.8 KiB
Swift
72 lines
2.8 KiB
Swift
//
|
|
// WiredTransferBottomBar.swift
|
|
// suixinkan
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
/// 有线传图底部操作栏。
|
|
struct WiredTransferBottomBar: View {
|
|
let selectUploadMode: Bool
|
|
let selectedCount: Int
|
|
let isCameraConnected: Bool
|
|
let onBatchUploadClick: () -> Void
|
|
let onSpecifyUploadClick: () -> Void
|
|
let onHistoryImportClick: () -> Void
|
|
|
|
private var batchButtonTitle: String {
|
|
if !selectUploadMode { return "批量上传" }
|
|
if selectedCount > 0 { return "上传选中照片" }
|
|
return "取消选择"
|
|
}
|
|
|
|
var body: some View {
|
|
VStack(spacing: 0) {
|
|
Divider().background(WiredTransferDesign.borderLight)
|
|
HStack(spacing: 12) {
|
|
Button(action: onBatchUploadClick) {
|
|
Text(batchButtonTitle)
|
|
.font(.system(size: 15))
|
|
.foregroundStyle(.white)
|
|
.frame(maxWidth: .infinity)
|
|
.frame(height: WiredTransferDesign.bottomButtonHeight)
|
|
.background(AppDesign.primary)
|
|
.clipShape(RoundedRectangle(cornerRadius: WiredTransferDesign.bottomButtonCornerRadius))
|
|
}
|
|
.buttonStyle(.plain)
|
|
|
|
Button(action: onHistoryImportClick) {
|
|
Text("历史导入")
|
|
.font(.system(size: 15))
|
|
.foregroundStyle(isCameraConnected && !selectUploadMode ? AppDesign.primary : WiredTransferDesign.text999)
|
|
.frame(maxWidth: .infinity)
|
|
.frame(height: WiredTransferDesign.bottomButtonHeight)
|
|
.overlay {
|
|
RoundedRectangle(cornerRadius: WiredTransferDesign.bottomButtonCornerRadius)
|
|
.stroke(AppDesign.primary, lineWidth: 1)
|
|
}
|
|
}
|
|
.buttonStyle(.plain)
|
|
.disabled(selectUploadMode || !isCameraConnected)
|
|
|
|
Button(action: onSpecifyUploadClick) {
|
|
Text("指定上传")
|
|
.font(.system(size: 15))
|
|
.foregroundStyle(selectUploadMode ? WiredTransferDesign.text999 : AppDesign.primary)
|
|
.frame(maxWidth: .infinity)
|
|
.frame(height: WiredTransferDesign.bottomButtonHeight)
|
|
.overlay {
|
|
RoundedRectangle(cornerRadius: WiredTransferDesign.bottomButtonCornerRadius)
|
|
.stroke(AppDesign.primary, lineWidth: 1)
|
|
}
|
|
}
|
|
.buttonStyle(.plain)
|
|
.disabled(selectUploadMode)
|
|
}
|
|
.padding(.horizontal, 16)
|
|
.padding(.vertical, 12)
|
|
}
|
|
.background(Color.white)
|
|
}
|
|
}
|