对齐有线传图页 Android UI,并改用相对路径持久化本地照片。

还原顶栏、浮动卡片、时间侧栏与底部交互;照片路径改为 CameraDownloads 相对路径并兼容旧数据;格式 Chip 固定 JPG 且不可点击。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-30 11:16:28 +08:00
parent e91a46c315
commit c71b45bdfd
29 changed files with 2097 additions and 256 deletions

View File

@ -0,0 +1,96 @@
//
// WiredTransferTimeSidebar.swift
// suixinkan
//
import SwiftUI
/// 线
struct WiredTransferTimeSidebar: View {
let groups: [WiredTransferDateGroup]
let selectedSlotID: String?
let onToggleSidebar: () -> Void
let onTimeSlotSelected: (String) -> Void
var body: some View {
VStack(spacing: 0) {
Button(action: onToggleSidebar) {
HStack(spacing: 2) {
Image(systemName: "chevron.left")
.font(.system(size: 12))
Text("收起")
.font(.system(size: 11))
}
.foregroundStyle(WiredTransferDesign.text666)
.frame(maxWidth: .infinity)
.padding(.horizontal, 8)
.padding(.vertical, 10)
}
.buttonStyle(.plain)
ScrollView {
VStack(alignment: .leading, spacing: 0) {
ForEach(groups, id: \.dateLabel) { group in
Text(group.dateLabel)
.font(.system(size: 12))
.foregroundStyle(WiredTransferDesign.text999)
.padding(.leading, 10)
.padding(.top, 8)
.padding(.bottom, 4)
ForEach(group.slots) { slot in
timeSlotButton(slot)
}
}
}
.padding(.bottom, 12)
}
}
.frame(width: WiredTransferDesign.sidebarWidth)
.background(WiredTransferDesign.sidebarBackground)
}
private func timeSlotButton(_ slot: WiredTransferTimeSlot) -> some View {
let selected = slot.id == selectedSlotID
return Button {
onTimeSlotSelected(slot.id)
} label: {
VStack(spacing: 2) {
HStack(spacing: 2) {
Image(systemName: "play.fill")
.font(.system(size: 8))
.foregroundStyle(selected ? AppDesign.primary : WiredTransferDesign.text333)
Text(slot.slotStartLabel)
.font(.system(size: 13, weight: selected ? .semibold : .regular))
.foregroundStyle(selected ? AppDesign.primary : WiredTransferDesign.text333)
}
Text("\(slot.photoCount)")
.font(.system(size: 10))
.foregroundStyle(WiredTransferDesign.text999)
}
.frame(maxWidth: .infinity)
.padding(.horizontal, 8)
.padding(.vertical, 8)
.background(selected ? Color.white : Color.clear)
}
.buttonStyle(.plain)
}
}
///
struct WiredTransferSidebarExpandTab: View {
let onExpand: () -> Void
var body: some View {
Button(action: onExpand) {
Image(systemName: "chevron.right")
.font(.system(size: 14))
.foregroundStyle(WiredTransferDesign.text666)
.padding(.horizontal, 4)
.padding(.vertical, 16)
.background(WiredTransferDesign.sidebarBackground)
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
}
.buttonStyle(.plain)
.padding(.leading, 4)
}
}