From bee22d1782a343cc1b57e0c60b45144b55ed420f Mon Sep 17 00:00:00 2001 From: 2977094657 <2977094657@qq.com> Date: Tue, 27 Jan 2026 16:27:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(sns):=20=E5=89=8D=E7=AB=AF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=9C=8B=E5=8F=8B=E5=9C=88=E9=A1=B5=E9=9D=A2=E5=B9=B6?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=80=99=E9=80=89=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 /sns 页面:时间线列表、账号切换、隐私模式、复制动态 JSON - 图片预览支持候选匹配切换并保存(localStorage + /api/sns/media_picks) - 聊天页侧边栏增加头像/朋友圈入口,隐私模式开关持久化(chat/sns 共用) - app.vue 增加 --dpr 与 sidebar rail CSS 变量,并在 resize 时刷新 - useApi 补充 sns 相关接口封装 --- frontend/app.vue | 21 +- frontend/composables/useApi.js | 43 + frontend/pages/chat/[[username]].vue | 130 ++- frontend/pages/sns.vue | 1092 ++++++++++++++++++++++++++ 4 files changed, 1262 insertions(+), 24 deletions(-) create mode 100644 frontend/pages/sns.vue diff --git a/frontend/app.vue b/frontend/app.vue index 75ca905..cb55b98 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -14,12 +14,23 @@ // So we detect desktop onMounted and update reactively. const isDesktop = ref(false) +const updateDprVar = () => { + const dpr = window.devicePixelRatio || 1 + document.documentElement.style.setProperty('--dpr', String(dpr)) +} + onMounted(() => { isDesktop.value = !!window?.wechatDesktop + updateDprVar() + window.addEventListener('resize', updateDprVar) +}) + +onBeforeUnmount(() => { + window.removeEventListener('resize', updateDprVar) }) const route = useRoute() -const isChatRoute = computed(() => route.path?.startsWith('/chat')) +const isChatRoute = computed(() => route.path?.startsWith('/chat') || route.path?.startsWith('/sns')) const rootClass = computed(() => { const base = 'bg-gradient-to-br from-green-50 via-emerald-50 to-green-100' @@ -34,6 +45,14 @@ const contentClass = computed(() =>