// AI产业链分析平台 - 主要JavaScript文件 // 全局变量 let currentFilter = 'all'; let marketChart, techBarrierChart, marketShareChart; // 公司数据 const companiesData = { cambricon: { name: '寒武纪', category: 'upstream', moatScore: 9.2, marketShare: 15, patents: 2700, revenue: 2.3, growth: 65 }, huawei: { name: '华为昇腾', category: 'upstream', moatScore: 9.5, marketShare: 25, patents: 5000, revenue: 8.5, growth: 45 }, nvidia: { name: '英伟达', category: 'upstream', moatScore: 9.9, marketShare: 90, patents: 8000, revenue: 60.9, growth: 122 }, iflytek: { name: '科大讯飞', category: 'upstream', moatScore: 9.1, marketShare: 18, patents: 3200, revenue: 18.3, growth: 25 }, baidu: { name: '百度飞桨', category: 'midstream', moatScore: 9.0, marketShare: 35, developers: 2333, models: 110, growth: 40 }, hikvision: { name: '海康威视', category: 'downstream', moatScore: 8.8, marketShare: 28, revenue: 81.2, accuracy: 99, growth: 12 } }; // DOM加载完成后初始化 document.addEventListener('DOMContentLoaded', function() { initializeAnimations(); initializeCharts(); initializeFilters(); initializeScrollEffects(); }); // 初始化滚动动画 function initializeAnimations() { // 页面加载动画 anime({ targets: '.fade-in', opacity: [0, 1], translateY: [30, 0], delay: anime.stagger(200), duration: 800, easing: 'easeOutQuart' }); // 公司卡片动画 anime({ targets: '.company-card', scale: [0.9, 1], opacity: [0, 1], delay: anime.stagger(100, {start: 500}), duration: 600, easing: 'easeOutBack' }); } // 初始化图表 function initializeCharts() { // 市场规模分析图表 const marketChartDom = document.getElementById('marketChart'); marketChart = echarts.init(marketChartDom); const marketOption = { backgroundColor: 'transparent', title: { text: 'AI产业市场规模趋势', textStyle: { color: '#ffffff', fontSize: 18 }, left: 'center' }, tooltip: { trigger: 'axis', backgroundColor: 'rgba(30, 41, 59, 0.9)', borderColor: 'rgba(148, 163, 184, 0.2)', textStyle: { color: '#ffffff' } }, legend: { data: ['中国AI市场', '全球AI市场', 'AI芯片市场'], textStyle: { color: '#cbd5e1' }, bottom: 10 }, grid: { left: '3%', right: '4%', bottom: '15%', containLabel: true }, xAxis: { type: 'category', boundaryGap: false, data: ['2020', '2021', '2022', '2023', '2024', '2025'], axisLine: { lineStyle: { color: '#475569' } }, axisLabel: { color: '#94a3b8' } }, yAxis: { type: 'value', axisLine: { lineStyle: { color: '#475569' } }, axisLabel: { color: '#94a3b8' }, splitLine: { lineStyle: { color: 'rgba(71, 85, 105, 0.3)' } } }, series: [ { name: '中国AI市场', type: 'line', smooth: true, data: [150, 220, 320, 450, 620, 850], lineStyle: { color: '#2563eb', width: 3 }, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: 'rgba(37, 99, 235, 0.3)' }, { offset: 1, color: 'rgba(37, 99, 235, 0.05)' } ] } } }, { name: '全球AI市场', type: 'line', smooth: true, data: [1200, 1650, 2200, 2900, 3800, 4900], lineStyle: { color: '#0891b2', width: 3 }, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: 'rgba(8, 145, 178, 0.3)' }, { offset: 1, color: 'rgba(8, 145, 178, 0.05)' } ] } } }, { name: 'AI芯片市场', type: 'line', smooth: true, data: [180, 280, 420, 650, 950, 1400], lineStyle: { color: '#059669', width: 3 }, areaStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: 'rgba(5, 150, 105, 0.3)' }, { offset: 1, color: 'rgba(5, 150, 105, 0.05)' } ] } } } ] }; marketChart.setOption(marketOption); // 技术壁垒分析图表 const techChartDom = document.getElementById('techBarrierChart'); techBarrierChart = echarts.init(techChartDom); const techOption = { backgroundColor: 'transparent', title: { text: '各公司技术壁垒评分', textStyle: { color: '#ffffff', fontSize: 16 }, left: 'center' }, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, backgroundColor: 'rgba(30, 41, 59, 0.9)', borderColor: 'rgba(148, 163, 184, 0.2)', textStyle: { color: '#ffffff' } }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'category', data: ['寒武纪', '华为昇腾', '英伟达', '科大讯飞', '百度飞桨', '海康威视'], axisLine: { lineStyle: { color: '#475569' } }, axisLabel: { color: '#94a3b8', rotate: 45 } }, yAxis: { type: 'value', max: 10, axisLine: { lineStyle: { color: '#475569' } }, axisLabel: { color: '#94a3b8' }, splitLine: { lineStyle: { color: 'rgba(71, 85, 105, 0.3)' } } }, series: [{ type: 'bar', data: [9.2, 9.5, 9.9, 9.1, 9.0, 8.8], itemStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: '#2563eb' }, { offset: 1, color: '#0891b2' } ] }, borderRadius: [4, 4, 0, 0] }, emphasis: { itemStyle: { color: '#059669' } } }] }; techBarrierChart.setOption(techOption); // 市场份额分析图表 const shareChartDom = document.getElementById('marketShareChart'); marketShareChart = echarts.init(shareChartDom); const shareOption = { backgroundColor: 'transparent', title: { text: 'AI芯片市场份额', textStyle: { color: '#ffffff', fontSize: 16 }, left: 'center' }, tooltip: { trigger: 'item', backgroundColor: 'rgba(30, 41, 59, 0.9)', borderColor: 'rgba(148, 163, 184, 0.2)', textStyle: { color: '#ffffff' } }, legend: { orient: 'horizontal', bottom: '0%', textStyle: { color: '#94a3b8' } }, series: [{ type: 'pie', radius: ['40%', '70%'], center: ['50%', '45%'], avoidLabelOverlap: false, label: { show: false, position: 'center' }, emphasis: { label: { show: true, fontSize: '18', fontWeight: 'bold', color: '#ffffff' } }, labelLine: { show: false }, data: [ { value: 90, name: '英伟达', itemStyle: { color: '#2563eb' } }, { value: 25, name: '华为昇腾', itemStyle: { color: '#0891b2' } }, { value: 15, name: '寒武纪', itemStyle: { color: '#059669' } }, { value: 8, name: '其他', itemStyle: { color: '#6b7280' } } ] }] }; marketShareChart.setOption(shareOption); // 响应式处理 window.addEventListener('resize', function() { marketChart.resize(); techBarrierChart.resize(); marketShareChart.resize(); }); } // 初始化筛选功能 function initializeFilters() { const filterButtons = document.querySelectorAll('.filter-btn'); const companyCards = document.querySelectorAll('.company-card'); filterButtons.forEach(button => { button.addEventListener('click', function() { // 更新按钮状态 filterButtons.forEach(btn => btn.classList.remove('active')); this.classList.add('active'); const filter = this.getAttribute('data-filter'); currentFilter = filter; // 筛选公司卡片 companyCards.forEach(card => { const categories = card.getAttribute('data-category'); if (filter === 'all' || categories.includes(filter)) { card.style.display = 'block'; anime({ targets: card, opacity: [0, 1], scale: [0.8, 1], duration: 400, easing: 'easeOutBack' }); } else { anime({ targets: card, opacity: [1, 0], scale: [1, 0.8], duration: 300, easing: 'easeInBack', complete: function() { card.style.display = 'none'; } }); } }); }); }); // 公司卡片点击事件 companyCards.forEach(card => { card.addEventListener('click', function() { const companyId = this.getAttribute('data-company'); if (companyId) { showCompanyDetails(companyId); } }); }); } // 显示公司详情 function showCompanyDetails(companyId) { const company = companiesData[companyId]; if (!company) return; // 创建模态框显示公司详情 const modal = document.createElement('div'); modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50'; modal.innerHTML = `