From 57784588c85c59f66a806c127ffb154ff4fd6532 Mon Sep 17 00:00:00 2001 From: xiaji Date: Sun, 14 Jun 2026 20:50:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(detail):=20=E4=B8=AD=E6=96=87=E6=BA=90?= =?UTF-8?q?=E5=A4=B4=20RSS=20=E6=96=87=E7=AB=A0=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=AF=91=E6=96=87=E6=9D=BF=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前 commit 3/4 只针对 is_short_news 隐藏译文, 中文 RSS 长新闻(原文就是中文)走的是 TMT 中翻中, 详情页仍显示"文章译文"和"文章原文"两个冗余板块。 新规则:isChineseSource = isShort || lang_src.startsWith('zh') - 短新闻 -> 显示"短讯正文"卡(原有) - 中文 RSS 长新闻 -> 显示"文章正文"卡(新增,只一张卡,无译文) - 其他长新闻 -> 显示"文章译文" + 可切换"文章原文"(原有) 隐藏规则(对所有中文源头): - 翻译状态/引擎 tag - 重译按钮(commit 4 的 guard 已拒绝;前端再次隐藏) - 原文链接按钮 - AI 插图卡片(中文源头不需配图) - "文章原文"卡片(在"文章正文"已经显示了) 后端不拦截(中翻中不出错,只是浪费一点配额) -- 影响:腾讯 TMT 月配额可能略快用完,可下次单独优化 (在 translation_loop 加 lang_src=zh 跳过)。 范围:仅 ArticleDetail.vue 一个文件,+25/-6 行。 --- frontend/src/views/ArticleDetail.vue | 31 ++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/ArticleDetail.vue b/frontend/src/views/ArticleDetail.vue index 29cc531..524311f 100644 --- a/frontend/src/views/ArticleDetail.vue +++ b/frontend/src/views/ArticleDetail.vue @@ -167,6 +167,16 @@ const originalBody = computed(() => { // - 隐藏"原文链接"(合成 url,打开无意义) const isShort = computed(() => !!article.value?.is_short_news) +// 中文源头 = 短新闻 OR lang_src 以 zh 开头(中文 RSS 源,原文就是中文) +// 中文源头的文章不显示"译文"板块(原文本就是中文,翻译无意义); +// 后端不做拦截(中翻中虽然浪费配额但不出错),仅前端隐藏。 +const isChineseSource = computed(() => { + if (!article.value) return false + if (isShort.value) return true + const lang = (article.value.lang_src || '').toLowerCase() + return lang.startsWith('zh') +}) + // 短新闻正文:用 body_zh_text(ingest 时已 = body_text),按段落切分 const shortBody = computed(() => { const a = article.value @@ -229,10 +239,10 @@ onMounted(load) {{ article.lang_src.toUpperCase() }} 📰 短讯 {{ article.source_ref }} - + 翻译:{{ article.translation_status }} - + {{ article.translation_engine }} @@ -283,13 +293,13 @@ onMounted(load) {{ showTranslation ? '隐藏译文' : '显示译文' }} - + 重译 跑 LLM 增强 - + 原文链接 ↗ @@ -418,6 +428,15 @@ onMounted(load) 暂无正文 + + + +
+ 暂无正文 + +
@@ -448,7 +467,7 @@ onMounted(load)
- + @@ -456,7 +475,7 @@ onMounted(load) -
+