Files
suixinkan_ios_new/suixinkan/Features/Home/Views/HomeSupportViews.swift
汉秋 e8bc9b7f44 Add Payment and Wallet modules with home routing integration.
Introduce real payment collection and wallet screens to replace home menu placeholders, wire APIs through RootView, and support bank card OSS uploads plus QR code saving to the photo library.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 17:46:01 +08:00

89 lines
2.8 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.

//
// 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:
HomeScenicSelectionView()
case .moreFunctions:
HomeMoreFunctionsView()
case .settings:
SettingsCenterView()
case .paymentCollection:
PaymentCollectionView()
case .wallet:
WalletView()
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)
}
}
///
struct HomeScenicSelectionView: View {
@Environment(AccountContext.self) private var accountContext
@Environment(\.dismiss) private var dismiss
var body: some View {
List(accountContext.scenicScopes) { scenic in
Button {
accountContext.selectScenic(id: scenic.id)
dismiss()
} label: {
HStack {
Text(scenic.name)
.foregroundStyle(AppDesign.textPrimary)
Spacer()
if accountContext.currentScenic?.id == scenic.id {
Image(systemName: "checkmark")
.font(.system(size: AppMetrics.ControlSize.smallIcon, weight: .semibold))
.foregroundStyle(AppDesign.primary)
}
}
}
}
.navigationTitle("景区选择")
.navigationBarTitleDisplayMode(.inline)
}
}