From 79bde5d0b1d5d32e7d5e3f62f4ccce093c78062e Mon Sep 17 00:00:00 2001 From: API Changelog Bot Date: Thu, 28 May 2026 15:51:26 +0800 Subject: [PATCH] =?UTF-8?q?notice(mp-frontend):=20=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E9=A1=B5=E5=8E=BB=E6=8E=89=E3=80=8C=E7=AE=80?= =?UTF-8?q?=E4=BB=8B=E3=80=8D=E8=A1=8C=20=E2=80=94=20introduction=20?= =?UTF-8?q?=E5=B7=B2=E5=BA=9F=E5=BC=83(#2943=20=E5=90=8E=E7=AB=AF=E6=81=92?= =?UTF-8?q?=E8=BF=94=20null),=E5=89=8D=E7=AB=AF=E5=88=A0=20compare.js=20?= =?UTF-8?q?=E7=AE=80=E4=BB=8B=E8=A1=8C(=E5=90=8E=E7=AB=AF=E9=9B=B6?= =?UTF-8?q?=E6=94=B9=E5=8A=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...product_compare_remove_introduction_row.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 changelogs/2026-05/28_notice_mp_product_compare_remove_introduction_row.md diff --git a/changelogs/2026-05/28_notice_mp_product_compare_remove_introduction_row.md b/changelogs/2026-05/28_notice_mp_product_compare_remove_introduction_row.md new file mode 100644 index 0000000..fad91c7 --- /dev/null +++ b/changelogs/2026-05/28_notice_mp_product_compare_remove_introduction_row.md @@ -0,0 +1,53 @@ +# 【前端】小程序产品对比页: 去掉「简介」行 + +> **类型**: 前端渲染修复(notice,后端无改动) +> **服务**: hl-product-service-v2(`introduction` 早已抹空,无需改后端) +> **日期**: 2026-05-28 +> **影响范围**: 小程序「线路对比 / 产品对比页」核心对比区(packages/product/compare) +> **归属**: 前端(mmg)。后端不建工单,本条仅同步现状 + 修法。 + +--- + +## ⚠️ 问题 + +产品对比页「核心对比」区有一行 **「简介」**,但简介字段(`introduction`)已废弃,后端 `/mp/product/compare` 早已不返该字段 → 这一行对所有产品都显示 `—`(空横线),纯属占位噪音。 + +**用户要求:简介已经没用了,对比页也不要再显示这一行。** + +--- + +## 一、根因 + +- 后端早在工单 **#2943 / PR #2944** 就把 `/mp/product/compare` 的 `subtitle` / `introduction` / `crowdBenefit` 统一抹空返 `null`(对比页只保留核心规格差异)。已合 dev 并部署测试服。 +- 实测测试服 `POST /mp/product/compare?lineId=2043595259778166786`:3 个产品的 `introduction` 全为 `null`(`subtitle` / `crowdBenefit` 同样为 `null`),后端侧完全正确。 +- 但前端对比页 `_buildCoreSection` 里**硬编码**了「简介」行,且**不像「人群优惠」区那样过滤全空行**,所以 `introduction=null` 时这一行依旧渲染成一排 `—`。 + +### 两区对比(为什么人群优惠没这个毛病) + +| 区块 | 构建方法 | 是否过滤空行 | 结果 | +|------|----------|--------------|------| +| 人群优惠 | `_buildCrowdSection` | ✅ 有 `.filter(row => row.values.some(v => v !== '—'))`,全空整段返 null | `crowdBenefit=null` 时整段自动隐藏,无残留 | +| 核心对比 | `_buildCoreSection` | ❌ 行写死,不过滤 | 「简介」行写死 → `introduction=null` 时永远显示一排 `—` | + +--- + +## 二、前端修法(后端零改动) + +删掉 `packages/product/compare/compare.js` 中 `_buildCoreSection` 的「简介」行(约第 140 行): + +```js +// 删除这一行 +{ label: '简介', values: list.map(p => p.introduction || '—'), tall: true }, +``` + +删除后核心对比区保留:天数 / 类型 / 起步价 / 付款方式 / 订金,不再有空的「简介」行。 + +> 备选(更通用):给 `_buildCoreSection` 的 rows 也套一层和人群优惠区一样的"全空行过滤",这样后续任何被后端抹空的字段都会自动隐藏。但当前只有「简介」一行受影响,直接删该行最省事。 + +--- + +## 三、相关接口(均已上线,无变更) + +| 接口 | 方法 | 路径 | 说明 | +|------|------|------|------| +| 产品对比 | POST | `/mp/product/compare?lineId={lineId}` | `subtitle` / `introduction` / `crowdBenefit` 自 #2943 起恒为 `null`,前端不应再展示这些区块 |