<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>启辰科技 · QUICH TECH — 星火燎原，超越自我</title>
  <meta name="description" content="石家庄启辰科技有限公司 — 服务器、存储、软件定制、华为监控解决方案">
  <link rel="stylesheet" href="style.css">
</head>
<body>

<!-- Loading Screen -->
<div class="loading-screen" id="loading">
  <div class="loading-spinner"></div>
  <div class="loading-text">INITIALIZING</div>
</div>

<!-- Header -->
<header class="header" id="header">
  <div class="container">
    <a href="index.html" class="logo">
      <div class="logo-icon">
        <img src="icon_00f0ff.png"></img>
      </div>
      <div class="logo-text">
        QUICH
        <span class="cn">启辰科技</span>
      </div>
    </a>
    <nav class="nav-menu" id="navMenu">
      <div class="nav-item active">
        <a href="index.html">首页<span>HOME</span></a>
      </div>
      <div class="nav-item">
        <a href="prolist.html">产品<span>PRODUCT</span></a>
        <div class="dropdown" id="productDropdown"></div>
      </div>
      <div class="nav-item">
        <a href="contact.html">联系我们<span>CONTACT</span></a>
      </div>
    </nav>
    <div class="menu-toggle" id="menuToggle" onclick="toggleMenu()">
      <span></span><span></span><span></span>
    </div>
  </div>
</header>

<!-- Hero Section -->
<section class="hero">
  <div class="hero-bg-grid"></div>
  <div class="hero-orb hero-orb-1"></div>
  <div class="hero-orb hero-orb-2"></div>
  <div class="hero-orb hero-orb-3"></div>
  <div class="hero-content">
    <div class="hero-badge">NEXT-GEN TECHNOLOGY SOLUTIONS</div>
    <h1 class="hero-title">
      <span class="highlight">星火燎原</span><br>超越自我
    </h1>
    <p class="hero-subtitle">持续感动客户</p>
    <p class="hero-desc">石家庄启辰科技有限公司 — 专注服务器、存储、软件定制与华为监控解决方案，为您的企业构建未来数字基础设施</p>
    <div class="hero-cta">
      <a href="prolist.html" class="btn btn-primary">探索产品 →</a>
      <a href="contact.html" class="btn btn-outline">联系我们</a>
    </div>
  </div>
  <div class="scroll-indicator">
    <span>SCROLL</span>
    <div class="arrow"></div>
  </div>
</section>

<!-- Notices Section -->
<section class="section" id="notices">
  <div class="container">
    <div class="section-header fade-in">
      <div class="section-tag">SYSTEM BULLETINS</div>
      <h2 class="section-title">通知公告<span class="en">NOTICES</span></h2>
      <div class="glow-line"></div>
    </div>
    <div class="notices-grid">
      <a href="notice.html?id=4" class="notice-card fade-in holo-card">
        <div class="notice-tag">ALERT</div>
        <h3>华为方法论：以奋斗者为本</h3>
        <p>深入解读华为核心价值观，以奋斗者为本，构建企业持续竞争力</p>
        <div class="date">2024.12.15</div>
      </a>
      <a href="notice.html?id=1" class="notice-card fade-in holo-card" style="transition-delay:0.3s">
        <div class="notice-tag">SPEC</div>
        <h3>关于响应华为高品质一致性服务规范的公告</h3>
        <p>全面贯彻华为高品质服务标准，提升客户体验一致性</p>
        <div class="date">2024.09.01</div>
      </a>
    </div>
  </div>
</section>

<!-- Products Section -->
<section class="section" id="products" style="background: rgba(0,240,255,0.01)">
  <div class="container">
    <div class="section-header fade-in">
      <div class="section-tag">PRODUCT MATRIX</div>
      <h2 class="section-title">热门产品<span class="en">HOT PRODUCTS</span></h2>
      <div class="glow-line"></div>
    </div>
    <div class="products-filter fade-in" id="productFilter"></div>
    <div class="products-grid" id="productsGrid"></div>
    <div style="text-align:center;margin-top:40px" class="fade-in">
      <a href="prolist.html" class="btn btn-outline">查看全部产品 →</a>
    </div>
  </div>
</section>

<!-- About Section -->
<section class="section" id="about">
  <div class="container">
    <div class="section-header fade-in">
      <div class="section-tag">ABOUT QUICH</div>
      <h2 class="section-title">关于我们<span class="en">ABOUT US</span></h2>
      <div class="glow-line"></div>
    </div>
    <div class="about-grid">
      <div class="about-visual slide-in-left">
        <div class="hex-frame">
          <div class="core-icon"><img src="icon_00f0ff.png"></img><div class="logo-text"> 启 辰 科 技</div></div>
        </div>
        <div class="about-stats">
          <div class="stat-item">
            <div class="num">10+</div>
            <div class="label">年行业经验</div>
          </div>
          <div class="stat-item">
            <div class="num">500+</div>
            <div class="label">服务客户</div>
          </div>
          <div class="stat-item">
            <div class="num">24/7</div>
            <div class="label">技术支持</div>
          </div>
        </div>
      </div>
      <div class="about-text slide-in-right">
        <h3>石家庄启辰科技有限公司</h3>
        <div class="slogan">星火燎原，超越自我，持续感动客户</div>
        <p>启辰科技是一家专注于企业级IT解决方案的高科技公司，致力于为客户提供服务器、存储系统、软件定制开发及华为监控等全方位技术服务。</p>
        <p>我们秉承"以客户为中心"的理念，依托华为等业界领先的技术平台，为企业数字化转型提供坚实的技术底座和创新动力。</p>
        <p>从方案设计到部署实施，从技术培训到售后运维，启辰科技以专业的技术团队和完善的服务体系，持续为客户创造超越期待的价值体验。</p>
        <div style="margin-top:24px">
          <a href="contact.html" class="btn btn-primary">了解更多 →</a>
        </div>
      </div>
    </div>
  </div>
</section>

<!-- Footer -->
<footer class="footer">
  <div class="container">
    <div class="footer-grid">
      <div class="footer-brand">
        <div class="logo-text" style="font-size:1.1rem">QUICH<span class="cn">启辰科技</span></div>
        <p style="margin-top:12px">石家庄启辰科技有限公司<br>星火燎原，超越自我，持续感动客户</p>
      </div>
      <div class="footer-col">
        <h4>NAVIGATION</h4>
        <ul>
          <li><a href="index.html">首页</a></li>
          <li><a href="prolist.html">产品中心</a></li>
          <li><a href="contact.html">联系我们</a></li>
        </ul>
      </div>
      <div class="footer-col">
        <h4>SERVICES</h4>
        <ul>
          <li><a href="prolist.html">服务器方案</a></li>
          <li><a href="prolist.html">存储系统</a></li>
          <li><a href="prolist.html">软件定制</a></li>
          <li><a href="prolist.html">华为监控</a></li>
        </ul>
      </div>
      <div class="footer-col footer-contact">
        <h4>CONTACT</h4>
        <p>📞 400-873-1186</p>
        <p>📞 0311-88809750</p>
        <p>📍 石家庄市裕华区财库国际601</p>
        <p>🌐 xf3322.cn</p>
      </div>
    </div>
    <div class="footer-bottom">
      <span>© 2026 石家庄启辰科技有限公司 · <a href="http://beian.miit.gov.cn">冀ICP备15029457号-1 </a></span>
      <span>DESIGNED FOR THE FUTURE</span>
    </div>
  </div>
</footer>

<script>
// ── API 配置 ──
var httpUrl = 'http://dns.quich.com.cn:8081';
var productTypes = [];
var allProducts = [];

// ── Loading ──
window.addEventListener('load', () => {
  init();
});

async function init() {
  try {
    // 并行加载产品分类 + 轮播图
    const [typeRes, bannerRes] = await Promise.all([
      apiGet('/website/home/getProductType'),
      apiGet('/website/home/getRotationChart')
    ]);

    productTypes = typeRes.data || [];
    loadDropdown();
    loadFilter();
    loadBanners(bannerRes.data || []);

    // 默认加载第一个分类的产品
    if (productTypes.length > 0) {
      loadProductsByType(productTypes[0].id);
    }

    // 加载关于我们
    loadAbout();
  } catch (e) {
    console.error('Init error:', e);
  }
  setTimeout(() => document.getElementById('loading').classList.add('hidden'), 600);
}

// ── API 封装 ──
function apiGet(path, params) {
  let url = httpUrl + path;
  if (params) {
    const qs = Object.entries(params).map(([k, v]) => k + '=' + v).join('&');
    url += '?' + qs;
  }
  return fetch(url).then(r => r.json());
}

// ── Menu Toggle ──
function toggleMenu() {
  document.getElementById('navMenu').classList.toggle('open');
}

// ── 加载轮播图 ──
function loadBanners(list) {
  if (!list.length) return;
  const heroDesc = document.querySelector('.hero-desc');
  // 在 hero 区域后面插入轮播缩略图提示
  // 轮播图主要用于首页 banner 展示
}

// ── Product Dropdown ──
function loadDropdown() {
  document.getElementById('productDropdown').innerHTML =
    productTypes.map(t => `<a href="prolist.html?id=${t.id}">${t.name}</a>`).join('');
}

// ── Product Filter ──
function loadFilter() {
  const el = document.getElementById('productFilter');
  el.innerHTML = `<button class="filter-btn active" onclick="filterProducts(this, 0)">全部</button>` +
    productTypes.map(t =>
      `<button class="filter-btn" onclick="filterProducts(this, ${t.id})">${t.name}</button>`
    ).join('');
}

function filterProducts(btn, typeId) {
  document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
  btn.classList.add('active');
  if (typeId === 0) {
    // 全部：请求所有分类的产品
    renderProducts(allProducts);
  } else {
    loadProductsByType(typeId);
  }
}

// ── 按分类加载产品 ──
function loadProductsByType(typeId) {
  apiGet('/website/home/getHotProduct', { typeId: typeId }).then(res => {
    var list = res.data || [];
    // 合并到 allProducts（去重）
    list.forEach(p => {
      if (!allProducts.find(ap => ap.id === p.id)) {
        p.typeId = typeId;
        allProducts.push(p);
      }
    });
    renderProducts(list);
  }).catch(err => console.error('Load products error:', err));
}

// ── 渲染产品 ──
function renderProducts(list) {
  const grid = document.getElementById('productsGrid');
  const icons = { 1: '🖥️', 2: '💾', 3: '⚙️', 4: '📡' };
  grid.innerHTML = (list || []).map(p => {
    var typeName = (productTypes.find(t => t.id === (p.typeId || p.type_id)) || {}).name || '';
    var imgTag = p.mainUrl
      ? '<img src="' + p.mainUrl + '" alt="' + (p.name||'') + '" style="width:100%;height:100%;object-fit:cover">'
      : '<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:4rem;background:linear-gradient(135deg,rgba(0,240,255,0.06),rgba(168,85,247,0.06))">' + (icons[p.typeId] || icons[p.type_id] || '📦') + '</div>';
    return '<a href="proview.html?id=' + p.id + '" class="product-card fade-in visible holo-card">'
      + '<div class="product-img">' + imgTag
      + '<div class="overlay"></div>'
      + '<div class="view-btn">查看详情</div>'
      + '</div>'
      + '<div class="product-info">'
      + '<h3>' + (p.name || '') + '</h3>'
      + '<p>' + (p.describes || p.describe || '') + '</p>'
      + '<span class="product-tag">' + typeName + '</span>'
      + '</div>'
      + '</a>';
  }).join('');
}

// ── 加载关于我们 ──
function loadAbout() {
  apiGet('/website/home/getAbouts').then(res => {
    if (res.data && res.data.content) {
      // 将 HTML 内容插入到 about 区域
      var aboutText = document.querySelector('.about-text');
      if (aboutText) {
        // 保留原有的标题和 slogan
        var content = res.data.content;
        // 找到 p 标签区域，插入接口返回的内容
        var paragraphs = aboutText.querySelectorAll('p:not(.slogan)');
        if (content) {
          // 用接口内容替换静态文案
          var tempDiv = document.createElement('div');
          tempDiv.innerHTML = content;
          var ps = tempDiv.querySelectorAll('p');
          if (ps.length > 0) {
            // 清除原有静态段落
            paragraphs.forEach(p => p.remove());
            // 插入接口段落
            var slogan = aboutText.querySelector('.slogan');
            ps.forEach(p => {
              var newP = document.createElement('p');
              newP.textContent = p.textContent;
              aboutText.insertBefore(newP, aboutText.querySelector('div[style]'));
            });
          }
        }
      }
    }
  }).catch(err => console.error('Load about error:', err));
}

// ── Scroll Animation ──
const observer = new IntersectionObserver((entries) => {
  entries.forEach(e => {
    if (e.isIntersecting) e.target.classList.add('visible');
  });
}, { threshold: 0.1 });
document.querySelectorAll('.fade-in, .slide-in-left, .slide-in-right').forEach(el => observer.observe(el));

// ── Header scroll effect ──
window.addEventListener('scroll', () => {
  const h = document.getElementById('header');
  h.style.borderBottomColor = window.scrollY > 50 ? 'rgba(0,240,255,0.2)' : 'rgba(0,240,255,0.3)';
});
</script>

</body>
</html>
