feat: 实现DetailView头像点击功能并优化MeView

- 在DetailView中添加头像点击功能,支持展示非当前用户的主页。
- 更新OptimizedDynamicCardView以支持头像点击回调。
- 修改DetailFeature以管理用户主页显示状态。
- 在MeView中添加关闭按钮支持,优化用户体验。
- 确保其他页面的兼容性,未影响现有功能。
This commit is contained in:
edwinQQQ
2025-08-01 16:12:24 +08:00
parent 57ba103996
commit fa544139c1
11 changed files with 214 additions and 51 deletions

View File

@@ -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 {
// IDactions
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
}
}
}