fix: 评论配图整条链路补全 + 宠物切换条吸顶

## 评论图片传了等于没传

上次只做了一半:model 加了 Images 字段、前端做了上传 UI,但
handler 的 commentReq 没有 images、service 的 CreateComment 连
参数都没有,图片上传完就丢了;评论列表也从没渲染过图片。

补齐:请求体 → service 落库(JSON 数组) → 列表回显 → 点击大图预览。
实测带两张图的评论和纯文字评论各存各的,互不影响。

## 宠物切换条吸顶

首页/计划/记录/报告四页的 pet-switch 原本在 scroll-view 里,滚下去
就找不到了。而切宠物是随时要用的动作——多宠用户看着 A 的数据想切到
B,还得先滚回顶部。

移出滚动区,放在导航栏下方做成固定的一条,带毛玻璃和分隔线。首页的
问候语留在滚动区里,滚走就滚走,反正它只在刚进页面时有意义。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-29 16:19:32 +08:00
parent 5b2f8e50bc
commit 535ef08da7
10 changed files with 42 additions and 11 deletions
+3 -2
View File
@@ -113,7 +113,8 @@ func (h *Handler) ListComments(c *gin.Context) {
}
type commentReq struct {
Content string `json:"content"`
Content string `json:"content"`
Images []string `json:"images"`
}
// CreateComment POST /api/posts/:id/comments
@@ -127,7 +128,7 @@ func (h *Handler) CreateComment(c *gin.Context) {
response.FailParams(c, "评论内容不能为空")
return
}
comment, err := h.svc.CreateComment(middleware.UserID(c), idParam(c, "id"), req.Content)
comment, err := h.svc.CreateComment(middleware.UserID(c), idParam(c, "id"), req.Content, req.Images)
if err != nil {
respondErr(c, err)
return