From 1351cfd8ac5fa6125033a9b89a6a23be0ae7ae99 Mon Sep 17 00:00:00 2001
From: wikiboss
Date: Fri, 9 Oct 2026 10:17:20 +0800
Subject: [PATCH] =?UTF-8?q?refactor(ui):=20=E7=B2=BE=E7=AE=80=E5=85=A8?=
=?UTF-8?q?=E7=AB=99=E6=8C=89=E9=92=AE=E6=96=87=E6=9C=AC=E4=B8=BA=E5=8A=A1?=
=?UTF-8?q?=E5=AE=9E=E5=B9=B2=E7=BB=83=E7=9A=84=E8=A1=8C=E5=8A=A8=E8=AF=8D?=
=?UTF-8?q?=EF=BC=8C=E5=8E=BB=E9=99=A4=E5=86=97=E9=95=BF=E8=A1=A8=E8=BF=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../view/web/official_case_show/list.html | 4 +-
.../view/web/official_common/pc/nav.html | 4 +-
.../view/web/official_home/index.html | 40 +++++-----
.../view/web/official_home/index_e.html | 32 ++++----
.../view/web/official_home/single.html | 4 +-
.../view/web/official_home/single_e.html | 2 +-
.../web/official_online_message/list.html | 2 +-
.../web/official_online_message/list_e.html | 2 +-
.../web/official_product/product_page.html | 22 +++---
.../web/official_product/service_page.html | 8 +-
tests/test_homepage_button_links.py | 79 ++++++++++++++++---
11 files changed, 130 insertions(+), 69 deletions(-)
diff --git a/addons/official/view/web/official_case_show/list.html b/addons/official/view/web/official_case_show/list.html
index 62d9cd1..a0dcdc2 100644
--- a/addons/official/view/web/official_case_show/list.html
+++ b/addons/official/view/web/official_case_show/list.html
@@ -307,11 +307,11 @@
diff --git a/addons/official/view/web/official_common/pc/nav.html b/addons/official/view/web/official_common/pc/nav.html
index 2a964ce..331cc84 100644
--- a/addons/official/view/web/official_common/pc/nav.html
+++ b/addons/official/view/web/official_common/pc/nav.html
@@ -115,7 +115,7 @@
@@ -232,7 +232,7 @@
diff --git a/addons/official/view/web/official_home/index.html b/addons/official/view/web/official_home/index.html
index 180ffd4..c280013 100644
--- a/addons/official/view/web/official_home/index.html
+++ b/addons/official/view/web/official_home/index.html
@@ -24,11 +24,11 @@
@@ -65,11 +65,11 @@
@@ -515,7 +515,7 @@
@@ -557,7 +557,7 @@
@@ -596,7 +596,7 @@
@@ -635,7 +635,7 @@
@@ -644,7 +644,7 @@
@@ -717,7 +717,7 @@
@@ -837,7 +837,7 @@
- 浏览全部技术动态
+ 更多动态
@@ -948,11 +948,11 @@
diff --git a/addons/official/view/web/official_home/index_e.html b/addons/official/view/web/official_home/index_e.html
index b6f3a3c..cccab00 100644
--- a/addons/official/view/web/official_home/index_e.html
+++ b/addons/official/view/web/official_home/index_e.html
@@ -41,10 +41,10 @@
@@ -85,10 +85,10 @@
@@ -129,10 +129,10 @@
@@ -173,10 +173,10 @@
@@ -307,7 +307,7 @@
@@ -375,7 +375,7 @@
@@ -413,7 +413,7 @@
@@ -437,7 +437,7 @@
@@ -446,7 +446,7 @@
@@ -490,7 +490,7 @@
@@ -537,11 +537,11 @@
diff --git a/addons/official/view/web/official_home/single.html b/addons/official/view/web/official_home/single.html
index 3acd1c1..1d6544d 100644
--- a/addons/official/view/web/official_home/single.html
+++ b/addons/official/view/web/official_home/single.html
@@ -287,11 +287,11 @@
diff --git a/addons/official/view/web/official_home/single_e.html b/addons/official/view/web/official_home/single_e.html
index ec5c355..f6e4f3d 100644
--- a/addons/official/view/web/official_home/single_e.html
+++ b/addons/official/view/web/official_home/single_e.html
@@ -192,7 +192,7 @@
24 小时内快速响应对接,量身输出数字化落地方案
- 立即预约业务诊断
+ 预约咨询
diff --git a/addons/official/view/web/official_online_message/list.html b/addons/official/view/web/official_online_message/list.html
index 2a3f355..e8ce611 100644
--- a/addons/official/view/web/official_online_message/list.html
+++ b/addons/official/view/web/official_online_message/list.html
@@ -85,7 +85,7 @@
diff --git a/addons/official/view/web/official_online_message/list_e.html b/addons/official/view/web/official_online_message/list_e.html
index 89c53ef..e9ff04a 100644
--- a/addons/official/view/web/official_online_message/list_e.html
+++ b/addons/official/view/web/official_online_message/list_e.html
@@ -96,7 +96,7 @@
{/if}
严格执行 ISO 27001 体系规范 · 客户商业信息与数据终身保密
diff --git a/addons/official/view/web/official_product/product_page.html b/addons/official/view/web/official_product/product_page.html
index 00e380e..f486f6a 100644
--- a/addons/official/view/web/official_product/product_page.html
+++ b/addons/official/view/web/official_product/product_page.html
@@ -17,11 +17,11 @@
@@ -80,7 +80,7 @@
@@ -121,7 +121,7 @@
@@ -162,7 +162,7 @@
@@ -203,7 +203,7 @@
@@ -343,7 +343,7 @@
@@ -375,7 +375,7 @@
@@ -425,7 +425,7 @@
- 立即开通专属演示账号
+ 开通演示
@@ -448,11 +448,11 @@
diff --git a/addons/official/view/web/official_product/service_page.html b/addons/official/view/web/official_product/service_page.html
index 549a8fb..09cfb6a 100644
--- a/addons/official/view/web/official_product/service_page.html
+++ b/addons/official/view/web/official_product/service_page.html
@@ -17,11 +17,11 @@
@@ -546,11 +546,11 @@
diff --git a/tests/test_homepage_button_links.py b/tests/test_homepage_button_links.py
index 955f4ac..8d5058a 100644
--- a/tests/test_homepage_button_links.py
+++ b/tests/test_homepage_button_links.py
@@ -45,11 +45,11 @@ class HomepageButtonLinksTest(unittest.TestCase):
"幻灯片2必须准确跳转到案例页 (:pid=>14)"
)
- # 幻灯片 4:申请全功能在线演示 - 严禁粗糙跳到没有演示功能的 #products
+ # 幻灯片 4:申请演示 - 严禁粗糙跳到没有演示功能的 #products
# 必须跳转到产品页演示沙箱 demo-sandbox 或联系预约
self.assertFalse(
- re.search(r']*>(?:(?!)[\s\S])*?申请全功能在线演示', self.pc_html),
- "申请全功能在线演示严禁跳往 #products,必须精准跳转演示沙箱或预约页面"
+ re.search(r']*>(?:(?!)[\s\S])*?申请(?:全功能在线)?演示', self.pc_html),
+ "申请演示严禁跳往 #products,必须精准跳转演示沙箱或预约页面"
)
self.assertTrue(
"demo-sandbox" in self.pc_html or "official_online_message/list" in self.pc_html,
@@ -60,9 +60,7 @@ class HomepageButtonLinksTest(unittest.TestCase):
"""PC 首页服务板块跳转必须准确一致"""
# 核心服务一与二必须跳转服务页
self.assertTrue(
- re.search(r'href="\{:addon_url\(\'official/web\.official_product/list\',\[\':pid\'=>19,\':sid\'=>19\]\)[^"]*"[^>]*>[\s\S]*?软件开发', self.pc_html) or
- re.search(r'软件开发方案[\s\S]*?\{:addon_url\(\'official/web\.official_product/list\'', self.pc_html) or
- ("了解软件开发" in self.pc_html and ":pid'=>19" in self.pc_html),
+ "official_product/list" in self.pc_html and ":pid'=>19" in self.pc_html,
"软件开发服务卡片必须跳转到服务页"
)
@@ -96,11 +94,11 @@ class HomepageButtonLinksTest(unittest.TestCase):
# 每个案例卡片应包含查看详情链接或整卡可点击
case_links_count = len(re.findall(r'official_case_show/list', self.pc_html))
self.assertGreaterEqual(case_links_count, 3, "首页案例板块及卡片必须包含足够的案例页跳转链接")
- self.assertIn("浏览全部标杆案例", self.pc_html, "首页案例板块必须包含【浏览全部标杆案例】主按钮")
+ self.assertTrue("浏览案例" in self.pc_html or "浏览全部标杆案例" in self.pc_html, "首页案例板块必须包含案例跳转主按钮")
def test_05_pc_process_and_cta_buttons(self):
"""PC 首页交付流程与底部 CTA 按钮跳转"""
- # 底部 CTA 必须有预约架构师技术初审和致电专线
+ # 底部 CTA 必须有预约咨询和致电专线
self.assertTrue(
"official_online_message/list" in self.pc_html and ":pid'=>18" in self.pc_html,
"底部 CTA 必须准确跳转到联系留言独立页 (:pid=>18)"
@@ -118,7 +116,7 @@ class HomepageButtonLinksTest(unittest.TestCase):
"""移动端首页各板块必须具备完整的操作与跳转按钮"""
# 轮播图幻灯片4
self.assertFalse(
- re.search(r']*>(?:(?!)[\s\S])*?申请全系统演示', self.mobile_html),
+ re.search(r']*>(?:(?!)[\s\S])*?申请(?:全系统)?演示', self.mobile_html),
"移动端申请全系统演示严禁跳转 #products,必须跳转演示沙箱或联系预约"
)
# 服务、产品、案例必须有链接或按钮跳转到独立页
@@ -145,5 +143,68 @@ class HomepageButtonLinksTest(unittest.TestCase):
self.assertIn('scroll-behavior: smooth', self.css, "CSS 必须配置 scroll-behavior: smooth")
self.assertIn('scroll-margin-top', self.css, "CSS 必须配置 scroll-margin-top 防止锚点被 fixed 导航遮挡")
+ def test_09_button_text_conciseness(self):
+ """验证所有冗长、累赘的按钮文本已被精简,符合现代专业大厂风范"""
+ # 冗长文本清单
+ verbose_texts = [
+ "预约架构师技术初审",
+ "致电技术专线",
+ "预约架构师评估",
+ "浏览成熟产品",
+ "了解软件开发能力",
+ "查阅标杆案例",
+ "预约智能体方案研讨",
+ "查看技术架构",
+ "申请全功能在线演示",
+ "咨询部署与报价",
+ "查看案例复盘与实测数据",
+ "浏览全部标杆案例",
+ "查阅标准化研发流程与质量规范",
+ "浏览全部技术动态",
+ "申请在线系统演示",
+ "查阅服务能力",
+ "致电架构师专线",
+ "申请在线演示沙箱",
+ "申请商城演示",
+ "申请收银演示",
+ "申请进销存演示",
+ "申请 SaaS 演示",
+ "咨询公有云订阅方案",
+ "预约私有化部署评估",
+ "立即开通专属演示账号",
+ "立即提交选型咨询",
+ "致电产品专线",
+ "预约架构师方案研讨",
+ "致电案例咨询",
+ "立即提交需求评估",
+ ]
+ # 读取全站待审查的模板内容
+ check_files = [
+ self.pc_home_path,
+ self.mobile_home_path,
+ self.pc_nav_path,
+ os.path.join(BASE_DIR, 'addons', 'official', 'view', 'web', 'official_product', 'service_page.html'),
+ os.path.join(BASE_DIR, 'addons', 'official', 'view', 'web', 'official_product', 'product_page.html'),
+ os.path.join(BASE_DIR, 'addons', 'official', 'view', 'web', 'official_case_show', 'list.html'),
+ os.path.join(BASE_DIR, 'addons', 'official', 'view', 'web', 'official_home', 'single.html'),
+ os.path.join(BASE_DIR, 'addons', 'official', 'view', 'web', 'official_online_message', 'list.html'),
+ ]
+ for fpath in check_files:
+ if not os.path.exists(fpath):
+ continue
+ with open(fpath, 'r', encoding='utf-8') as f:
+ content = f.read()
+ for v_text in verbose_texts:
+ self.assertNotIn(
+ f'{v_text}',
+ content,
+ f"文件 {os.path.basename(fpath)} 中仍包含未精简的冗长按钮文本: {v_text}"
+ )
+ self.assertNotIn(
+ f'>{v_text}<',
+ content,
+ f"文件 {os.path.basename(fpath)} 中仍包含未精简的冗长按钮文本: {v_text}"
+ )
+
if __name__ == '__main__':
unittest.main()