feat(fe): 社区帖子图片点击放大预览

缩略图保持网格展示,点击走 wx.previewImage 全屏预览,
可左右切换同帖多图(emoji 占位不参与)。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-31 08:33:55 +08:00
parent c852817363
commit f0ea05696c
2 changed files with 9 additions and 1 deletions
+7
View File
@@ -132,6 +132,13 @@ Page({
onCreatePost() {
this.setData({ sheetType: 'createPost', sheetShow: true });
},
// 点缩略图放大预览。只取 http 图(机器人帖的 emoji 占位不参与)
onPreviewImage(e) {
const { urls, cur } = e.currentTarget.dataset;
const list = (urls || []).filter((u) => typeof u === 'string' && u.indexOf('http') === 0);
if (!list.length) return;
wx.previewImage({ current: cur, urls: list });
},
// 长按自己的帖子可删除
onLongPressPost(e) {
const p = this.data.posts[e.currentTarget.dataset.index];