Merge remote-tracking branch 'origin/main'

This commit is contained in:
2025-09-18 16:47:13 +08:00
14 changed files with 305 additions and 11 deletions

View File

@@ -0,0 +1,94 @@
# 缺失的资源文件清单
## 问题描述
网站中引用了大量的图片和资源文件,但实际文件缺失,只有占位符文件存在。
## 缺失的图片文件
根据代码分析,以下图片文件被引用但不存在:
### 首页 (index.html)
- `images/case1.jpg` - 客户案例图片
- `images/case2.jpg` - 客户案例图片
- `images/case3.jpg` - 客户案例图片
- `images/news1.jpg` - 新闻图片
- `images/news2.jpg` - 新闻图片
- `images/news3.jpg` - 新闻图片
### 产品页面 (product.html)
- `images/product-banner.jpg` - 产品横幅图片
### 关于我们 (about.html)
- `images/about-banner.jpg` - 关于我们横幅图片
- `images/team1.jpg` - 团队成员图片
- `images/team2.jpg` - 团队成员图片
- `images/team3.jpg` - 团队成员图片
- `images/team4.jpg` - 团队成员图片
- `images/partner1.png` - 合作伙伴logo
- `images/partner2.png` - 合作伙伴logo
- `images/partner3.png` - 合作伙伴logo
- `images/partner4.png` - 合作伙伴logo
- `images/partner5.png` - 合作伙伴logo
- `images/partner6.png` - 合作伙伴logo
### 解决方案 (solutions.html)
- `images/solution-banner.jpg` - 解决方案横幅图片
- `images/case-logo-1.jpg` - 客户logo
- `images/case-logo-2.jpg` - 客户logo
- `images/case-logo-3.jpg` - 客户logo
### 客户案例 (cases.html)
- `images/case1.jpg` - 客户案例图片
- `images/case2.jpg` - 客户案例图片
- `images/case3.jpg` - 客户案例图片
- `images/case4.jpg` - 客户案例图片
- `images/case5.jpg` - 客户案例图片
- `images/case6.jpg` - 客户案例图片
- `images/client-avatar-1.jpg` - 客户头像
- `images/client-avatar-2.jpg` - 客户头像
- `images/client-avatar-3.jpg` - 客户头像
- `images/testimonial-1.jpg` - 客户评价图片
- `images/testimonial-2.jpg` - 客户评价图片
- `images/testimonial-3.jpg` - 客户评价图片
### 新闻动态 (news.html)
- `images/news1.jpg` - 新闻图片
- `images/news2.jpg` - 新闻图片
- `images/news3.jpg` - 新闻图片
- `images/news4.jpg` - 新闻图片
### 合作伙伴 (partners.html)
- `images/partners-banner.jpg` - 合作伙伴横幅图片
- `images/partner1.jpg` - 合作伙伴图片
- `images/partner2.jpg` - 合作伙伴图片
- `images/partner3.jpg` - 合作伙伴图片
- `images/partner4.jpg` - 合作伙伴图片
- `images/partner5.jpg` - 合作伙伴图片
- `images/partner6.jpg` - 合作伙伴图片
- `images/partner7.jpg` - 合作伙伴图片
- `images/partner8.jpg` - 合作伙伴图片
### 帮助中心 (help.html)
- `images/help-banner.jpg` - 帮助中心横幅图片
### 开发者文档 (docs.html)
- `images/docs-banner.jpg` - 开发者文档横幅图片
### 在线客服 (support.html)
- `images/support-banner.jpg` - 在线客服横幅图片
- `images/wechat-qr.jpg` - 微信二维码图片
## 解决方案
1. **获取原始图片资源**:联系设计团队或项目负责人获取所有缺失的图片文件
2. **使用占位符替代**:暂时使用现有的占位符图片替代所有缺失的图片
3. **生成测试图片**:使用图片生成工具创建临时的测试图片
## 当前状态
- ✅ 所有HTML页面的导航栏链接已更新完成
- ✅ 页脚中的"更新日志"文本已统一改为"新闻动态"
- ✅ 外部CDN资源链接正常
- ❌ 本地图片资源大量缺失
- ✅ JavaScript文件存在 (`js/main.js`)
## 建议
建议优先处理首页、产品页面和关于我们页面的图片,这些是用户最常访问的页面。

View File

@@ -539,7 +539,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -660,7 +660,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

135
website/check_navigation.py Normal file
View File

@@ -0,0 +1,135 @@
#!/usr/bin/env python3
"""
导航栏一致性检查脚本
检查所有主要页面的导航栏是否包含一致的链接
"""
import os
import re
from bs4 import BeautifulSoup
# 要检查的页面列表
PAGES_TO_CHECK = [
'index.html',
'product.html',
'solutions.html',
'cases.html',
'about.html',
'news.html',
'contact.html',
'help.html',
'docs.html',
'partners.html',
'support.html'
]
# 期望的导航链接(按顺序)
EXPECTED_NAV_LINKS = [
('首页', 'index.html'),
('产品介绍', 'product.html'),
('解决方案', 'solutions.html'),
('客户案例', 'cases.html'),
('关于我们', 'about.html'),
('新闻动态', 'news.html'),
('帮助中心', 'help.html'),
('开发者文档', 'docs.html'),
('合作伙伴', 'partners.html'),
('在线客服', 'support.html'),
('联系我们', 'contact.html')
]
def check_navigation_consistency():
"""检查所有页面的导航栏一致性"""
website_dir = os.path.dirname(os.path.abspath(__file__))
results = {}
for page in PAGES_TO_CHECK:
page_path = os.path.join(website_dir, page)
if not os.path.exists(page_path):
print(f"⚠️ 页面不存在: {page}")
continue
try:
with open(page_path, 'r', encoding='utf-8') as f:
content = f.read()
soup = BeautifulSoup(content, 'html.parser')
# 查找导航栏
navbar = soup.find('nav', class_='navbar')
if not navbar:
print(f"⚠️ {page}: 未找到导航栏")
continue
# 查找导航链接
nav_links = []
nav_items = navbar.find_all('li', class_='nav-item')
for item in nav_items:
link = item.find('a', class_='nav-link')
if link:
nav_links.append({
'text': link.get_text(strip=True),
'href': link.get('href', ''),
'active': 'active' in link.get('class', [])
})
results[page] = {
'nav_links': nav_links,
'active_page': next((link['text'] for link in nav_links if link['active']), None)
}
print(f"{page}: 找到 {len(nav_links)} 个导航链接")
if results[page]['active_page']:
print(f" 当前活动页: {results[page]['active_page']}")
except Exception as e:
print(f"{page}: 解析错误 - {e}")
# 检查一致性
print("\n" + "="*50)
print("导航栏一致性检查结果:")
print("="*50)
all_consistent = True
for page, data in results.items():
print(f"\n📄 {page}:")
# 检查链接数量
if len(data['nav_links']) != len(EXPECTED_NAV_LINKS):
print(f" ❌ 链接数量不一致: 期望 {len(EXPECTED_NAV_LINKS)},实际 {len(data['nav_links'])}")
all_consistent = False
# 检查链接顺序和内容
for i, (expected_text, expected_href) in enumerate(EXPECTED_NAV_LINKS):
if i >= len(data['nav_links']):
print(f" ❌ 缺少链接: {expected_text} ({expected_href})")
all_consistent = False
continue
actual_link = data['nav_links'][i]
if actual_link['text'] != expected_text or actual_link['href'] != expected_href:
print(f" ❌ 链接不匹配: ")
print(f" 期望: {expected_text} -> {expected_href}")
print(f" 实际: {actual_link['text']} -> {actual_link['href']}")
all_consistent = False
# 检查活动页面
if data['active_page'] and page != 'index.html':
expected_active = next((text for text, href in EXPECTED_NAV_LINKS if href == page), None)
if data['active_page'] != expected_active:
print(f" ❌ 活动页面不正确: 期望 {expected_active},实际 {data['active_page']}")
all_consistent = False
if all_consistent:
print(f"\n🎉 所有页面导航栏一致!")
else:
print(f"\n⚠️ 存在不一致的导航栏,请检查上述问题")
return all_consistent
if __name__ == '__main__':
check_navigation_consistency()

View File

@@ -0,0 +1,65 @@
#!/usr/bin/env python3
"""
检查网站资源文件完整性的脚本
"""
import os
import re
from pathlib import Path
def extract_resource_links(file_path):
"""从HTML文件中提取资源链接"""
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
# 匹配图片链接
img_pattern = r'src="([^"]*\.(?:jpg|jpeg|png|gif|svg|ico))"'
# 匹配CSS和JS链接相对路径
resource_pattern = r'(?:src|href)="([^"]*\.(?:css|js))"'
img_links = re.findall(img_pattern, content, re.IGNORECASE)
resource_links = re.findall(resource_pattern, content, re.IGNORECASE)
# 过滤掉外部链接
local_img_links = [link for link in img_links if not link.startswith(('http://', 'https://', '//'))]
local_resource_links = [link for link in resource_links if not link.startswith(('http://', 'https://', '//'))]
return local_img_links + local_resource_links
def check_resources():
"""检查所有资源文件是否存在"""
website_dir = Path(__file__).parent
html_files = list(website_dir.glob('*.html'))
missing_resources = []
existing_resources = []
for html_file in html_files:
print(f"检查文件: {html_file.name}")
resources = extract_resource_links(html_file)
for resource in resources:
resource_path = website_dir / resource
if resource_path.exists():
existing_resources.append((html_file.name, resource, "存在"))
else:
missing_resources.append((html_file.name, resource, "缺失"))
# 输出结果
print("\n=== 资源检查结果 ===")
if missing_resources:
print("\n❌ 缺失的资源文件:")
for file, resource, status in missing_resources:
print(f" {file} -> {resource} ({status})")
else:
print("\n✅ 所有资源文件都存在")
if existing_resources:
print(f"\n✅ 存在的资源文件: {len(existing_resources)}")
return missing_resources
if __name__ == "__main__":
check_resources()

View File

@@ -785,7 +785,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -473,7 +473,7 @@ client = NiuMallClient(api_key, api_secret)</code></pre>
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -405,7 +405,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -480,7 +480,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -470,7 +470,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -497,7 +497,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -576,7 +576,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -551,7 +551,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>

View File

@@ -501,7 +501,7 @@
<li class="mb-2"><a href="product.html">功能介绍</a></li>
<li class="mb-2"><a href="solutions.html">解决方案</a></li>
<li class="mb-2"><a href="cases.html">客户案例</a></li>
<li class="mb-2"><a href="news.html">更新日志</a></li>
<li class="mb-2"><a href="news.html">新闻动态</a></li>
</ul>
</div>