feat: 实现MomentListItem点赞功能及状态管理

- 在MomentListItem中新增点赞功能,用户点击按钮可触发点赞请求。
- 使用MVVM+Combine架构管理点赞状态,确保UI与状态同步。
- 添加加载状态和错误处理,提升用户体验和交互反馈。
- 更新相关视图以支持新的点赞逻辑,优化代码可读性和维护性。
This commit is contained in:
edwinQQQ
2025-08-07 11:50:30 +08:00
parent a340163490
commit 6b575dab27
6 changed files with 459 additions and 355 deletions

View File

@@ -40,7 +40,8 @@ struct MomentListHomePage: View {
.padding(.top, 16)
//
Text(LocalizedString("feedList.slogan", comment: "The disease is like a cruel ruler,\nand time is our most precious treasure.\nEvery moment we live is a victory\nagainst the inevitable."))
Text(LocalizedString("feedList.slogan",
comment: ""))
.font(.system(size: 16))
.multilineTextAlignment(.leading)
.foregroundColor(.white.opacity(0.9))
@@ -64,7 +65,8 @@ struct MomentListHomePage: View {
debugInfoSync(" 图片数量: \(images.count)")
}
)
.padding(.horizontal, 16)
.padding(.leading, 16)
.padding(.trailing, 32)
.onAppear {
//
if index == viewModel.moments.count - 3 {
@@ -94,7 +96,7 @@ struct MomentListHomePage: View {
.padding(.vertical, 20)
}
}
.padding(.bottom, 100) //
.padding(.bottom, 160) //
}
.refreshable {
//