Wire home routing for cloud and material management pages, move shared cloud models into Assets, and add API/view model tests. Co-authored-by: Cursor <cursoragent@cursor.com>
81 lines
2.4 KiB
Swift
81 lines
2.4 KiB
Swift
//
|
||
// HomeSupportViews.swift
|
||
// suixinkan
|
||
//
|
||
// Created by Codex on 2026/6/22.
|
||
//
|
||
|
||
import SwiftUI
|
||
|
||
extension HomeRoute {
|
||
/// 将首页路由映射为真实页面或迁移占位页。
|
||
@ViewBuilder
|
||
var destinationView: some View {
|
||
switch self {
|
||
case .profileSpace:
|
||
ProfileView()
|
||
case .scenicSelection:
|
||
ScenicSelectionView()
|
||
case .permissionApply:
|
||
PermissionApplyView()
|
||
case .permissionApplyStatus:
|
||
PermissionApplyStatusView()
|
||
case .scenicApplication:
|
||
ScenicApplicationView()
|
||
case .moreFunctions:
|
||
HomeMoreFunctionsView()
|
||
case .settings:
|
||
SettingsCenterView()
|
||
case .paymentCollection:
|
||
PaymentCollectionView()
|
||
case .wallet:
|
||
WalletView()
|
||
case .taskManagement:
|
||
TaskManagementView()
|
||
case .taskCreate:
|
||
TaskCreateView()
|
||
case .taskDetail(let id, let summary):
|
||
TaskDetailView(taskId: id, summary: summary)
|
||
case .cloudStorage:
|
||
CloudStorageView()
|
||
case .cloudStorageTransit:
|
||
CloudStorageTransitView()
|
||
case .materialLibrary:
|
||
MediaLibraryView()
|
||
case .materialUpload:
|
||
MediaLibraryUploadView()
|
||
case let .modulePlaceholder(uri, title):
|
||
HomeMigrationModuleView(title: title, uri: uri)
|
||
}
|
||
}
|
||
}
|
||
|
||
/// 首页迁移占位视图,用于承接尚未同步的功能入口。
|
||
struct HomeMigrationModuleView: View {
|
||
let title: String
|
||
let uri: String
|
||
|
||
var body: some View {
|
||
VStack(spacing: AppMetrics.Spacing.medium) {
|
||
Image(systemName: "square.grid.2x2")
|
||
.font(.system(size: 44, weight: .semibold))
|
||
.foregroundStyle(AppDesign.primary)
|
||
|
||
Text(title)
|
||
.font(.system(size: AppMetrics.FontSize.title2, weight: .semibold))
|
||
.foregroundStyle(AppDesign.textPrimary)
|
||
|
||
Text(uri)
|
||
.font(.system(size: AppMetrics.FontSize.subheadline))
|
||
.foregroundStyle(AppDesign.textSecondary)
|
||
.lineLimit(2)
|
||
.multilineTextAlignment(.center)
|
||
.padding(.horizontal, AppMetrics.Spacing.large)
|
||
}
|
||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||
.background(Color(hex: 0xF5F7FA))
|
||
.navigationTitle(title)
|
||
.navigationBarTitleDisplayMode(.inline)
|
||
}
|
||
}
|