From 15b04e678867a174fc709fe9d8950b41a549161e Mon Sep 17 00:00:00 2001 From: d266377 Date: Fri, 30 Jan 2026 11:07:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=81=E5=8A=BF=E6=84=9F=E7=9F=A5=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0-=E6=AD=A6=E6=B1=89=E5=B8=82=E5=BC=80=E6=BA=90?= =?UTF-8?q?=E7=94=9F=E6=80=81=E5=BB=BA=E8=AE=BE=E6=8E=A5=E5=8F=A3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Jyh/Community/components/HMStatsBar.vue | 7 ++++--- .../Community/components/HarmonyEcoCharts.vue | 21 +++++++++++-------- .../Jyh/Community/components/StatsBar.vue | 7 ++++--- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/views/Jyh/Community/components/HMStatsBar.vue b/src/views/Jyh/Community/components/HMStatsBar.vue index 4a4783c..18ab38d 100644 --- a/src/views/Jyh/Community/components/HMStatsBar.vue +++ b/src/views/Jyh/Community/components/HMStatsBar.vue @@ -58,9 +58,10 @@ const fetchStats = async () => { try { loading.value = true; const response = await hmStatsBarPage3(); + const businessData = response.data; - if (response.code === 200 && response.data) { - const { developer, certificationDeveloper, wuhanCertificationDeveloper, project, company } = response.data; + if (businessData.code === 200 && businessData) { + const { developer, certificationDeveloper, wuhanCertificationDeveloper, project, company } = businessData.data; // 格式化数据显示 hmDevelopers.value = `${formatNumber(developer)}+`; @@ -69,7 +70,7 @@ const fetchStats = async () => { hmProjects.value = `${formatNumber(project)}`; hmCompanies.value = `${formatNumber(company)}+`; } else { - console.error('获取鸿蒙统计数据失败:', response.msg || '未知错误'); + console.error('获取鸿蒙统计数据失败:', businessData.msg || '未知错误'); // 设置默认值 hmDevelopers.value = '1000万+'; hmCertificationDevelopers.value = '60万+'; diff --git a/src/views/Jyh/Community/components/HarmonyEcoCharts.vue b/src/views/Jyh/Community/components/HarmonyEcoCharts.vue index 5855349..5a7a375 100644 --- a/src/views/Jyh/Community/components/HarmonyEcoCharts.vue +++ b/src/views/Jyh/Community/components/HarmonyEcoCharts.vue @@ -455,10 +455,11 @@ const hmProjects = ref([ const fetchHmProjects = async () => { try { const response = await hmProjectsPage3(); - if (response.code === 200 && response.data) { - hmProjects.value = response.data; + const businessData = response.data; + if (businessData.code === 200 && businessData.data) { + hmProjects.value = businessData.data; } else { - console.error('获取鸿蒙开源项目数据失败:', response.msg || '未知错误'); + console.error('获取鸿蒙开源项目数据失败:', businessData.msg || '未知错误'); // 使用默认数据 hmProjects.value = [ { @@ -607,10 +608,11 @@ const whProjects = ref([ const fetchWhProjects = async() => { try { const response = await whProjectsPage3(); - if (response.code === 200 && response.data) { - whProjects.value = response.data; + const businessData = response.data; + if (businessData.code === 200 && businessData.data) { + whProjects.value = businessData.data; } else { - console.error('获取武汉鸿蒙开源项目数据失败:', response.msg || '未知错误'); + console.error('获取武汉鸿蒙开源项目数据失败:', businessData.msg || '未知错误'); // 使用默认数据 whProjects.value = [ { name: 'docs', desc: 'OpenHarmony官方文档与指南', stars: '498', company: '中科创达' }, // 总热度: 4152 (498 Star + 3654 Fork) @@ -974,12 +976,13 @@ const initHmCityChart = () => { const fetchHmCityData = async () => { try { const response = await hmCityDataPage3(); - if (response.code === 200 && response.data) { - hmCityData.value = response.data; + const businessData = response.data; + if (businessData.code === 200 && businessData.data) { + hmCityData.value = businessData.data; // 重新初始化图表以显示新数据 initHmCityChart(); } else { - console.error('获取鸿蒙项目城市分布数据失败:', response.msg || '未知错误'); + console.error('获取鸿蒙项目城市分布数据失败:', businessData.msg || '未知错误'); // 使用默认数据 hmCityData.value = [ { name: '广东', value: 185 }, diff --git a/src/views/Jyh/Community/components/StatsBar.vue b/src/views/Jyh/Community/components/StatsBar.vue index 9050f73..d96e42a 100644 --- a/src/views/Jyh/Community/components/StatsBar.vue +++ b/src/views/Jyh/Community/components/StatsBar.vue @@ -52,9 +52,10 @@ const fetchStats = async() => { try { loading.value = true; const response = await statsBarPage3(); + const businessData = response.data; - if (response.code === 200 && response.data) { - const { developer, community, company, project } = response.data; + if (businessData.code === 200 && businessData) { + const { developer, community, company, project } = businessData.data; // 格式化数据显示 whDeveloper.value = `${formatNumber(developer)}+`; @@ -62,7 +63,7 @@ const fetchStats = async() => { whCompany.value = `${formatNumber(company)}+`; whProject.value = `${formatNumber(project)}+`; } else { - console.error('获取统计数据失败:', response.msg || '未知错误'); + console.error('获取统计数据失败:', businessData.msg || '未知错误'); // 设置默认值 whDeveloper.value = '70万+'; whCommunity.value = '12';