update pay ui
This commit is contained in:
@@ -30,6 +30,7 @@ import ReactECharts from 'echarts-for-react';
|
||||
import { logger } from '@utils/logger';
|
||||
import { getApiBase } from '@utils/apiConfig';
|
||||
import { useIndexQuote } from '@hooks/useIndexQuote';
|
||||
import conceptStaticService from '@services/conceptStaticService';
|
||||
|
||||
// 定义动画
|
||||
const animations = `
|
||||
@@ -74,18 +75,13 @@ const fetchIndexKline = async (indexCode) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取热门概念数据
|
||||
* 获取热门概念数据(使用静态文件)
|
||||
*/
|
||||
const fetchPopularConcepts = async () => {
|
||||
try {
|
||||
const response = await fetch(`${getApiBase()}/concept-api/search`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ query: '', size: 60, page: 1, sort_by: 'change_pct' })
|
||||
});
|
||||
const data = await response.json();
|
||||
if (data.results?.length > 0) {
|
||||
return data.results.map(item => ({
|
||||
const result = await conceptStaticService.fetchPopularConcepts();
|
||||
if (result.success && result.data?.results?.length > 0) {
|
||||
return result.data.results.map(item => ({
|
||||
name: item.concept,
|
||||
change_pct: item.price_info?.avg_change_pct || 0,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user