Files
suixinkan_ios_new/suixinkan/Features/Main/Views/PlaceholderRootViews.swift

84 lines
2.1 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.

//
// PlaceholderRootViews.swift
// suixinkan
//
// Created by Codex on 2026/6/18.
//
import SwiftUI
///
struct HomeRootView: View {
var body: some View {
HomeView()
}
}
///
struct OrdersRootView: View {
@EnvironmentObject private var permissionContext: PermissionContext
var body: some View {
if permissionContext.currentAppRole?.isStoreAdmin == true {
StoreAdminOrderListView()
} else {
StoreOrderListView()
}
}
}
///
struct StatisticsRootView: View {
var body: some View {
StatisticsView()
}
}
///
struct ProfileRootView: View {
var body: some View {
ProfileView()
}
}
/// Tab
private struct PlaceholderTabRootView: View {
@EnvironmentObject private var router: RouterPath
let title: String
let systemImage: String
var body: some View {
VStack(spacing: 16) {
Image(systemName: systemImage)
.font(.system(size: 44, weight: .semibold))
.foregroundStyle(.tint)
Text(title)
.font(.title2.weight(.semibold))
Button {
router.navigate(to: .placeholder(title: "\(title)详情"))
} label: {
Label("打开详情", systemImage: "chevron.right")
}
.buttonStyle(.borderedProminent)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color(.systemGroupedBackground))
}
}
/// Tab NavigationStack
struct PlaceholderDetailView: View {
let title: String
var body: some View {
Text(title)
.font(.title3.weight(.medium))
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color(.systemGroupedBackground))
.navigationTitle(title)
}
}