feat: 修复MainView Tab切换问题并优化MeView逻辑
- 新增MainView Tab切换问题分析文档,详细描述问题原因及解决方案。 - 优化BottomTabView的绑定逻辑,简化状态管理,确保Tab切换时状态正确更新。 - 在MeView中实现用户信息加载逻辑调整,确保动态列表仅在首次进入时加载,并添加错误处理视图。 - 创建EmptyStateView组件,提供统一的空状态展示和重试功能。 - 增强调试信息输出,便于后续问题排查和用户体验提升。
This commit is contained in:
@@ -21,7 +21,7 @@ struct ConfigView: View {
|
||||
} else if let configData = store.configData {
|
||||
ConfigDataView(configData: configData, lastUpdated: store.lastUpdated)
|
||||
} else {
|
||||
EmptyStateView()
|
||||
// EmptyStateView()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,20 +161,20 @@ struct SettingsSection: View {
|
||||
}
|
||||
|
||||
// MARK: - Empty State View
|
||||
struct EmptyStateView: View {
|
||||
var body: some View {
|
||||
VStack(spacing: 16) {
|
||||
Image(systemName: "arrow.down.circle")
|
||||
.font(.system(size: 40))
|
||||
.foregroundColor(.blue)
|
||||
Text(LocalizedString("config.click_to_load", comment: ""))
|
||||
.font(.body)
|
||||
.multilineTextAlignment(.center)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.frame(maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
//struct EmptyStateView: View {
|
||||
// var body: some View {
|
||||
// VStack(spacing: 16) {
|
||||
// Image(systemName: "arrow.down.circle")
|
||||
// .font(.system(size: 40))
|
||||
// .foregroundColor(.blue)
|
||||
// Text(LocalizedString("config.click_to_load", comment: ""))
|
||||
// .font(.body)
|
||||
// .multilineTextAlignment(.center)
|
||||
// .foregroundColor(.secondary)
|
||||
// }
|
||||
// .frame(maxHeight: .infinity)
|
||||
// }
|
||||
//}
|
||||
|
||||
// MARK: - Action Buttons View
|
||||
struct ActionButtonsView: View {
|
||||
@@ -229,10 +229,10 @@ struct InfoRow: View {
|
||||
}
|
||||
|
||||
// MARK: - Preview
|
||||
#Preview {
|
||||
ConfigView(
|
||||
store: Store(initialState: ConfigFeature.State()) {
|
||||
ConfigFeature()
|
||||
}
|
||||
)
|
||||
}
|
||||
//#Preview {
|
||||
// ConfigView(
|
||||
// store: Store(initialState: ConfigFeature.State()) {
|
||||
// ConfigFeature()
|
||||
// }
|
||||
// )
|
||||
//}
|
||||
|
Reference in New Issue
Block a user