feat: 添加CreateFeed功能及相关视图组件

- 新增CreateFeedView和CreateFeedFeature,支持用户发布图文动态。
- 在FeedView中集成CreateFeedView,允许用户通过加号按钮访问发布界面。
- 实现图片选择和文本输入功能,支持最多9张图片的上传。
- 添加发布API请求模型,处理动态发布逻辑。
- 更新FeedFeature以管理CreateFeedView的显示状态,确保用户体验流畅。
- 完善UI结构分析与执行计划文档,明确开发步骤和技术要点。
This commit is contained in:
edwinQQQ
2025-07-16 15:53:32 +08:00
parent 33a558ae7b
commit 4bbb4f8434
5 changed files with 703 additions and 2 deletions

View File

@@ -13,6 +13,9 @@ struct FeedFeature {
//
var isInitialized = false
// CreateFeedView
var isShowingCreateFeed = false
}
enum Action: Equatable {
@@ -22,6 +25,11 @@ struct FeedFeature {
case momentsResponse(TaskResult<MomentsLatestResponse>)
case clearError
case retryLoad
// CreateFeedView Action
case showCreateFeed
case dismissCreateFeed
case createFeedCompleted
}
@Dependency(\.apiService) var apiService
@@ -131,7 +139,20 @@ struct FeedFeature {
} else {
return .send(.loadMoreMoments)
}
case .showCreateFeed:
state.isShowingCreateFeed = true
return .none
case .dismissCreateFeed:
state.isShowingCreateFeed = false
return .none
case .createFeedCompleted:
state.isShowingCreateFeed = false
//
return .send(.loadLatestMoments)
}
}
}
}
}