feat: 实现DetailView头像点击功能并优化MeView
- 在DetailView中添加头像点击功能,支持展示非当前用户的主页。 - 更新OptimizedDynamicCardView以支持头像点击回调。 - 修改DetailFeature以管理用户主页显示状态。 - 在MeView中添加关闭按钮支持,优化用户体验。 - 确保其他页面的兼容性,未影响现有功能。
This commit is contained in:
@@ -22,6 +22,10 @@ struct DetailFeature {
|
||||
// 新增:是否需要关闭DetailView
|
||||
var shouldDismiss = false
|
||||
|
||||
// 新增:显示用户主页相关状态
|
||||
var showUserProfile = false
|
||||
var targetUserId: Int = 0
|
||||
|
||||
init(moment: MomentsInfo) {
|
||||
self.moment = moment
|
||||
}
|
||||
@@ -41,6 +45,10 @@ struct DetailFeature {
|
||||
// 新增:当前用户ID相关actions
|
||||
case loadCurrentUserId
|
||||
case currentUserIdLoaded(String?)
|
||||
|
||||
// 新增:用户主页相关actions
|
||||
case showUserProfile(Int)
|
||||
case hideUserProfile
|
||||
}
|
||||
|
||||
var body: some ReducerOf<Self> {
|
||||
@@ -190,6 +198,15 @@ struct DetailFeature {
|
||||
debugInfoSync("🔍 DetailFeature: 请求关闭DetailView")
|
||||
state.shouldDismiss = true
|
||||
return .none
|
||||
|
||||
case let .showUserProfile(userId):
|
||||
state.targetUserId = userId
|
||||
state.showUserProfile = true
|
||||
return .none
|
||||
|
||||
case .hideUserProfile:
|
||||
state.showUserProfile = false
|
||||
return .none
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user