feat(contact): 实现大公司品牌级联系我们独立页(结构化需求表单、物理双基地地址、架构师直连热线与地图视窗)

这个提交包含在:
wikiboss
2026-10-08 17:28:17 +08:00
父节点 ba9c609f7c
当前提交 c3ee101484
共有 5 个文件被更改,包括 1039 次插入 和 406 次删除

查看文件

@@ -177,13 +177,50 @@ def test_about_page():
return res.summary()
def test_contact_page():
res = TestResult("联系我们独立页 (ContactPage)")
contact_path = os.path.join(BASE_DIR, 'addons', 'official', 'view', 'web', 'official_online_message', 'list.html')
contact_e_path = os.path.join(BASE_DIR, 'addons', 'official', 'view', 'web', 'official_online_message', 'list_e.html')
css_path = os.path.join(BASE_DIR, 'public', 'assets', 'addons', 'official', 'css', 'modern_nhc.css')
html = open(contact_path, 'r', encoding='utf-8').read() if os.path.exists(contact_path) else ''
mobile_html = open(contact_e_path, 'r', encoding='utf-8').read() if os.path.exists(contact_e_path) else ''
css = open(css_path, 'r', encoding='utf-8').read() if os.path.exists(css_path) else ''
res.assert_true('纳海川' in html, "PC 联系我们页必须明确包含品牌名称【纳海川】")
res.assert_true(not re.search(r'纳川(?!海)', html), "PC 联系我们页严禁错误简称为【纳川】")
has_form = '<form' in html and 'name="phone"' in html and 'name="title"' in html
res.assert_true(has_form, "必须包含【表单】板块")
has_map = 'nhc-contact-map' in html or '地图' in html or '园区' in html or '大厦' in html
res.assert_true(has_map, "必须包含【地图】(办公地址与交通指引/地图视窗)板块")
has_phone = '13984036826' in html or 'tel:' in html
res.assert_true(has_phone, "必须包含【电话】板块")
has_addr = '南明区' in html or '花果园' in html or '经开区' in html
res.assert_true(has_addr, "去AI味道:展示具体真实物理实体地址")
has_details = 'server@gynhc.com' in html or '09:00' in html or 'SLA' in html
res.assert_true(has_details, "去AI味道:真实企业邮箱与明确响应时效承诺")
has_emoji = bool(re.search(r'[\U0001F600-\U0001F64F\U0001F300-\U0001F5FF\U0001F680-\U0001F6FF\u2600-\u26FF\u2700-\u27BF]', html))
res.assert_true(not has_emoji, "严禁使用任何 emoji 表情符号")
res.assert_true(bool(mobile_html), "移动端联系我们模板 list_e.html 必须存在")
if mobile_html:
res.assert_true('纳海川' in mobile_html, "移动端模板包含品牌名【纳海川】")
res.assert_true('<form' in mobile_html, "移动端模板包含需求提交表单")
res.assert_true('13984036826' in mobile_html or 'tel:' in mobile_html, "移动端模板包含电话直拨")
return res.summary()
def main():
results = [
test_cases_page(),
test_services_page(),
test_products_page(),
test_nav_megamenu(),
test_about_page()
test_about_page(),
test_contact_page()
]
sys.exit(0 if all(results) else 1)