feat: 更新文档和视图以支持iOS 17及优化用户体验
- 更新Yana项目文档,调整适用版本至iOS 17,确保与最新开发环境兼容。 - 在多个视图中重构代码,优化状态管理和视图逻辑,提升用户体验。 - 添加默认初始化器以简化状态管理,确保各个Feature的状态一致性。 - 更新视图组件,移除不必要的硬编码,增强代码可读性和维护性。 - 修复多个视图中的逻辑错误,确保功能正常运行。
This commit is contained in:
@@ -5,50 +5,48 @@ struct SplashView: View {
|
||||
let store: StoreOf<SplashFeature>
|
||||
|
||||
var body: some View {
|
||||
WithPerceptionTracking {
|
||||
ZStack {
|
||||
Group {
|
||||
// 根据导航目标显示不同页面
|
||||
if let navigationDestination = store.navigationDestination {
|
||||
switch navigationDestination {
|
||||
case .login:
|
||||
// 显示登录页面
|
||||
LoginView(
|
||||
store: Store(
|
||||
initialState: LoginFeature.State()
|
||||
) {
|
||||
LoginFeature()
|
||||
},
|
||||
onLoginSuccess: {
|
||||
// 登录成功后导航到主页面
|
||||
store.send(.navigateToMain)
|
||||
}
|
||||
)
|
||||
case .main:
|
||||
// 显示主应用页面
|
||||
MainView(
|
||||
store: Store(
|
||||
initialState: MainFeature.State()
|
||||
) {
|
||||
MainFeature()
|
||||
},
|
||||
onLogout: {
|
||||
store.send(.navigateToLogin)
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
// 显示启动画面
|
||||
splashContent
|
||||
ZStack {
|
||||
Group {
|
||||
// 根据导航目标显示不同页面
|
||||
if let navigationDestination = store.navigationDestination {
|
||||
switch navigationDestination {
|
||||
case .login:
|
||||
// 显示登录页面
|
||||
LoginView(
|
||||
store: Store(
|
||||
initialState: LoginFeature.State()
|
||||
) {
|
||||
LoginFeature()
|
||||
},
|
||||
onLoginSuccess: {
|
||||
// 登录成功后导航到主页面
|
||||
store.send(.navigateToMain)
|
||||
}
|
||||
)
|
||||
case .main:
|
||||
// 显示主应用页面
|
||||
MainView(
|
||||
store: Store(
|
||||
initialState: MainFeature.State()
|
||||
) {
|
||||
MainFeature()
|
||||
},
|
||||
onLogout: {
|
||||
store.send(.navigateToLogin)
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
// 显示启动画面
|
||||
splashContent
|
||||
}
|
||||
.onAppear {
|
||||
store.send(.onAppear)
|
||||
}
|
||||
|
||||
// API Loading 效果视图 - 显示在所有内容之上
|
||||
APILoadingEffectView()
|
||||
}
|
||||
.onAppear {
|
||||
store.send(.onAppear)
|
||||
}
|
||||
|
||||
// API Loading 效果视图 - 显示在所有内容之上
|
||||
APILoadingEffectView()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user