feat(character): 更新角色详情页面- 修改角色详情页面布局和样式

- 添加角色属性、职业等信息展示
- 更新技能和配装推荐模块
- 优化页面加载和错误处理逻辑
This commit is contained in:
hxt
2025-05-24 12:22:04 +08:00
parent 5cf5373696
commit f527462274
4 changed files with 197 additions and 141 deletions

View File

@@ -1,5 +1,4 @@
import {Api} from "../utils/axios/config";
import axios, {AxiosRequestConfig} from "axios";
// 查询参数接口
export interface GvgTeamQueryParams {
@@ -54,6 +53,37 @@ export interface Hero {
headImgUrl: string;
}
// 角色详情接口类型
export interface HeroDetailResp {
heroRespSimpleVO: {
id: string;
heroCode: string;
heroName: string;
nickName: string | null;
headImgUrl: string;
stars: number;
role: string;
attribute: string;
};
hero60AttributeVO: {
cp: number;
atk: number;
hp: number;
spd: number;
def: number;
chc: number;
chd: number;
dac: number;
eff: number;
efr: number;
};
}
// 查询角色详情
export const getHeroDetail = async (heroCode: string): Promise<Response<HeroDetailResp>> => {
return await Api.get<Response<HeroDetailResp>>(`/epic/hero/hero-detail?heroCode=${heroCode}`)
};
// 查询 GVG 阵容列表
export const getGvgTeamList = async (heroCodes?: string[]) => {
const params = new URLSearchParams();
@@ -89,7 +119,7 @@ export const recognizeHeroesFromImage = async (file: File): Promise<ImageRecogni
const response = await Api.upload<string[]>('/epic/hero/recognize', file);
console.log(response)
if (response && Array.isArray(response)) {
return { heroNames: response };
return {heroNames: response};
}
throw new Error("图片识别失败");
} catch (error) {