整理后
This commit is contained in:
+1030
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,739 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>公司介绍 - Chookoo</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg: #f5f7fb;
|
||||
--text: #0f172a;
|
||||
--muted: #5b6472;
|
||||
--primary: #2f6bff;
|
||||
--primary-weak: #e8f1ff;
|
||||
--card: #ffffff;
|
||||
--line: #e5e7eb;
|
||||
--shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
html { overflow-y: scroll; }
|
||||
body {
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
min-width: 1280px;
|
||||
line-height: 1.6;
|
||||
transform-origin: top left;
|
||||
}
|
||||
a { color: inherit; text-decoration: none; }
|
||||
|
||||
/* 导航栏 */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.navbar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
padding: 0 32px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.navbar-logo img { height: 40px; }
|
||||
.navbar-back {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.navbar-back:hover { color: var(--text); }
|
||||
|
||||
/* 主内容区 */
|
||||
.main-content {
|
||||
padding-top: 100px;
|
||||
padding-bottom: 80px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.container {
|
||||
width: 1000px;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
/* 搜索区域 */
|
||||
.search-section {
|
||||
text-align: center;
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.search-title {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 8px;
|
||||
color: var(--text);
|
||||
}
|
||||
.search-subtitle {
|
||||
font-size: 16px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.search-box {
|
||||
position: relative;
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.search-input {
|
||||
width: 100%;
|
||||
padding: 16px 24px 16px 52px;
|
||||
font-size: 16px;
|
||||
border: 2px solid var(--line);
|
||||
border-radius: 16px;
|
||||
background: var(--card);
|
||||
outline: none;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.search-input:focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.1);
|
||||
}
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--muted);
|
||||
}
|
||||
.search-results {
|
||||
position: absolute;
|
||||
top: calc(100% + 8px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: var(--card);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 32px rgba(0,0,0,0.12);
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
display: none;
|
||||
z-index: 100;
|
||||
}
|
||||
.search-results.active { display: block; }
|
||||
.search-result-item {
|
||||
padding: 14px 20px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid var(--line);
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.search-result-item:last-child { border-bottom: none; }
|
||||
.search-result-item:hover { background: var(--primary-weak); }
|
||||
.search-result-title {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.search-result-category {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
.search-no-result {
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* 分类标签 */
|
||||
.category-tabs {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.category-tab {
|
||||
padding: 10px 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 999px;
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.category-tab:hover {
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
}
|
||||
.category-tab.active {
|
||||
background: var(--primary);
|
||||
border-color: var(--primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* 文章分类区块 */
|
||||
.articles-section {
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.section-icon {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 12px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.section-icon.about { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
|
||||
.section-icon.careers { background: linear-gradient(135deg, #fef3c7, #fde68a); }
|
||||
.section-icon.news { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
|
||||
.section-icon.brand { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }
|
||||
.section-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
flex: 1;
|
||||
}
|
||||
.section-count {
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
background: var(--bg);
|
||||
padding: 4px 12px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
.section-toggle {
|
||||
color: var(--muted);
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
.section-header.collapsed .section-toggle {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
/* 文章列表 */
|
||||
.article-list {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
padding-left: 56px;
|
||||
}
|
||||
.article-list.hidden { display: none; }
|
||||
.article-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 16px 20px;
|
||||
background: var(--card);
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--line);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.article-item:hover {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 4px 12px rgba(47, 107, 255, 0.1);
|
||||
transform: translateX(4px);
|
||||
}
|
||||
.article-item svg {
|
||||
color: var(--primary);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.article-title {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
flex: 1;
|
||||
}
|
||||
.article-arrow {
|
||||
color: var(--muted);
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.article-item:hover .article-arrow {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* 文章详情页 */
|
||||
.article-detail {
|
||||
display: none;
|
||||
}
|
||||
.article-detail.active {
|
||||
display: block;
|
||||
}
|
||||
.article-breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.article-breadcrumb a:hover { color: var(--primary); }
|
||||
.article-detail-title {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 16px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.article-meta {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 32px;
|
||||
padding-bottom: 24px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.article-content {
|
||||
font-size: 16px;
|
||||
line-height: 1.8;
|
||||
color: #374151;
|
||||
}
|
||||
.article-content h3 {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
margin: 32px 0 16px;
|
||||
color: var(--text);
|
||||
}
|
||||
.article-content p {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.article-content ul, .article-content ol {
|
||||
margin-bottom: 16px;
|
||||
padding-left: 24px;
|
||||
}
|
||||
.article-content li {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.article-content img {
|
||||
max-width: 100%;
|
||||
border-radius: 12px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.article-tip {
|
||||
background: var(--primary-weak);
|
||||
border-left: 4px solid var(--primary);
|
||||
padding: 16px 20px;
|
||||
border-radius: 0 12px 12px 0;
|
||||
margin: 24px 0;
|
||||
}
|
||||
.article-tip-title {
|
||||
font-weight: 600;
|
||||
color: var(--primary);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 返回按钮 */
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 10px 16px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.back-btn:hover {
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
/* 相关文章 */
|
||||
.related-articles {
|
||||
margin-top: 48px;
|
||||
padding-top: 32px;
|
||||
border-top: 1px solid var(--line);
|
||||
}
|
||||
.related-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.related-list {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
.related-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 12px 16px;
|
||||
background: var(--card);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.related-item:hover {
|
||||
background: var(--primary-weak);
|
||||
}
|
||||
.related-item svg {
|
||||
color: var(--primary);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 页脚 */
|
||||
.footer {
|
||||
background: #1a1f2e;
|
||||
color: #9ca3af;
|
||||
padding: 40px 24px;
|
||||
text-align: center;
|
||||
}
|
||||
.footer-logo {
|
||||
height: 32px;
|
||||
margin-bottom: 16px;
|
||||
filter: brightness(0) invert(1);
|
||||
opacity: 0.8;
|
||||
}
|
||||
.footer-text {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* 响应式 */
|
||||
@media (max-width: 768px) {
|
||||
.search-title { font-size: 24px; }
|
||||
.search-input { padding: 14px 20px 14px 48px; font-size: 15px; }
|
||||
.article-list { padding-left: 0; margin-top: 16px; }
|
||||
.section-header { padding: 12px 16px; background: var(--card); border-radius: 12px; }
|
||||
.article-detail-title { font-size: 22px; }
|
||||
}
|
||||
|
||||
/* 列表页隐藏/显示 */
|
||||
.articles-list-view { display: block; }
|
||||
.articles-list-view.hidden { display: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 导航栏 -->
|
||||
<nav class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<a href="../index.html" class="navbar-logo">
|
||||
<img src="../images/logo.png" alt="Chookoo" />
|
||||
</a>
|
||||
<a href="../index.html" class="navbar-back">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
|
||||
返回首页
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- 主内容 -->
|
||||
<main class="main-content">
|
||||
<div class="container">
|
||||
<!-- 文章列表视图 -->
|
||||
<div class="articles-list-view" id="articlesListView">
|
||||
<!-- 搜索区域 -->
|
||||
<section class="search-section">
|
||||
<h1 class="search-title">公司介绍</h1>
|
||||
<p class="search-subtitle">搜索您想了解的问题,或浏览下方分类</p>
|
||||
<div class="search-box">
|
||||
<svg class="search-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
|
||||
<input type="text" class="search-input" id="searchInput" placeholder="搜索问题..." />
|
||||
<div class="search-results" id="searchResults"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 分类标签 -->
|
||||
<div class="category-tabs" id="categoryTabs">
|
||||
<div class="category-tab active" data-category="all">全部</div>
|
||||
<div class="category-tab" data-category="about">关于我们</div>
|
||||
<div class="category-tab" data-category="careers">加入我们</div>
|
||||
<div class="category-tab" data-category="news">新闻动态</div>
|
||||
<div class="category-tab" data-category="brand">品牌故事</div>
|
||||
</div>
|
||||
|
||||
<!-- 文章分类列表 -->
|
||||
<div id="articlesContainer"></div>
|
||||
</div>
|
||||
|
||||
<!-- 文章详情视图 -->
|
||||
<div class="article-detail" id="articleDetail">
|
||||
<button class="back-btn" id="backToList">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
|
||||
返回列表
|
||||
</button>
|
||||
<div id="articleContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- 页脚 -->
|
||||
<footer class="footer">
|
||||
<img src="../images/logo.png" alt="Chookoo" class="footer-logo" />
|
||||
<p class="footer-text">© 2025 宠科智能科技(苏州)有限公司 保留所有权利</p>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
// 视口缩放 - 基于1920px设计稿
|
||||
(() => {
|
||||
const designWidth = 1920;
|
||||
const minWidth = 1280;
|
||||
const maxWidth = 2560;
|
||||
|
||||
function scale() {
|
||||
const vw = window.innerWidth;
|
||||
let scale = 1;
|
||||
|
||||
if (vw < minWidth) {
|
||||
scale = vw / minWidth;
|
||||
} else if (vw > maxWidth) {
|
||||
scale = vw / maxWidth;
|
||||
} else {
|
||||
scale = vw / designWidth;
|
||||
}
|
||||
|
||||
document.body.style.transform = `scale(${scale})`;
|
||||
document.body.style.width = `${designWidth}px`;
|
||||
}
|
||||
|
||||
scale();
|
||||
window.addEventListener('resize', scale);
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
// 页面类型
|
||||
const PAGE_TYPE = 'company';
|
||||
|
||||
// 分类配置
|
||||
const categories = {
|
||||
all: { name: '全部', icon: '📋' },
|
||||
about: { name: '关于我们', icon: '🏠' },
|
||||
careers: { name: '加入我们', icon: '💼' },
|
||||
news: { name: '新闻动态', icon: '📰' },
|
||||
brand: { name: '品牌故事', icon: '📖' }
|
||||
};
|
||||
|
||||
// 默认文章数据(公司介绍)
|
||||
const defaultArticles = [
|
||||
{ id: 201, pageType: 'company', category: 'about', categoryName: '关于我们', title: '关于Chookoo宠科', content: '<h2>关于Chookoo宠科</h2><p>宠小科智能科技 (CHOOKOO) 成立于中国苏州,是一家专注于构建预防式主动健康生态的科技企业。我们深度融合人工智能、物联网与多模态生物传感技术,依托苏州长三角地区世界级的精密制造与跨学科研发能力,聚焦宠物与长者两大生命关爱场景,致力于让健康管理从"被动应对"走向"主动预见"。</p><p>通过智能设备 (如 AkiWell™智能健康猫厕所) 无感采集生命体征与行为数据,结合自研 AkiWell™主动健康预警算法,将日常细微变化转化为精准的健康洞察与温情提醒。我们的技术已实现对宠物泌尿系统疾病的提前48-72小时预警,并与高校共建联合实验室,持续提升医学级数据的严谨性。</p><p>宠小科以"宠爱生命,科技赋能"为使命,构建硬件入口+AI分析+数据服务+生态互联的闭环平台,让每一份关爱都有据可依,让每一个生命都能被真正理解与守护。我们期待与您携手,共同迈向更安心、更具预见性的健康生活。</p>', views: 1234, date: '2025-01-15' },
|
||||
{ id: 202, pageType: 'company', category: 'about', categoryName: '关于我们', title: '我们的使命', content: '<h2>我们的使命</h2><p><strong>愿景:</strong>成为全球宠物家庭最信赖的智能健康伙伴,定义主动健康管理新范式</p><p><strong>使命:</strong>让健康可见,让需求可解,让宠爱无间</p><p><strong>价值观:</strong>始于生命关怀,成于科技向善,归于商业远见</p>', views: 876, date: '2025-01-14' },
|
||||
{ id: 203, pageType: 'company', category: 'careers', categoryName: '加入我们', title: '热招职位', content: '<h2>热招职位</h2><ul><li>产品经理</li><li>嵌入式工程师</li><li>UI设计师</li><li>运营专员</li></ul><p>简历请投递至:hr@chookoo.com</p>', views: 567, date: '2025-01-13' },
|
||||
{ id: 204, pageType: 'company', category: 'news', categoryName: '新闻动态', title: 'Chookoo获得A轮融资', content: '<h2>融资新闻</h2><p>Chookoo宠科智能科技宣布完成数千万元A轮融资,将用于产品研发和市场拓展。</p>', views: 2345, date: '2025-01-12' },
|
||||
{ id: 205, pageType: 'company', category: 'brand', categoryName: '品牌故事', title: '品牌起源', content: '<h2>品牌故事</h2><p>Chookoo创立于2020年,源于创始人对自己宠物的一份热爱。我们相信,科技可以让养宠变得更简单。</p>', views: 789, date: '2025-01-11' }
|
||||
];
|
||||
|
||||
// 文章数据
|
||||
let articles = [...defaultArticles];
|
||||
|
||||
// 当前状态
|
||||
let currentCategory = 'all';
|
||||
let collapsedSections = {};
|
||||
|
||||
// 初始化
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 清除旧缓存,确保使用代码中的最新文章数据
|
||||
localStorage.removeItem('chookoo_help_articles');
|
||||
|
||||
// 解析 URL 参数
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const category = urlParams.get('category');
|
||||
const articleId = urlParams.get('article');
|
||||
const searchQuery = urlParams.get('search');
|
||||
|
||||
// 处理 URL 参数
|
||||
if (articleId) {
|
||||
showArticle(parseInt(articleId));
|
||||
} else if (category && categories[category]) {
|
||||
currentCategory = category;
|
||||
// 更新分类标签高亮
|
||||
document.querySelectorAll('.category-tab').forEach(tab => {
|
||||
tab.classList.toggle('active', tab.dataset.category === category);
|
||||
});
|
||||
}
|
||||
|
||||
if (searchQuery) {
|
||||
document.getElementById('searchInput').value = searchQuery;
|
||||
document.getElementById('searchInput').dispatchEvent(new Event('input'));
|
||||
}
|
||||
|
||||
renderArticles();
|
||||
initSearch();
|
||||
initCategoryTabs();
|
||||
initBackButton();
|
||||
});
|
||||
|
||||
// 渲染文章列表
|
||||
function renderArticles() {
|
||||
const container = document.getElementById('articlesContainer');
|
||||
let html = '';
|
||||
|
||||
const categoryOrder = ['about', 'careers', 'news', 'brand'];
|
||||
|
||||
categoryOrder.forEach(cat => {
|
||||
if (currentCategory !== 'all' && currentCategory !== cat) return;
|
||||
|
||||
const catArticles = articles.filter(a => a.category === cat && (!a.pageType || a.pageType === PAGE_TYPE));
|
||||
if (catArticles.length === 0) return;
|
||||
|
||||
const isCollapsed = collapsedSections[cat];
|
||||
const catInfo = categories[cat];
|
||||
|
||||
html += `
|
||||
<section class="articles-section" data-category="${cat}">
|
||||
<div class="section-header ${isCollapsed ? 'collapsed' : ''}" onclick="toggleSection('${cat}')">
|
||||
<div class="section-icon ${cat}">${catInfo.icon}</div>
|
||||
<h2 class="section-title">${catInfo.name}</h2>
|
||||
<span class="section-count">${catArticles.length} 篇文章</span>
|
||||
<svg class="section-toggle" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>
|
||||
</div>
|
||||
<div class="article-list ${isCollapsed ? 'hidden' : ''}">
|
||||
${catArticles.map(article => `
|
||||
<div class="article-item" onclick="showArticle(${article.id})">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>
|
||||
<span class="article-title">${article.title}</span>
|
||||
<svg class="article-arrow" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>
|
||||
</div>
|
||||
`).join('')}
|
||||
</div>
|
||||
</section>
|
||||
`;
|
||||
});
|
||||
|
||||
container.innerHTML = html;
|
||||
}
|
||||
|
||||
// 切换分类折叠
|
||||
function toggleSection(cat) {
|
||||
collapsedSections[cat] = !collapsedSections[cat];
|
||||
renderArticles();
|
||||
}
|
||||
|
||||
// 显示文章详情
|
||||
function showArticle(id) {
|
||||
const article = articles.find(a => a.id === id);
|
||||
if (!article) return;
|
||||
|
||||
const content = document.getElementById('articleContent');
|
||||
content.innerHTML = `
|
||||
<div class="article-breadcrumb">
|
||||
<a href="#" onclick="backToList(); return false;">公司介绍</a>
|
||||
<span>/</span>
|
||||
<span>${article.categoryName}</span>
|
||||
</div>
|
||||
<div class="article-detail-inner">
|
||||
<h1 class="article-title">${article.title}</h1>
|
||||
<div class="article-meta">
|
||||
<span class="article-date">${article.date}</span>
|
||||
<span class="article-views">${article.views} 次阅读</span>
|
||||
</div>
|
||||
<div class="article-body">${article.content}</div>
|
||||
${renderRelatedArticles(id, article.category)}
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.getElementById('articlesContainer').style.display = 'none';
|
||||
document.getElementById('articlesListView').style.display = 'none';
|
||||
document.getElementById('articleDetail').style.display = 'block';
|
||||
document.getElementById('articleDetail').classList.add('active');
|
||||
|
||||
// 更新URL
|
||||
history.pushState({ articleId: id }, '', `?article=${id}`);
|
||||
}
|
||||
|
||||
// 渲染相关文章
|
||||
function renderRelatedArticles(currentId, currentCategory) {
|
||||
const related = articles
|
||||
.filter(a => a.category === currentCategory && a.id !== currentId)
|
||||
.slice(0, 3);
|
||||
|
||||
if (related.length === 0) return '';
|
||||
|
||||
return `
|
||||
<div class="related-articles">
|
||||
<h3 class="related-title">相关文章</h3>
|
||||
<div class="related-list">
|
||||
${related.map(a => `
|
||||
<div class="related-item" onclick="showArticle(${a.id})">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
|
||||
<span>${a.title}</span>
|
||||
</div>
|
||||
`).join('')}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
// 返回列表
|
||||
function backToList() {
|
||||
document.getElementById('articlesContainer').style.display = 'block';
|
||||
document.getElementById('articlesListView').style.display = 'block';
|
||||
document.getElementById('articleDetail').style.display = 'none';
|
||||
document.getElementById('articleDetail').classList.remove('active');
|
||||
history.pushState({}, '', window.location.pathname);
|
||||
}
|
||||
|
||||
// 初始化返回按钮
|
||||
function initBackButton() {
|
||||
document.getElementById('backToList').addEventListener('click', backToList);
|
||||
}
|
||||
|
||||
// 初始化分类标签
|
||||
function initCategoryTabs() {
|
||||
document.querySelectorAll('.category-tab').forEach(tab => {
|
||||
tab.addEventListener('click', function() {
|
||||
document.querySelectorAll('.category-tab').forEach(t => t.classList.remove('active'));
|
||||
this.classList.add('active');
|
||||
currentCategory = this.dataset.category;
|
||||
renderArticles();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化搜索
|
||||
function initSearch() {
|
||||
const searchInput = document.getElementById('searchInput');
|
||||
const results = document.getElementById('searchResults');
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const query = this.value.toLowerCase().trim();
|
||||
|
||||
if (query.length < 2) {
|
||||
results.classList.remove('active');
|
||||
return;
|
||||
}
|
||||
|
||||
const matched = articles.filter(a =>
|
||||
(!a.pageType || a.pageType === PAGE_TYPE) &&
|
||||
(a.title.toLowerCase().includes(query) ||
|
||||
a.content.toLowerCase().includes(query))
|
||||
);
|
||||
|
||||
if (matched.length === 0) {
|
||||
results.innerHTML = '<div class="search-no-result">未找到相关文章</div>';
|
||||
} else {
|
||||
results.innerHTML = matched.slice(0, 8).map(a => `
|
||||
<div class="search-result-item" onclick="showArticle(${a.id})">
|
||||
<div class="search-result-title">${a.title}</div>
|
||||
<div class="search-result-category">${a.categoryName}</div>
|
||||
</div>
|
||||
`).join('');
|
||||
}
|
||||
|
||||
results.classList.add('active');
|
||||
});
|
||||
|
||||
// 点击外部关闭搜索结果
|
||||
document.addEventListener('click', function(e) {
|
||||
if (!searchInput.contains(e.target) && !results.contains(e.target)) {
|
||||
results.classList.remove('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+1359
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,696 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>法律条款 - Chookoo</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg: #f5f7fb;
|
||||
--text: #0f172a;
|
||||
--muted: #5b6472;
|
||||
--primary: #2f6bff;
|
||||
--primary-weak: #e8f1ff;
|
||||
--card: #ffffff;
|
||||
--line: #e5e7eb;
|
||||
--shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
html { overflow-y: scroll; }
|
||||
body {
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
min-width: 1280px;
|
||||
line-height: 1.6;
|
||||
transform-origin: top left;
|
||||
}
|
||||
a { color: inherit; text-decoration: none; }
|
||||
|
||||
/* 导航栏 */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.navbar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
padding: 0 32px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.navbar-logo img { height: 40px; }
|
||||
.navbar-back {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.navbar-back:hover { color: var(--text); }
|
||||
|
||||
/* 主内容区 */
|
||||
.main-content {
|
||||
padding-top: 100px;
|
||||
padding-bottom: 80px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.container {
|
||||
width: 1000px;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
/* 搜索区域 */
|
||||
.search-section {
|
||||
text-align: center;
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.search-title {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 8px;
|
||||
color: var(--text);
|
||||
}
|
||||
.search-subtitle {
|
||||
font-size: 16px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.search-box {
|
||||
position: relative;
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.search-input {
|
||||
width: 100%;
|
||||
padding: 16px 24px 16px 52px;
|
||||
font-size: 16px;
|
||||
border: 2px solid var(--line);
|
||||
border-radius: 16px;
|
||||
background: var(--card);
|
||||
outline: none;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.search-input:focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.1);
|
||||
}
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--muted);
|
||||
}
|
||||
.search-results {
|
||||
position: absolute;
|
||||
top: calc(100% + 8px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: var(--card);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 32px rgba(0,0,0,0.12);
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
display: none;
|
||||
z-index: 100;
|
||||
}
|
||||
.search-results.active { display: block; }
|
||||
.search-result-item {
|
||||
padding: 14px 20px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid var(--line);
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.search-result-item:last-child { border-bottom: none; }
|
||||
.search-result-item:hover { background: var(--primary-weak); }
|
||||
.search-result-title {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.search-result-category {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
.search-no-result {
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* 分类标签 */
|
||||
.category-tabs {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.category-tab {
|
||||
padding: 10px 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 999px;
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.category-tab:hover {
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
}
|
||||
.category-tab.active {
|
||||
background: var(--primary);
|
||||
border-color: var(--primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* 文章分类区块 */
|
||||
.articles-section {
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.section-icon {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 12px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.section-icon.privacy { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
|
||||
.section-icon.terms { background: linear-gradient(135deg, #fef3c7, #fde68a); }
|
||||
.section-icon.cookies { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
|
||||
.section-icon.warranty { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }
|
||||
.section-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
flex: 1;
|
||||
}
|
||||
.section-count {
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
background: var(--bg);
|
||||
padding: 4px 12px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
.section-toggle {
|
||||
color: var(--muted);
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
.section-header.collapsed .section-toggle {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
/* 文章列表 */
|
||||
.article-list {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
padding-left: 56px;
|
||||
}
|
||||
.article-list.hidden { display: none; }
|
||||
.article-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 16px 20px;
|
||||
background: var(--card);
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--line);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.article-item:hover {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 4px 12px rgba(47, 107, 255, 0.1);
|
||||
transform: translateX(4px);
|
||||
}
|
||||
.article-item svg {
|
||||
color: var(--primary);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.article-title {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
flex: 1;
|
||||
}
|
||||
.article-arrow {
|
||||
color: var(--muted);
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.article-item:hover .article-arrow {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* 文章详情页 */
|
||||
.article-detail {
|
||||
display: none;
|
||||
}
|
||||
.article-detail.active {
|
||||
display: block;
|
||||
}
|
||||
.article-breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.article-breadcrumb a:hover { color: var(--primary); }
|
||||
.article-detail-title {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 16px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.article-meta {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 32px;
|
||||
padding-bottom: 24px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.article-content {
|
||||
font-size: 16px;
|
||||
line-height: 1.8;
|
||||
color: #374151;
|
||||
}
|
||||
.article-content h3 {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
margin: 32px 0 16px;
|
||||
color: var(--text);
|
||||
}
|
||||
.article-content p {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.article-content ul, .article-content ol {
|
||||
margin-bottom: 16px;
|
||||
padding-left: 24px;
|
||||
}
|
||||
.article-content li {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.article-content img {
|
||||
max-width: 100%;
|
||||
border-radius: 12px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.article-tip {
|
||||
background: var(--primary-weak);
|
||||
border-left: 4px solid var(--primary);
|
||||
padding: 16px 20px;
|
||||
border-radius: 0 12px 12px 0;
|
||||
margin: 24px 0;
|
||||
}
|
||||
.article-tip-title {
|
||||
font-weight: 600;
|
||||
color: var(--primary);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 返回按钮 */
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 10px 16px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.back-btn:hover {
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
/* 相关文章 */
|
||||
.related-articles {
|
||||
margin-top: 48px;
|
||||
padding-top: 32px;
|
||||
border-top: 1px solid var(--line);
|
||||
}
|
||||
.related-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.related-list {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
.related-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 12px 16px;
|
||||
background: var(--card);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.related-item:hover {
|
||||
background: var(--primary-weak);
|
||||
}
|
||||
.related-item svg {
|
||||
color: var(--primary);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 页脚 */
|
||||
.footer {
|
||||
background: #1a1f2e;
|
||||
color: #9ca3af;
|
||||
padding: 40px 24px;
|
||||
text-align: center;
|
||||
}
|
||||
.footer-logo {
|
||||
height: 32px;
|
||||
margin-bottom: 16px;
|
||||
filter: brightness(0) invert(1);
|
||||
opacity: 0.8;
|
||||
}
|
||||
.footer-text {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* 响应式 */
|
||||
@media (max-width: 768px) {
|
||||
.search-title { font-size: 24px; }
|
||||
.search-input { padding: 14px 20px 14px 48px; font-size: 15px; }
|
||||
.article-list { padding-left: 0; margin-top: 16px; }
|
||||
.section-header { padding: 12px 16px; background: var(--card); border-radius: 12px; }
|
||||
.article-detail-title { font-size: 22px; }
|
||||
}
|
||||
|
||||
/* 列表页隐藏/显示 */
|
||||
.articles-list-view { display: block; }
|
||||
.articles-list-view.hidden { display: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 导航栏 -->
|
||||
<nav class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<a href="../index.html" class="navbar-logo">
|
||||
<img src="../images/logo.png" alt="Chookoo" />
|
||||
</a>
|
||||
<a href="../index.html" class="navbar-back">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
|
||||
返回首页
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- 主内容 -->
|
||||
<main class="main-content">
|
||||
<div class="container">
|
||||
<!-- 文章列表视图 -->
|
||||
<div class="articles-list-view" id="articlesListView">
|
||||
<!-- 搜索区域 -->
|
||||
<section class="search-section">
|
||||
<h1 class="search-title">法律条款</h1>
|
||||
<p class="search-subtitle">隐私政策、服务条款等信息</p>
|
||||
<div class="search-box">
|
||||
<svg class="search-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
|
||||
<input type="text" class="search-input" id="searchInput" placeholder="搜索..." />
|
||||
<div class="search-results" id="searchResults"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 分类标签 -->
|
||||
<div class="category-tabs" id="categoryTabs">
|
||||
<div class="category-tab active" data-category="all">全部</div>
|
||||
<div class="category-tab" data-category="privacy">隐私政策</div>
|
||||
<div class="category-tab" data-category="terms">服务条款</div>
|
||||
<div class="category-tab" data-category="cookies">Cookie设置</div>
|
||||
</div>
|
||||
|
||||
<!-- 文章分类列表 -->
|
||||
<div id="articlesContainer"></div>
|
||||
</div>
|
||||
|
||||
<!-- 文章详情视图 -->
|
||||
<div class="article-detail" id="articleDetail">
|
||||
<button class="back-btn" id="backToList">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
|
||||
返回列表
|
||||
</button>
|
||||
<div id="articleContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- 页脚 -->
|
||||
<footer class="footer">
|
||||
<img src="../images/logo.png" alt="Chookoo" class="footer-logo" />
|
||||
<p class="footer-text">© 2025 宠科智能科技(苏州)有限公司 保留所有权利</p>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
// 视口缩放 - 基于1920px设计稿
|
||||
(() => {
|
||||
const designWidth = 1920;
|
||||
const minWidth = 1280;
|
||||
const maxWidth = 2560;
|
||||
|
||||
function scale() {
|
||||
const vw = window.innerWidth;
|
||||
let scale = 1;
|
||||
|
||||
if (vw < minWidth) {
|
||||
scale = vw / minWidth;
|
||||
} else if (vw > maxWidth) {
|
||||
scale = vw / maxWidth;
|
||||
} else {
|
||||
scale = vw / designWidth;
|
||||
}
|
||||
|
||||
document.body.style.transform = `scale(${scale})`;
|
||||
document.body.style.width = `${designWidth}px`;
|
||||
}
|
||||
|
||||
scale();
|
||||
window.addEventListener('resize', scale);
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
// 页面类型
|
||||
const PAGE_TYPE = 'legal';
|
||||
|
||||
// 分类配置
|
||||
const categories = {
|
||||
all: { name: '全部', icon: '📋' },
|
||||
privacy: { name: '隐私政策', icon: '🔒' },
|
||||
terms: { name: '服务条款', icon: '📜' },
|
||||
cookies: { name: 'Cookie设置', icon: '🍪' }
|
||||
};
|
||||
|
||||
// 默认文章数据(法律条款)
|
||||
const defaultArticles = [
|
||||
{ id: 401, pageType: 'legal', category: 'privacy', categoryName: '隐私政策', title: '隐私政策', content: '<h2>隐私政策</h2><p>Chookoo重视用户隐私保护。本政策说明我们如何收集、使用和保护您的个人信息。</p><h3>信息收集</h3><p>我们收集的信息包括:账号信息、设备信息、使用数据等。</p><h3>信息使用</h3><p>您的信息用于:提供服务、改进产品、安全保障等。</p>', views: 1234, date: '2025-01-15' },
|
||||
{ id: 402, pageType: 'legal', category: 'terms', categoryName: '服务条款', title: '服务条款', content: '<h2>服务条款</h2><p>使用Chookoo产品和服务即表示您同意本条款。</p><h3>服务内容</h3><p>我们提供智能设备、移动应用及相关服务。</p><h3>用户责任</h3><p>请您遵守相关法律法规,合理使用我们的产品和服务。</p>', views: 876, date: '2025-01-14' },
|
||||
{ id: 403, pageType: 'legal', category: 'cookies', categoryName: 'Cookie设置', title: 'Cookie使用说明', content: '<h2>Cookie使用说明</h2><p>我们使用Cookie来改善您的使用体验。</p><h3>Cookie类型</h3><ul><li>必要的Cookie:确保网站正常运行</li><li>功能性Cookie:记住您的偏好设置</li><li>分析性Cookie:了解用户如何使用网站</li></ul>', views: 654, date: '2025-01-13' }
|
||||
];
|
||||
|
||||
// 文章数据
|
||||
let articles = [...defaultArticles];
|
||||
|
||||
// 当前状态
|
||||
let currentCategory = 'all';
|
||||
let collapsedSections = {};
|
||||
|
||||
// 初始化
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const savedArticles = localStorage.getItem('chookoo_help_articles');
|
||||
if (savedArticles) {
|
||||
try {
|
||||
const parsed = JSON.parse(savedArticles);
|
||||
if (Array.isArray(parsed) && parsed.length > 0) {
|
||||
const customArticles = parsed.filter(a => (a.pageType || 'help') === 'legal');
|
||||
articles.push(...customArticles);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载文章数据失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const category = urlParams.get('category');
|
||||
const articleId = urlParams.get('article');
|
||||
|
||||
if (articleId) {
|
||||
showArticle(parseInt(articleId));
|
||||
} else if (category && categories[category]) {
|
||||
currentCategory = category;
|
||||
document.querySelectorAll('.category-tab').forEach(tab => {
|
||||
tab.classList.toggle('active', tab.dataset.category === category);
|
||||
});
|
||||
}
|
||||
|
||||
renderArticles();
|
||||
initSearch();
|
||||
initCategoryTabs();
|
||||
initBackButton();
|
||||
});
|
||||
|
||||
function renderArticles() {
|
||||
const container = document.getElementById('articlesContainer');
|
||||
let html = '';
|
||||
const categoryOrder = ['privacy', 'terms', 'cookies'];
|
||||
|
||||
categoryOrder.forEach(cat => {
|
||||
if (currentCategory !== 'all' && currentCategory !== cat) return;
|
||||
const catArticles = articles.filter(a => a.category === cat && (!a.pageType || a.pageType === PAGE_TYPE));
|
||||
if (catArticles.length === 0) return;
|
||||
|
||||
const isCollapsed = collapsedSections[cat];
|
||||
const catInfo = categories[cat];
|
||||
|
||||
html += `
|
||||
<section class="articles-section" data-category="${cat}">
|
||||
<div class="section-header ${isCollapsed ? 'collapsed' : ''}" onclick="toggleSection('${cat}')">
|
||||
<div class="section-icon ${cat}">${catInfo.icon}</div>
|
||||
<h2 class="section-title">${catInfo.name}</h2>
|
||||
<span class="section-count">${catArticles.length} 篇文章</span>
|
||||
<svg class="section-toggle" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>
|
||||
</div>
|
||||
<div class="article-list ${isCollapsed ? 'hidden' : ''}">
|
||||
${catArticles.map(article => `
|
||||
<div class="article-item" onclick="showArticle(${article.id})">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
|
||||
<span class="article-title">${article.title}</span>
|
||||
<svg class="article-arrow" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>
|
||||
</div>
|
||||
`).join('')}
|
||||
</div>
|
||||
</section>
|
||||
`;
|
||||
});
|
||||
container.innerHTML = html;
|
||||
}
|
||||
|
||||
function toggleSection(cat) {
|
||||
collapsedSections[cat] = !collapsedSections[cat];
|
||||
renderArticles();
|
||||
}
|
||||
|
||||
function showArticle(id) {
|
||||
const article = articles.find(a => a.id === id);
|
||||
if (!article) return;
|
||||
|
||||
const content = document.getElementById('articleContent');
|
||||
content.innerHTML = `
|
||||
<div class="article-breadcrumb">
|
||||
<a href="#" onclick="backToList(); return false;">法律条款</a>
|
||||
<span>/</span>
|
||||
<span>${article.categoryName}</span>
|
||||
</div>
|
||||
<div class="article-detail">
|
||||
<h1 class="article-title">${article.title}</h1>
|
||||
<div class="article-meta">
|
||||
<span class="article-date">${article.date}</span>
|
||||
<span class="article-views">${article.views} 次阅读</span>
|
||||
</div>
|
||||
<div class="article-body">${article.content}</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.getElementById('articlesContainer').style.display = 'none';
|
||||
document.getElementById('articlesListView').style.display = 'none';
|
||||
document.getElementById('articleDetail').style.display = 'block';
|
||||
document.getElementById('articleDetail').classList.add('active');
|
||||
history.pushState({ articleId: id }, '', `?article=${id}`);
|
||||
}
|
||||
|
||||
function backToList() {
|
||||
document.getElementById('articlesContainer').style.display = 'block';
|
||||
document.getElementById('articlesListView').style.display = 'block';
|
||||
document.getElementById('articleDetail').style.display = 'none';
|
||||
document.getElementById('articleDetail').classList.remove('active');
|
||||
history.pushState({}, '', window.location.pathname);
|
||||
}
|
||||
|
||||
function initBackButton() {
|
||||
document.getElementById('backToList').addEventListener('click', backToList);
|
||||
}
|
||||
|
||||
function initCategoryTabs() {
|
||||
document.querySelectorAll('.category-tab').forEach(tab => {
|
||||
tab.addEventListener('click', function() {
|
||||
document.querySelectorAll('.category-tab').forEach(t => t.classList.remove('active'));
|
||||
this.classList.add('active');
|
||||
currentCategory = this.dataset.category;
|
||||
renderArticles();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initSearch() {
|
||||
const searchInput = document.getElementById('searchInput');
|
||||
const results = document.getElementById('searchResults');
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const query = this.value.toLowerCase().trim();
|
||||
if (query.length < 2) {
|
||||
results.classList.remove('active');
|
||||
return;
|
||||
}
|
||||
|
||||
const matched = articles.filter(a =>
|
||||
(!a.pageType || a.pageType === PAGE_TYPE) &&
|
||||
(a.title.toLowerCase().includes(query) || a.content.toLowerCase().includes(query))
|
||||
);
|
||||
|
||||
if (matched.length === 0) {
|
||||
results.innerHTML = '<div class="search-no-result">未找到相关文章</div>';
|
||||
} else {
|
||||
results.innerHTML = matched.slice(0, 8).map(a => `
|
||||
<div class="search-result-item" onclick="showArticle(${a.id})">
|
||||
<div class="search-result-title">${a.title}</div>
|
||||
<div class="search-result-category">${a.categoryName}</div>
|
||||
</div>
|
||||
`).join('');
|
||||
}
|
||||
results.classList.add('active');
|
||||
});
|
||||
|
||||
document.addEventListener('click', function(e) {
|
||||
if (!searchInput.contains(e.target) && !results.contains(e.target)) {
|
||||
results.classList.remove('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,700 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>合作伙伴 - Chookoo</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg: #f5f7fb;
|
||||
--text: #0f172a;
|
||||
--muted: #5b6472;
|
||||
--primary: #2f6bff;
|
||||
--primary-weak: #e8f1ff;
|
||||
--card: #ffffff;
|
||||
--line: #e5e7eb;
|
||||
--shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
html { overflow-y: scroll; }
|
||||
body {
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
min-width: 1280px;
|
||||
line-height: 1.6;
|
||||
transform-origin: top left;
|
||||
}
|
||||
a { color: inherit; text-decoration: none; }
|
||||
|
||||
/* 导航栏 */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.navbar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
padding: 0 32px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.navbar-logo img { height: 40px; }
|
||||
.navbar-back {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.navbar-back:hover { color: var(--text); }
|
||||
|
||||
/* 主内容区 */
|
||||
.main-content {
|
||||
padding-top: 100px;
|
||||
padding-bottom: 80px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.container {
|
||||
width: 1000px;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
/* 搜索区域 */
|
||||
.search-section {
|
||||
text-align: center;
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.search-title {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 8px;
|
||||
color: var(--text);
|
||||
}
|
||||
.search-subtitle {
|
||||
font-size: 16px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.search-box {
|
||||
position: relative;
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.search-input {
|
||||
width: 100%;
|
||||
padding: 16px 24px 16px 52px;
|
||||
font-size: 16px;
|
||||
border: 2px solid var(--line);
|
||||
border-radius: 16px;
|
||||
background: var(--card);
|
||||
outline: none;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.search-input:focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.1);
|
||||
}
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--muted);
|
||||
}
|
||||
.search-results {
|
||||
position: absolute;
|
||||
top: calc(100% + 8px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: var(--card);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 32px rgba(0,0,0,0.12);
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
display: none;
|
||||
z-index: 100;
|
||||
}
|
||||
.search-results.active { display: block; }
|
||||
.search-result-item {
|
||||
padding: 14px 20px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid var(--line);
|
||||
transition: background 0.2s;
|
||||
}
|
||||
.search-result-item:last-child { border-bottom: none; }
|
||||
.search-result-item:hover { background: var(--primary-weak); }
|
||||
.search-result-title {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.search-result-category {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
.search-no-result {
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* 分类标签 */
|
||||
.category-tabs {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.category-tab {
|
||||
padding: 10px 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border-radius: 999px;
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.category-tab:hover {
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
}
|
||||
.category-tab.active {
|
||||
background: var(--primary);
|
||||
border-color: var(--primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* 文章分类区块 */
|
||||
.articles-section {
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.section-icon {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 12px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.section-icon.dealer { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
|
||||
.section-icon.affiliate { background: linear-gradient(135deg, #fef3c7, #fde68a); }
|
||||
.section-icon.business { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
|
||||
.section-icon.tech { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }
|
||||
.section-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
flex: 1;
|
||||
}
|
||||
.section-count {
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
background: var(--bg);
|
||||
padding: 4px 12px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
.section-toggle {
|
||||
color: var(--muted);
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
.section-header.collapsed .section-toggle {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
/* 文章列表 */
|
||||
.article-list {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
padding-left: 56px;
|
||||
}
|
||||
.article-list.hidden { display: none; }
|
||||
.article-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 16px 20px;
|
||||
background: var(--card);
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--line);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.article-item:hover {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 4px 12px rgba(47, 107, 255, 0.1);
|
||||
transform: translateX(4px);
|
||||
}
|
||||
.article-item svg {
|
||||
color: var(--primary);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.article-title {
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
flex: 1;
|
||||
}
|
||||
.article-arrow {
|
||||
color: var(--muted);
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.article-item:hover .article-arrow {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* 文章详情页 */
|
||||
.article-detail {
|
||||
display: none;
|
||||
}
|
||||
.article-detail.active {
|
||||
display: block;
|
||||
}
|
||||
.article-breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.article-breadcrumb a:hover { color: var(--primary); }
|
||||
.article-detail-title {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 16px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.article-meta {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 32px;
|
||||
padding-bottom: 24px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.article-content {
|
||||
font-size: 16px;
|
||||
line-height: 1.8;
|
||||
color: #374151;
|
||||
}
|
||||
.article-content h3 {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
margin: 32px 0 16px;
|
||||
color: var(--text);
|
||||
}
|
||||
.article-content p {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.article-content ul, .article-content ol {
|
||||
margin-bottom: 16px;
|
||||
padding-left: 24px;
|
||||
}
|
||||
.article-content li {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.article-content img {
|
||||
max-width: 100%;
|
||||
border-radius: 12px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.article-tip {
|
||||
background: var(--primary-weak);
|
||||
border-left: 4px solid var(--primary);
|
||||
padding: 16px 20px;
|
||||
border-radius: 0 12px 12px 0;
|
||||
margin: 24px 0;
|
||||
}
|
||||
.article-tip-title {
|
||||
font-weight: 600;
|
||||
color: var(--primary);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 返回按钮 */
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 10px 16px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.back-btn:hover {
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
/* 相关文章 */
|
||||
.related-articles {
|
||||
margin-top: 48px;
|
||||
padding-top: 32px;
|
||||
border-top: 1px solid var(--line);
|
||||
}
|
||||
.related-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.related-list {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
.related-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 12px 16px;
|
||||
background: var(--card);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.related-item:hover {
|
||||
background: var(--primary-weak);
|
||||
}
|
||||
.related-item svg {
|
||||
color: var(--primary);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 页脚 */
|
||||
.footer {
|
||||
background: #1a1f2e;
|
||||
color: #9ca3af;
|
||||
padding: 40px 24px;
|
||||
text-align: center;
|
||||
}
|
||||
.footer-logo {
|
||||
height: 32px;
|
||||
margin-bottom: 16px;
|
||||
filter: brightness(0) invert(1);
|
||||
opacity: 0.8;
|
||||
}
|
||||
.footer-text {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* 响应式 */
|
||||
@media (max-width: 768px) {
|
||||
.search-title { font-size: 24px; }
|
||||
.search-input { padding: 14px 20px 14px 48px; font-size: 15px; }
|
||||
.article-list { padding-left: 0; margin-top: 16px; }
|
||||
.section-header { padding: 12px 16px; background: var(--card); border-radius: 12px; }
|
||||
.article-detail-title { font-size: 22px; }
|
||||
}
|
||||
|
||||
/* 列表页隐藏/显示 */
|
||||
.articles-list-view { display: block; }
|
||||
.articles-list-view.hidden { display: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 导航栏 -->
|
||||
<nav class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<a href="../index.html" class="navbar-logo">
|
||||
<img src="../images/logo.png" alt="Chookoo" />
|
||||
</a>
|
||||
<a href="../index.html" class="navbar-back">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
|
||||
返回首页
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- 主内容 -->
|
||||
<main class="main-content">
|
||||
<div class="container">
|
||||
<!-- 文章列表视图 -->
|
||||
<div class="articles-list-view" id="articlesListView">
|
||||
<!-- 搜索区域 -->
|
||||
<section class="search-section">
|
||||
<h1 class="search-title">合作伙伴</h1>
|
||||
<p class="search-subtitle">搜索您想了解的合作伙伴信息</p>
|
||||
<div class="search-box">
|
||||
<svg class="search-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
|
||||
<input type="text" class="search-input" id="searchInput" placeholder="搜索..." />
|
||||
<div class="search-results" id="searchResults"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 分类标签 -->
|
||||
<div class="category-tabs" id="categoryTabs">
|
||||
<div class="category-tab active" data-category="all">全部</div>
|
||||
<div class="category-tab" data-category="dealer">经销商入驻</div>
|
||||
<div class="category-tab" data-category="affiliate">联盟推广</div>
|
||||
<div class="category-tab" data-category="business">企业采购</div>
|
||||
<div class="category-tab" data-category="tech">技术合作</div>
|
||||
</div>
|
||||
|
||||
<!-- 文章分类列表 -->
|
||||
<div id="articlesContainer"></div>
|
||||
</div>
|
||||
|
||||
<!-- 文章详情视图 -->
|
||||
<div class="article-detail" id="articleDetail">
|
||||
<button class="back-btn" id="backToList">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
|
||||
返回列表
|
||||
</button>
|
||||
<div id="articleContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- 页脚 -->
|
||||
<footer class="footer">
|
||||
<img src="../images/logo.png" alt="Chookoo" class="footer-logo" />
|
||||
<p class="footer-text">© 2025 宠科智能科技(苏州)有限公司 保留所有权利</p>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
// 视口缩放 - 基于1920px设计稿
|
||||
(() => {
|
||||
const designWidth = 1920;
|
||||
const minWidth = 1280;
|
||||
const maxWidth = 2560;
|
||||
|
||||
function scale() {
|
||||
const vw = window.innerWidth;
|
||||
let scale = 1;
|
||||
|
||||
if (vw < minWidth) {
|
||||
scale = vw / minWidth;
|
||||
} else if (vw > maxWidth) {
|
||||
scale = vw / maxWidth;
|
||||
} else {
|
||||
scale = vw / designWidth;
|
||||
}
|
||||
|
||||
document.body.style.transform = `scale(${scale})`;
|
||||
document.body.style.width = `${designWidth}px`;
|
||||
}
|
||||
|
||||
scale();
|
||||
window.addEventListener('resize', scale);
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
// 页面类型
|
||||
const PAGE_TYPE = 'partner';
|
||||
|
||||
// 分类配置
|
||||
const categories = {
|
||||
all: { name: '全部', icon: '📋' },
|
||||
dealer: { name: '经销商入驻', icon: '🏪' },
|
||||
affiliate: { name: '联盟推广', icon: '🔗' },
|
||||
business: { name: '企业采购', icon: '🏢' },
|
||||
tech: { name: '技术合作', icon: '🔬' }
|
||||
};
|
||||
|
||||
// 默认文章数据(合作伙伴)
|
||||
const defaultArticles = [
|
||||
{ id: 301, pageType: 'partner', category: 'dealer', categoryName: '经销商入驻', title: '经销商入驻条件', content: '<h2>入驻条件</h2><ul><li>具有合法经营资质</li><li>有宠物行业经验优先</li><li>具备一定的资金实力</li><li>认同品牌理念</li></ul>', views: 654, date: '2025-01-15' },
|
||||
{ id: 302, pageType: 'partner', category: 'dealer', categoryName: '经销商入驻', title: '经销商政策', content: '<h2>合作政策</h2><ul><li>区域独家保护</li><li>市场费用支持</li><li>培训支持</li><li>售后支持</li></ul>', views: 543, date: '2025-01-14' },
|
||||
{ id: 303, pageType: 'partner', category: 'affiliate', categoryName: '联盟推广', title: '推广联盟计划', content: '<h2>推广联盟</h2><p>加入Chookoo推广联盟,通过分享获得收益。</p><ul><li>佣金比例:10%-15%</li><li>结算周期:月结</li><li>支持素材丰富</li></ul>', views: 432, date: '2025-01-13' },
|
||||
{ id: 304, pageType: 'partner', category: 'business', categoryName: '企业采购', title: '企业采购服务', content: '<h2>企业采购</h2><p>为企业客户提供定制化采购服务:</p><ul><li>批量优惠</li><li>定制包装</li><li>专属客服</li><li>发票支持</li></ul>', views: 321, date: '2025-01-12' },
|
||||
{ id: 305, pageType: 'partner', category: 'tech', categoryName: '技术合作', title: '技术合作', content: '<h2>技术合作</h2><p>我们欢迎各类技术合作:</p><ul><li>智能家居平台对接</li><li>Pet IoT生态合作</li><li>技术授权</li></ul>', views: 234, date: '2025-01-11' }
|
||||
];
|
||||
|
||||
// 文章数据
|
||||
let articles = [...defaultArticles];
|
||||
|
||||
// 当前状态
|
||||
let currentCategory = 'all';
|
||||
let collapsedSections = {};
|
||||
|
||||
// 初始化
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const savedArticles = localStorage.getItem('chookoo_help_articles');
|
||||
if (savedArticles) {
|
||||
try {
|
||||
const parsed = JSON.parse(savedArticles);
|
||||
if (Array.isArray(parsed) && parsed.length > 0) {
|
||||
const customArticles = parsed.filter(a => (a.pageType || 'help') === 'partner');
|
||||
articles.push(...customArticles);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载文章数据失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const category = urlParams.get('category');
|
||||
const articleId = urlParams.get('article');
|
||||
|
||||
if (articleId) {
|
||||
showArticle(parseInt(articleId));
|
||||
} else if (category && categories[category]) {
|
||||
currentCategory = category;
|
||||
document.querySelectorAll('.category-tab').forEach(tab => {
|
||||
tab.classList.toggle('active', tab.dataset.category === category);
|
||||
});
|
||||
}
|
||||
|
||||
renderArticles();
|
||||
initSearch();
|
||||
initCategoryTabs();
|
||||
initBackButton();
|
||||
});
|
||||
|
||||
function renderArticles() {
|
||||
const container = document.getElementById('articlesContainer');
|
||||
let html = '';
|
||||
const categoryOrder = ['dealer', 'affiliate', 'business', 'tech'];
|
||||
|
||||
categoryOrder.forEach(cat => {
|
||||
if (currentCategory !== 'all' && currentCategory !== cat) return;
|
||||
const catArticles = articles.filter(a => a.category === cat && (!a.pageType || a.pageType === PAGE_TYPE));
|
||||
if (catArticles.length === 0) return;
|
||||
|
||||
const isCollapsed = collapsedSections[cat];
|
||||
const catInfo = categories[cat];
|
||||
|
||||
html += `
|
||||
<section class="articles-section" data-category="${cat}">
|
||||
<div class="section-header ${isCollapsed ? 'collapsed' : ''}" onclick="toggleSection('${cat}')">
|
||||
<div class="section-icon ${cat}">${catInfo.icon}</div>
|
||||
<h2 class="section-title">${catInfo.name}</h2>
|
||||
<span class="section-count">${catArticles.length} 篇文章</span>
|
||||
<svg class="section-toggle" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>
|
||||
</div>
|
||||
<div class="article-list ${isCollapsed ? 'hidden' : ''}">
|
||||
${catArticles.map(article => `
|
||||
<div class="article-item" onclick="showArticle(${article.id})">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
|
||||
<span class="article-title">${article.title}</span>
|
||||
<svg class="article-arrow" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>
|
||||
</div>
|
||||
`).join('')}
|
||||
</div>
|
||||
</section>
|
||||
`;
|
||||
});
|
||||
container.innerHTML = html;
|
||||
}
|
||||
|
||||
function toggleSection(cat) {
|
||||
collapsedSections[cat] = !collapsedSections[cat];
|
||||
renderArticles();
|
||||
}
|
||||
|
||||
function showArticle(id) {
|
||||
const article = articles.find(a => a.id === id);
|
||||
if (!article) return;
|
||||
|
||||
const content = document.getElementById('articleContent');
|
||||
content.innerHTML = `
|
||||
<div class="article-breadcrumb">
|
||||
<a href="#" onclick="backToList(); return false;">合作伙伴</a>
|
||||
<span>/</span>
|
||||
<span>${article.categoryName}</span>
|
||||
</div>
|
||||
<div class="article-detail">
|
||||
<h1 class="article-title">${article.title}</h1>
|
||||
<div class="article-meta">
|
||||
<span class="article-date">${article.date}</span>
|
||||
<span class="article-views">${article.views} 次阅读</span>
|
||||
</div>
|
||||
<div class="article-body">${article.content}</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.getElementById('articlesContainer').style.display = 'none';
|
||||
document.getElementById('articlesListView').style.display = 'none';
|
||||
document.getElementById('articleDetail').style.display = 'block';
|
||||
document.getElementById('articleDetail').classList.add('active');
|
||||
history.pushState({ articleId: id }, '', `?article=${id}`);
|
||||
}
|
||||
|
||||
function backToList() {
|
||||
document.getElementById('articlesContainer').style.display = 'block';
|
||||
document.getElementById('articlesListView').style.display = 'block';
|
||||
document.getElementById('articleDetail').style.display = 'none';
|
||||
document.getElementById('articleDetail').classList.remove('active');
|
||||
history.pushState({}, '', window.location.pathname);
|
||||
}
|
||||
|
||||
function initBackButton() {
|
||||
document.getElementById('backToList').addEventListener('click', backToList);
|
||||
}
|
||||
|
||||
function initCategoryTabs() {
|
||||
document.querySelectorAll('.category-tab').forEach(tab => {
|
||||
tab.addEventListener('click', function() {
|
||||
document.querySelectorAll('.category-tab').forEach(t => t.classList.remove('active'));
|
||||
this.classList.add('active');
|
||||
currentCategory = this.dataset.category;
|
||||
renderArticles();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initSearch() {
|
||||
const searchInput = document.getElementById('searchInput');
|
||||
const results = document.getElementById('searchResults');
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const query = this.value.toLowerCase().trim();
|
||||
if (query.length < 2) {
|
||||
results.classList.remove('active');
|
||||
return;
|
||||
}
|
||||
|
||||
const matched = articles.filter(a =>
|
||||
(!a.pageType || a.pageType === PAGE_TYPE) &&
|
||||
(a.title.toLowerCase().includes(query) || a.content.toLowerCase().includes(query))
|
||||
);
|
||||
|
||||
if (matched.length === 0) {
|
||||
results.innerHTML = '<div class="search-no-result">未找到相关文章</div>';
|
||||
} else {
|
||||
results.innerHTML = matched.slice(0, 8).map(a => `
|
||||
<div class="search-result-item" onclick="showArticle(${a.id})">
|
||||
<div class="search-result-title">${a.title}</div>
|
||||
<div class="search-result-category">${a.categoryName}</div>
|
||||
</div>
|
||||
`).join('');
|
||||
}
|
||||
results.classList.add('active');
|
||||
});
|
||||
|
||||
document.addEventListener('click', function(e) {
|
||||
if (!searchInput.contains(e.target) && !results.contains(e.target)) {
|
||||
results.classList.remove('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
+1325
File diff suppressed because it is too large
Load Diff
+1268
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,636 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>故事详情 - Chookoo 宠科智能科技</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg: #f5f7fb;
|
||||
--text: #0f172a;
|
||||
--muted: #5b6472;
|
||||
--primary: #2f6bff;
|
||||
--primary-weak: #e8f1ff;
|
||||
--card: #ffffff;
|
||||
--line: #e5e7eb;
|
||||
--shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
html { scroll-behavior: smooth; }
|
||||
body {
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
min-width: 1280px;
|
||||
line-height: 1.6;
|
||||
transform-origin: top left;
|
||||
}
|
||||
a { color: inherit; text-decoration: none; }
|
||||
|
||||
/* 导航栏 */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0; left: 0; right: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
.navbar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
padding: 0 32px;
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
}
|
||||
.navbar-menu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.navbar-logo img { height: 40px; width: auto; }
|
||||
.navbar-link {
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: var(--muted);
|
||||
border-radius: 8px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.navbar-link:hover { color: var(--text); background: rgba(0, 0, 0, 0.04); }
|
||||
.navbar-link.active { color: var(--primary); background: var(--primary-weak); }
|
||||
.navbar-actions { display: flex; align-items: center; gap: 12px; }
|
||||
.navbar-btn {
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
width: 40px; height: 40px; border-radius: 10px;
|
||||
background: transparent; border: none; cursor: pointer;
|
||||
color: var(--muted); transition: all 0.2s ease;
|
||||
}
|
||||
.navbar-btn:hover { background: rgba(0, 0, 0, 0.04); color: var(--text); }
|
||||
.navbar-btn svg { width: 20px; height: 20px; }
|
||||
.navbar-cta {
|
||||
padding: 10px 20px; font-size: 14px; font-weight: 600;
|
||||
color: #fff; background: linear-gradient(135deg, var(--primary) 0%, #06b6d4 100%);
|
||||
border: none; border-radius: 10px; transition: all 0.2s ease;
|
||||
}
|
||||
.navbar-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(47, 107, 255, 0.3); }
|
||||
.mobile-menu-btn { display: none; }
|
||||
|
||||
/* 主内容 */
|
||||
.main-content {
|
||||
padding-top: 100px;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
/* 面包屑 */
|
||||
.breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 14px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.breadcrumb a:hover { color: var(--primary); }
|
||||
.breadcrumb span { color: var(--text); font-weight: 500; }
|
||||
|
||||
/* 故事头部 */
|
||||
.story-hero {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.story-hero-image {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
border-radius: 24px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.story-hero-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.story-category-badge {
|
||||
display: inline-block;
|
||||
padding: 6px 16px;
|
||||
border-radius: 100px;
|
||||
background: var(--primary-weak);
|
||||
color: var(--primary);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.story-hero h1 {
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
line-height: 1.3;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.story-author-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 20px 24px;
|
||||
background: var(--card);
|
||||
border-radius: 16px;
|
||||
border: 1px solid var(--line);
|
||||
}
|
||||
.story-author-avatar {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
border: 3px solid var(--primary-weak);
|
||||
}
|
||||
.story-author-info { flex: 1; }
|
||||
.story-author-name {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.story-author-meta {
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
}
|
||||
.story-date-badge {
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.story-date-badge svg { width: 16px; height: 16px; }
|
||||
|
||||
/* 故事正文 */
|
||||
.story-body {
|
||||
background: var(--card);
|
||||
border-radius: 24px;
|
||||
padding: 48px;
|
||||
border: 1px solid var(--line);
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.story-body p {
|
||||
font-size: 16px;
|
||||
line-height: 2;
|
||||
color: #374151;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.story-body p:last-child { margin-bottom: 0; }
|
||||
.story-body blockquote {
|
||||
margin: 24px 0;
|
||||
padding: 20px 24px;
|
||||
background: var(--primary-weak);
|
||||
border-left: 4px solid var(--primary);
|
||||
border-radius: 0 12px 12px 0;
|
||||
font-size: 15px;
|
||||
line-height: 1.8;
|
||||
color: #1e40af;
|
||||
}
|
||||
.story-body h2 {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
margin: 32px 0 16px;
|
||||
color: var(--text);
|
||||
}
|
||||
.story-body ul {
|
||||
margin: 16px 0;
|
||||
padding-left: 24px;
|
||||
}
|
||||
.story-body li {
|
||||
font-size: 16px;
|
||||
line-height: 2;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
/* 标签 */
|
||||
.story-tags-bar {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
.story-tag-item {
|
||||
padding: 6px 16px;
|
||||
border-radius: 100px;
|
||||
background: var(--primary-weak);
|
||||
color: var(--primary);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 分隔线 */
|
||||
.story-divider {
|
||||
width: 60px;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, var(--primary), #06b6d4);
|
||||
border-radius: 2px;
|
||||
margin: 0 auto 48px;
|
||||
}
|
||||
|
||||
/* 相关故事 */
|
||||
.related-stories h2 {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.related-stories h2::before {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 24px;
|
||||
background: linear-gradient(180deg, var(--primary) 0%, #06b6d4 100%);
|
||||
border-radius: 2px;
|
||||
}
|
||||
.related-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 24px;
|
||||
}
|
||||
.related-card {
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
background: var(--card);
|
||||
border: 1px solid var(--line);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.related-card:hover {
|
||||
transform: translateY(-6px);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.related-card-image {
|
||||
height: 160px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.related-card-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.4s ease;
|
||||
}
|
||||
.related-card:hover .related-card-image img {
|
||||
transform: scale(1.08);
|
||||
}
|
||||
.related-card-content { padding: 20px; }
|
||||
.related-card-content h3 {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.related-card:hover .related-card-content h3 { color: var(--primary); }
|
||||
.related-card-content p {
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 404 */
|
||||
.not-found {
|
||||
text-align: center;
|
||||
padding: 120px 24px;
|
||||
}
|
||||
.not-found h1 { font-size: 48px; margin-bottom: 16px; }
|
||||
.not-found p { color: var(--muted); margin-bottom: 24px; }
|
||||
.not-found a {
|
||||
display: inline-block;
|
||||
padding: 12px 24px;
|
||||
background: var(--primary);
|
||||
color: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
/* 页脚 */
|
||||
.footer {
|
||||
background: #0f172a;
|
||||
color: #94a3b8;
|
||||
padding: 40px 24px;
|
||||
text-align: center;
|
||||
}
|
||||
.footer-text { font-size: 13px; }
|
||||
|
||||
/* 动画 */
|
||||
@keyframes fadeInUp {
|
||||
from { opacity: 0; transform: translateY(30px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
.story-hero { animation: fadeInUp 0.6s ease; }
|
||||
.story-body { animation: fadeInUp 0.6s ease 0.15s both; }
|
||||
.related-stories { animation: fadeInUp 0.6s ease 0.3s both; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 导航栏 -->
|
||||
<nav class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<a href="../index.html" class="navbar-logo">
|
||||
<img src="../images/logo.png" alt="Chookoo" />
|
||||
</a>
|
||||
<div class="navbar-menu">
|
||||
<a href="../index.html" class="navbar-link">首页</a>
|
||||
<a href="products.html" class="navbar-link">产品</a>
|
||||
<a href="stories.html" class="navbar-link active">故事</a>
|
||||
<a href="app.html" class="navbar-link">App</a>
|
||||
<a href="company.html?article=201" class="navbar-link">关于我们</a>
|
||||
</div>
|
||||
<div class="navbar-actions">
|
||||
<a href="help.html" class="navbar-btn" aria-label="Search">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
|
||||
</a>
|
||||
<a href="../index.html#contact" class="navbar-cta">联系我们</a>
|
||||
<button class="navbar-btn mobile-menu-btn" aria-label="Menu">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 6h16M4 12h16M4 18h16"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- 主内容 -->
|
||||
<main class="main-content" id="mainContent">
|
||||
<!-- 由 JavaScript 动态渲染 -->
|
||||
</main>
|
||||
|
||||
<!-- 页脚 -->
|
||||
<footer class="footer">
|
||||
<p class="footer-text">© 2025 Chookoo 宠科智能科技(苏州)有限公司 保留所有权利</p>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
// 视口缩放
|
||||
(() => {
|
||||
const designWidth = 1920, minWidth = 1280, maxWidth = 2560;
|
||||
function scale() {
|
||||
const vw = window.innerWidth;
|
||||
let s = vw < minWidth ? vw / minWidth : vw > maxWidth ? vw / maxWidth : vw / designWidth;
|
||||
document.body.style.transform = 'scale(' + s + ')';
|
||||
document.body.style.width = designWidth + 'px';
|
||||
}
|
||||
scale();
|
||||
window.addEventListener('resize', scale);
|
||||
})();
|
||||
|
||||
// 故事数据库
|
||||
const stories = {
|
||||
'story-1': {
|
||||
id: 'story-1',
|
||||
image: '../images/cat.png',
|
||||
fallback: '../images/cat.png',
|
||||
avatar: '../images/cat.png',
|
||||
category: '健康恢复',
|
||||
date: '2024.03',
|
||||
location: '上海',
|
||||
pet: '橘猫',
|
||||
tags: ['健康监测', '智能猫厕所', '数据报告'],
|
||||
title: '小橘的逆袭日记',
|
||||
excerpt: '第一次发现Chookoo的智能猫厕所后,小橘终于康复了健康...',
|
||||
paragraphs: [
|
||||
'我家小橘今年三岁,是一只活泼好动的橘猫。去年冬天开始,我发现它如厕的频率明显增加了,有时候一天要去好几次猫砂盆。一开始我以为只是正常的饮食变化,并没有太在意。',
|
||||
'直到有一天,我在清理猫砂盆的时候发现了一些异常的痕迹。我立刻带小橘去了宠物医院,医生检查后告诉我,小橘可能存在泌尿系统的隐患,需要长期观察和定期检测。这让我非常担心。',
|
||||
'后来在朋友的推荐下,我入手了Chookoo的智能猫厕所Pro。一开始我只是抱着试试看的心态,没想到它给了我一个巨大的惊喜。设备内置的毫米波雷达可以监测小橘的心率和呼吸,红外测温功能还能实时检测体温。',
|
||||
'更让我安心的是,每次小橘如厕后,APP都会自动生成健康数据报告,包括如厕时长、频率、体重变化等关键指标。通过这些数据,我可以清楚地看到小橘的健康趋势,再也不用担心错过任何异常信号。',
|
||||
'经过三个月的持续监测和医生的配合治疗,小橘的各项指标都恢复了正常。现在它每天都活力满满,我也终于可以放心地工作了。感谢Chookoo,让我成为了一个更负责任的猫家长。'
|
||||
],
|
||||
highlights: [
|
||||
'通过智能猫厕所的持续监测,及时发现猫咪健康异常',
|
||||
'APP数据报告让宠物主人随时掌握健康趋势',
|
||||
'配合兽医治疗,帮助小橘恢复健康'
|
||||
]
|
||||
},
|
||||
'story-2': {
|
||||
id: 'story-2',
|
||||
image: '../images/dog.jpeg',
|
||||
fallback: '../images/dog.jpeg',
|
||||
avatar: '../images/dog.jpeg',
|
||||
category: '体重管理',
|
||||
date: '2024.02',
|
||||
location: '北京',
|
||||
pet: '金毛',
|
||||
tags: ['智能喂食', '体重管理', '定时定量'],
|
||||
title: '旺财的健身日记',
|
||||
excerpt: '旺财以前很挑食,Chookoo的智能喂食器帮它养成了定点投喂的好习惯...',
|
||||
paragraphs: [
|
||||
'旺财是一只两岁的金毛犬,活泼好动是它的天性。但它有一个让我头疼的问题——挑食。有时候一天不吃东西,有时候又暴饮暴食,体重一直不太稳定。',
|
||||
'最严重的时候,旺财的体重飙升到了38公斤,医生警告我必须控制它的饮食,否则会对关节和心脏造成很大的负担。我尝试过手动控制食量,但因为工作忙碌,经常忘记按时喂食。',
|
||||
'后来我购买了Chookoo的智能喂食器,这彻底改变了我们家的喂养方式。我可以在APP上设置每天固定的喂食时间和食量,喂食器会精准地投喂每一餐。旺财很快就养成了定时吃饭的好习惯。',
|
||||
'最让我惊喜的是,喂食器还会记录每次的进食量和时间,生成进食报告。通过三个月的数据追踪,配合适量的运动,旺财的体重已经稳定在了32公斤的理想范围。',
|
||||
'现在的旺财每天准时在喂食器前等候,吃完饭后还会开心地摇尾巴。科学喂养真的不是一句空话,感谢Chookoo让我们的养宠生活变得更轻松。'
|
||||
],
|
||||
highlights: [
|
||||
'智能喂食器帮助旺财养成定时定量进食的好习惯',
|
||||
'APP进食数据追踪让体重管理更有科学依据',
|
||||
'三个月减重6公斤,恢复健康体型'
|
||||
]
|
||||
},
|
||||
'story-3': {
|
||||
id: 'story-3',
|
||||
image: '../images/cat.png',
|
||||
fallback: '../images/cat.png',
|
||||
avatar: '../images/cat.png',
|
||||
category: 'AI识别',
|
||||
date: '2024.01',
|
||||
location: '深圳',
|
||||
pet: '英短',
|
||||
tags: ['AI摄像头', '行为识别', '远程守护'],
|
||||
title: '布丁的日常',
|
||||
excerpt: '自从用了AI摄像头,可以自动识别布丁的状态,让我惊喜万分...',
|
||||
paragraphs: [
|
||||
'布丁是一只一岁的英国短毛猫,因为工作原因我白天经常不在家。每次出门的时候,我都会担心它是不是安全,有没有好好吃饭,是不是又在偷偷啃我的拖鞋。',
|
||||
'朋友给我推荐了Chookoo的AI宠物摄像头,说它可以自动识别宠物的行为。我抱着试一试的心态入手了一台,没想到从此打开了新世界的大门。',
|
||||
'摄像头的1080P高清画质非常清晰,即使在夜晚,红外夜视功能也能清楚地看到布丁的一举一动。最让我惊喜的是它的AI行为识别功能,能自动判断布丁是在睡觉、玩耍、进食还是异常行为。',
|
||||
'有一天上班的时候,手机突然收到一条AI提醒:「检测到您的宠物出现频繁抓挠行为」。我赶紧打开APP查看回放,发现布丁一直在挠耳朵。下班后立刻带它去了医院,结果检查出耳螨,幸亏发现得早。',
|
||||
'从那以后,我更加信赖这个AI摄像头了。它不仅仅是一个监控设备,更像是一个24小时守护布丁的智能管家。感谢Chookoo让我可以安心工作,也能时刻关注布丁的状态。'
|
||||
],
|
||||
highlights: [
|
||||
'AI行为识别及时发现猫咪频繁抓挠的异常行为',
|
||||
'高清夜视功能让夜间监控同样清晰',
|
||||
'远程双向语音可以随时安抚宠物情绪'
|
||||
]
|
||||
},
|
||||
'story-4': {
|
||||
id: 'story-4',
|
||||
image: '../images/dog.jpeg',
|
||||
fallback: '../images/dog.jpeg',
|
||||
avatar: '../images/dog.jpeg',
|
||||
category: '饮水健康',
|
||||
date: '2024.01',
|
||||
location: '杭州',
|
||||
pet: '柯基',
|
||||
tags: ['智能饮水机', '饮水提醒', '循环净化'],
|
||||
title: '豆豆的饮水日记',
|
||||
excerpt: '豆豆以前不爱喝水,用了智能饮水机后,循环净化的水让它爱喝了...',
|
||||
paragraphs: [
|
||||
'豆豆是一只三岁的柯基犬,活泼可爱,但有一个让我非常头疼的问题——不爱喝水。每次给它倒的水,放一整天都不见少。医生说长期饮水不足会导致泌尿系统和肾脏问题,这让我非常焦虑。',
|
||||
'我试过各种方法:在水中加入鸡胸肉汤、更换不同材质的水碗、在多个位置放水碗……效果都不理想。直到我发现了Chookoo的智能饮水机。',
|
||||
'这款饮水机采用循环活水设计,模拟自然流动的泉水,这对狗狗来说比静止的水更有吸引力。四重过滤系统——活性炭、离子树脂、超滤膜和高密度棉——确保水质始终干净新鲜。',
|
||||
'豆豆第一次看到流动的水就好奇地凑过去闻了闻,然后开始舔着喝。从那以后,它喝水的频率明显增加了。APP上的饮水数据也证实了这一点,从每天不到200ml增加到了500ml以上。',
|
||||
'最让我安心的是,当水位过低或滤芯需要更换时,APP会自动推送提醒,再也不用担心忘记维护了。豆豆现在每天都精神满满,皮毛也更加光亮了。'
|
||||
],
|
||||
highlights: [
|
||||
'循环活水设计激发狗狗饮水兴趣',
|
||||
'四重过滤系统确保水质安全',
|
||||
'APP智能提醒帮助维护设备'
|
||||
]
|
||||
},
|
||||
'story-5': {
|
||||
id: 'story-5',
|
||||
image: '../images/cat.png',
|
||||
fallback: '../images/cat.png',
|
||||
avatar: '../images/cat.png',
|
||||
category: '健康监测',
|
||||
date: '2023.12',
|
||||
location: '广州',
|
||||
pet: '美短',
|
||||
tags: ['健康监测', '预防管理', '数据报告'],
|
||||
title: '咪咪的健康守护',
|
||||
excerpt: 'Chookoo的智能设备帮我实时监测咪咪的健康状况,每次数据报告都让我很安心...',
|
||||
paragraphs: [
|
||||
'咪咪是一只四岁的美国短毛猫,是我从小养到大的宝贝。随着年龄的增长,我越来越关注它的健康状况。去年体检的时候,医生说咪咪的各项指标都还不错,但建议我多关注它的日常健康数据。',
|
||||
'抱着试试看的心态,我入手了Chookoo的智能猫厕所和健康追踪器。这两个设备的组合使用,让我对咪咪的健康状况有了前所未有的了解。',
|
||||
'智能猫厕所每次都会记录咪咪的如厕时间、频率和体重变化。有一次,APP的数据分析提示咪咪的如厕频率出现异常上升趋势。虽然变化很轻微,但我还是决定带它去医院检查。',
|
||||
'结果发现咪咪有轻微的膀胱炎症,因为发现得早,只用了两周的药就完全康复了。如果等到症状明显再去,可能就需要更长的治疗周期。这让我深刻体会到了「预防胜于治疗」的含义。',
|
||||
'现在我已经养成了每天查看咪咪健康报告的习惯。Chookoo不仅给了我数据,更给了我安心。真正的健康管理,就是在日常中持续关注,把风险扼杀在摇篮里。'
|
||||
],
|
||||
highlights: [
|
||||
'智能设备帮助早期发现猫咪膀胱炎症',
|
||||
'日常健康数据持续追踪让预防成为可能',
|
||||
'APP健康报告让宠物主人更安心'
|
||||
]
|
||||
},
|
||||
'story-6': {
|
||||
id: 'story-6',
|
||||
image: '../images/dog.jpeg',
|
||||
fallback: '../images/dog.jpeg',
|
||||
avatar: '../images/dog.jpeg',
|
||||
category: '训练养成',
|
||||
date: '2023.11',
|
||||
location: '成都',
|
||||
pet: '田园犬',
|
||||
tags: ['智能狗厕所', '如厕训练', '清洁管理'],
|
||||
title: '大黄的如厕训练',
|
||||
excerpt: '大黄以前随地大小便,用了Chookoo的智能狗厕所,科学训练让它很快养成了好习惯...',
|
||||
paragraphs: [
|
||||
'大黄是我从救助站领养的一只中华田园犬,刚来的时候已经一岁多了。因为之前在外面流浪过,大黄完全没有室内如厕的概念,经常在家里随地大小便,让我非常苦恼。',
|
||||
'我尝试过传统的如厕训练方法——铺报纸、喷诱导剂、发现它要上厕所就赶紧抱到指定位置。但因为工作忙,不可能24小时盯着它,效果一直不理想。',
|
||||
'后来在网上看到了Chookoo的智能狗厕所,介绍说有科学诱导训练功能,我决定试一试。设备通过特殊的诱导气味和声音提示,引导大黄到指定位置如厕。',
|
||||
'让我没想到的是,仅仅用了两周时间,大黄就学会了在狗厕所上如厕。APP还会记录它每次成功如厕的次数,生成训练报告。看到进度一天天提升,我真的很有成就感。',
|
||||
'现在大黄已经完全适应了在智能狗厕所上如厕,自动冲水清洁功能也让我省心了不少。从一只随地大小便的流浪狗到如今的乖巧毛孩子,大黄的进步让我非常欣慰。'
|
||||
],
|
||||
highlights: [
|
||||
'科学诱导训练帮助领养犬快速学会定点如厕',
|
||||
'APP训练报告追踪进度,增强训练信心',
|
||||
'自动清洁功能减轻主人维护负担'
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
// 渲染故事详情
|
||||
function renderStory(storyId) {
|
||||
var story = stories[storyId];
|
||||
var main = document.getElementById('mainContent');
|
||||
|
||||
if (!story) {
|
||||
main.innerHTML = '<div class="not-found"><h1>故事未找到</h1><p>抱歉,您访问的故事不存在</p><a href="stories.html">返回故事列表</a></div>';
|
||||
document.title = '故事未找到 - Chookoo';
|
||||
return;
|
||||
}
|
||||
|
||||
document.title = story.title + ' - Chookoo';
|
||||
|
||||
// 获取相关故事(同类型或其他)
|
||||
var relatedIds = Object.keys(stories).filter(function(id) { return id !== storyId; });
|
||||
relatedIds.sort(function() { return Math.random() - 0.5; });
|
||||
var related = relatedIds.slice(0, 3);
|
||||
|
||||
// 构建正文HTML
|
||||
var bodyHTML = '';
|
||||
story.paragraphs.forEach(function(p) {
|
||||
bodyHTML += '<p>' + p + '</p>';
|
||||
});
|
||||
|
||||
// 高亮块
|
||||
var highlightHTML = '';
|
||||
if (story.highlights && story.highlights.length > 0) {
|
||||
highlightHTML = '<blockquote>';
|
||||
story.highlights.forEach(function(h) {
|
||||
highlightHTML += h + '<br/>';
|
||||
});
|
||||
highlightHTML += '</blockquote>';
|
||||
}
|
||||
|
||||
// 相关故事
|
||||
var relatedHTML = '';
|
||||
related.forEach(function(rid) {
|
||||
var rs = stories[rid];
|
||||
relatedHTML += '<a href="story-detail.html?id=' + rs.id + '" class="related-card">' +
|
||||
'<div class="related-card-image"><img src="' + rs.image + '" alt="' + rs.title + '" onerror="this.src=\'' + rs.fallback + '\'" /></div>' +
|
||||
'<div class="related-card-content"><h3>' + rs.title + '</h3><p>' + rs.excerpt + '</p></div>' +
|
||||
'</a>';
|
||||
});
|
||||
|
||||
main.innerHTML =
|
||||
'<div class="breadcrumb">' +
|
||||
'<a href="../index.html">首页</a><span>/</span>' +
|
||||
'<a href="stories.html">故事</a><span>/</span>' +
|
||||
'<span>' + story.title + '</span>' +
|
||||
'</div>' +
|
||||
|
||||
'<div class="story-hero">' +
|
||||
'<div class="story-hero-image"><img src="' + story.image + '" alt="' + story.title + '" onerror="this.src=\'' + story.fallback + '\'" /></div>' +
|
||||
'<span class="story-category-badge">' + story.category + '</span>' +
|
||||
'<h1>' + story.title + '</h1>' +
|
||||
'<div class="story-author-bar">' +
|
||||
'<img class="story-author-avatar" src="' + story.avatar + '" alt="' + story.pet + '" onerror="this.src=\'' + story.fallback + '\'" />' +
|
||||
'<div class="story-author-info">' +
|
||||
'<p class="story-author-name">' + story.pet + '家长</p>' +
|
||||
'<p class="story-author-meta">' + story.pet + ' · ' + story.location + '</p>' +
|
||||
'</div>' +
|
||||
'<div class="story-date-badge">' +
|
||||
'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>' +
|
||||
'<span>' + story.date + '</span>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
|
||||
'<div class="story-body">' +
|
||||
bodyHTML +
|
||||
highlightHTML +
|
||||
'</div>' +
|
||||
|
||||
'<div class="story-tags-bar">' +
|
||||
story.tags.map(function(t) { return '<span class="story-tag-item">' + t + '</span>'; }).join('') +
|
||||
'</div>' +
|
||||
|
||||
'<div class="story-divider"></div>' +
|
||||
|
||||
'<div class="related-stories">' +
|
||||
'<h2>更多故事</h2>' +
|
||||
'<div class="related-grid">' + relatedHTML + '</div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
// 初始化
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
var storyId = params.get('id') || 'story-1';
|
||||
renderStory(storyId);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user