From 77f72d304472c3f07a1438e3dae50c346c955645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Thu, 29 Jan 2026 11:45:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=B9=E6=8D=AEstatus=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=BF=87=E6=BB=A4=E5=8A=A8=E6=80=81=EF=BC=8C0?= =?UTF-8?q?=E5=92=8C2=E4=BB=85=E8=87=AA=E5=B7=B1=E5=8F=AF=E8=A7=81?= =?UTF-8?q?=EF=BC=8C1=E6=89=80=E6=9C=89=E4=BA=BA=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/eggbar/eggbar.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pages/eggbar/eggbar.js b/pages/eggbar/eggbar.js index 93e737a..a376f07 100644 --- a/pages/eggbar/eggbar.js +++ b/pages/eggbar/eggbar.js @@ -186,6 +186,21 @@ Page({ return post; }); + // 根据status字段过滤动态:0仅自己可见,1所有人可见,2仅自己可见 + newPosts = newPosts.filter(post => { + // 如果status为1,所有人可见 + if (post.status === 1) { + return true; + } + // 如果status为0或2,仅自己可见 + if (post.status === 0 || post.status === 2) { + // 检查是否是当前用户的动态 + return post.user_id === userId; + } + // 默认显示 + return true; + }); + // 如果是第一页且没有数据,使用默认动态数据 if (this.data.page === 1 && (!newPosts || newPosts.length === 0)) { newPosts = [