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:
@@ -416,6 +416,7 @@ Component({
|
||||
timeText: fmtAgo(c.created_at),
|
||||
// 没有头像字段,用昵称首字做个色块,比一律显示同一个 emoji 强
|
||||
initial: (c.author_name || '?').slice(0, 1),
|
||||
imgs: Array.isArray(c.images) ? c.images : [],
|
||||
})),
|
||||
}),
|
||||
)
|
||||
@@ -954,6 +955,10 @@ Component({
|
||||
wx.showToast({ title: (e && e.message) || '上传失败', icon: 'none' });
|
||||
});
|
||||
},
|
||||
onPreviewCommentImage(e) {
|
||||
const { urls, cur } = e.currentTarget.dataset;
|
||||
if (urls && urls.length) wx.previewImage({ urls, current: cur });
|
||||
},
|
||||
onRemoveCommentImage(e) {
|
||||
const list = this.data.commentImages.slice();
|
||||
list.splice(e.currentTarget.dataset.index, 1);
|
||||
|
||||
Reference in New Issue
Block a user