mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-16 04:03:17 +08:00
🐛 修复战绩显示异常
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<THomeCard :append="false">
|
||||
<template #title>限时祈愿</template>
|
||||
<template #default>
|
||||
<!-- TODO: 当数量超过2时,改为走轮播,显示2个 -->
|
||||
<div class="pool-grid">
|
||||
<PhPoolCard v-for="(pool, idx) in pools" :key="idx" :pool="pool" />
|
||||
</div>
|
||||
|
||||
@@ -48,11 +48,8 @@
|
||||
title="解锁传送点"
|
||||
/>
|
||||
<TurOverviewSub :text="modelValue.domainNumber" title="解锁秘境" />
|
||||
<TurOverviewSub
|
||||
:text="modelValue.pyroCulus"
|
||||
icon="/icon/material/107028.webp"
|
||||
title="火神瞳"
|
||||
/>
|
||||
<!-- TODO: 添加月神瞳图标 -->
|
||||
<TurOverviewSub :text="modelValue.moonCulus" title="月神瞳" />
|
||||
<TurOverviewSub
|
||||
:text="modelValue.anemoCulus"
|
||||
icon="/icon/material/107001.webp"
|
||||
@@ -78,6 +75,11 @@
|
||||
icon="/icon/material/107023.webp"
|
||||
title="水神瞳"
|
||||
/>
|
||||
<TurOverviewSub
|
||||
:text="modelValue.pyroCulus"
|
||||
icon="/icon/material/107028.webp"
|
||||
title="火神瞳"
|
||||
/>
|
||||
<TurOverviewSub :text="modelValue.luxuriousChest" title="华丽宝箱数" />
|
||||
<TurOverviewSub :text="modelValue.preciousChest" title="珍贵宝箱数" />
|
||||
<TurOverviewSub :text="modelValue.exquisiteChest" title="精致宝箱数" />
|
||||
@@ -95,15 +97,15 @@ defineProps<{ modelValue: TGApp.Sqlite.Record.Stats }>();
|
||||
.tur-og-box {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
grid-gap: 8px;
|
||||
grid-template-columns: repeat(4, 0.25fr);
|
||||
gap: 8px;
|
||||
grid-template-columns: repeat(3, 0.33fr);
|
||||
}
|
||||
|
||||
.tur-og-box-3 {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
margin-bottom: 8px;
|
||||
grid-gap: 8px;
|
||||
gap: 8px;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -39,9 +39,7 @@
|
||||
<div class="ur-box" v-if="recordData">
|
||||
<div class="ur-box-title">
|
||||
<TurRoleInfo :role="recordData.role" :uid="uidCur ?? 0" />
|
||||
<span class="sign">
|
||||
原神战绩|Render by TeyvatGuide v{{ version }}|更新于 {{ recordData.updated }}
|
||||
</span>
|
||||
<span class="sign">TeyvatGuide v{{ version }} | {{ recordData.updated }}</span>
|
||||
</div>
|
||||
<PhCompCard>
|
||||
<template #title>数据总览</template>
|
||||
@@ -144,21 +142,21 @@ async function refreshRecord(): Promise<void> {
|
||||
}
|
||||
await showLoading.start(`正在刷新${account.value.gameUid}的战绩数据`);
|
||||
await TGLogger.Info(`[UserRecord][refresh][${account.value.gameUid}] 刷新战绩数据`);
|
||||
const res = await recordReq.index(cookie.value, account.value);
|
||||
if ("retcode" in res) {
|
||||
const resp = await recordReq.index(cookie.value, account.value);
|
||||
console.log(resp);
|
||||
if ("retcode" in resp) {
|
||||
await showLoading.end();
|
||||
showSnackbar.error(`[${res.retcode}] ${res.message}`);
|
||||
showSnackbar.error(`[${resp.retcode}] ${resp.message}`);
|
||||
await TGLogger.Error(`[UserRecord][refresh][${account.value.gameUid}] 获取战绩数据失败`);
|
||||
await TGLogger.Error(
|
||||
`[UserRecord][refresh][${account.value.gameUid}] ${res.retcode} ${res.message}`,
|
||||
`[UserRecord][refresh][${account.value.gameUid}] ${resp.retcode} ${resp.message}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
await TGLogger.Info(`[UserRecord][refresh][${account.value.gameUid}] 获取战绩数据成功`);
|
||||
await TGLogger.Info(`[UserRecord][refresh][${account.value.gameUid}]`, false);
|
||||
console.log(res);
|
||||
await showLoading.update("正在保存战绩数据");
|
||||
await TSUserRecord.saveRecord(Number(account.value.gameUid), res);
|
||||
await TSUserRecord.saveRecord(Number(account.value.gameUid), resp);
|
||||
await showLoading.update("正在加载战绩数据");
|
||||
await loadUid();
|
||||
await loadRecord();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file plugins/Sqlite/utils/transUserRecord.ts
|
||||
* @description Sqlite 数据转换 用户战绩数据转换模块
|
||||
* @since Beta v0.7.2
|
||||
* @since Beta v0.8.1
|
||||
*/
|
||||
|
||||
import { getZhElement } from "@utils/toolFunc.js";
|
||||
@@ -89,9 +89,9 @@ export function getHardChallengeDesc(difficulty: number): string {
|
||||
|
||||
/**
|
||||
* @description 将统计信息转换为数据库中的数据
|
||||
* @since Beta v0.8.0
|
||||
* @since Beta v0.8.1
|
||||
* @param {TGApp.Game.Record.Stats} data 统计信息
|
||||
* @return {TGApp.Sqlite.Record.Stats } 转换后的统计信息
|
||||
* @return {TGApp.Sqlite.Record.Stats} 转换后的统计信息
|
||||
*/
|
||||
function transStat(data: TGApp.Game.Record.Stats): TGApp.Sqlite.Record.Stats {
|
||||
return {
|
||||
@@ -107,6 +107,7 @@ function transStat(data: TGApp.Game.Record.Stats): TGApp.Sqlite.Record.Stats {
|
||||
dendroCulus: data.dendroculus_number,
|
||||
hydroCulus: data.hydroculus_number,
|
||||
pyroCulus: data.pyroculus_number,
|
||||
moonCulus: data.moonoculus_number,
|
||||
sprialAbyss: data.spiral_abyss,
|
||||
combatRole: data.role_combat.is_unlock ? `第 ${data.role_combat.max_round_id} 幕` : "未解锁",
|
||||
hardChallenge: data.hard_challenge.is_unlock
|
||||
@@ -122,7 +123,7 @@ function transStat(data: TGApp.Game.Record.Stats): TGApp.Sqlite.Record.Stats {
|
||||
|
||||
/**
|
||||
* @description 将探索信息转换为数据库中的数据
|
||||
* @since Beta v0.7.2
|
||||
* @since Beta v0.8.1
|
||||
* @param {TGApp.Game.Record.WorldExplore[]} data 城市探索信息
|
||||
* @returns {TGApp.Sqlite.Record.WorldExplore[]} 转换后的城市探索信息
|
||||
*/
|
||||
@@ -164,6 +165,13 @@ function transWorld(data: TGApp.Game.Record.WorldExplore[]): TGApp.Sqlite.Record
|
||||
world.iconLight = world.icon;
|
||||
world.bg =
|
||||
"https://fastcdn.mihoyo.com/static-resource-v2/2025/03/17/8ee1648101a8b292ffb37eb49559032e_6583057448168798147.png";
|
||||
// 对挪德卡莱的特殊处理
|
||||
} else if (area.name === "挪德卡莱") {
|
||||
world.icon =
|
||||
"https://webstatic.mihoyo.com/app/community-game-records/images/world-logo-17.dadac5bf.png";
|
||||
world.iconLight = world.icon;
|
||||
world.bg =
|
||||
"https://fastcdn.mihoyo.com/static-resource-v2/2025/08/22/ace66cea9c5074b70310ecbbb712cd94_2619077306700596372.png";
|
||||
}
|
||||
const children = areaChild.filter((i) => i.parent_id === area.id);
|
||||
for (const child of children) {
|
||||
|
||||
68
src/types/Game/Record.d.ts
vendored
68
src/types/Game/Record.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file types/Game/Record.d.ts
|
||||
* @description 原神战绩相关类型定义文件
|
||||
* @since Beta v0.8.0
|
||||
* @since Beta v0.8.1
|
||||
*/
|
||||
|
||||
declare namespace TGApp.Game.Record {
|
||||
@@ -11,7 +11,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @since Alpha v0.2.0
|
||||
* @extends TGApp.BBS.Response.BaseWithData
|
||||
* @property {FullData} data - 原神战绩数据
|
||||
* @return Response
|
||||
*/
|
||||
type Response = TGApp.BBS.Response.BaseWithData<FullData>;
|
||||
|
||||
@@ -27,7 +26,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @property {Array<Home>} homes - 尘歌壶信息
|
||||
* @property {string} query_tool_link - 查询工具链接
|
||||
* @property {string} query_tool_image - 查询工具图片
|
||||
* @return FullData
|
||||
*/
|
||||
type FullData = {
|
||||
role: Role;
|
||||
@@ -49,7 +47,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @property {string} region - 区域
|
||||
* @property {number} level - 等级
|
||||
* @property {string} game_head_icon - 游戏头像
|
||||
* @return Role
|
||||
*/
|
||||
type Role = {
|
||||
AvatarUrl: string;
|
||||
@@ -75,7 +72,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @property {boolean} is_chosen - 角色是否展示
|
||||
* @property {unknown} weapon - 角色武器 // null
|
||||
* @property {Array<unknown>} relics - 角色圣遗物 // []
|
||||
* @return Avatar
|
||||
*/
|
||||
type Avatar = {
|
||||
id: number;
|
||||
@@ -95,51 +91,53 @@ declare namespace TGApp.Game.Record {
|
||||
/**
|
||||
* @description 统计信息类型
|
||||
* @interface Stats
|
||||
* @since Beta v0.8.0
|
||||
* @property {number} active_day_number - 活跃天数
|
||||
* @since Beta v0.8.1
|
||||
* @property {number} achievement_number - 成就数量
|
||||
* @property {number} active_day_number - 活跃天数
|
||||
* @property {number} anemoculus_number - 风神瞳数量
|
||||
* @property {number} geoculus_number - 岩神瞳数量
|
||||
* @property {number} avatar_number - 角色数量
|
||||
* @property {number} way_point_number - 解锁传送点数量
|
||||
* @property {number} domain_number - 解锁秘境数量
|
||||
* @property {string} spiral_abyss - 深境螺旋最深达到几层
|
||||
* @property {number} precious_chest_number - 珍贵宝箱数量
|
||||
* @property {number} luxurious_chest_number - 豪华宝箱数量
|
||||
* @property {number} exquisite_chest_number - 精致宝箱数量
|
||||
* @property {number} common_chest_number - 普通宝箱数量
|
||||
* @property {number} electroculus_number - 雷神瞳数量
|
||||
* @property {number} magic_chest_number - 奇馈宝箱数量
|
||||
* @property {number} dendroculus_number - 草神瞳数量
|
||||
* @property {number} hydroculus_number - 水神瞳数量
|
||||
* @property {number} pyroculus_number - 火神瞳数量
|
||||
* @property {number} domain_number - 解锁秘境数量
|
||||
* @property {number} electroculus_number - 雷神瞳数量
|
||||
* @property {number} exquisite_chest_number - 精致宝箱数量
|
||||
* @property {unknown} field_ext_map - 数据对应链接的map,用不到设为 unknown
|
||||
* @property {CombatStats} role_combat - 幻想真境剧诗数据
|
||||
* @property {number} full_fetter_avatar_num - 满好感角色数
|
||||
* @property {number} geoculus_number - 岩神瞳数量
|
||||
* @property {ChallengeStats} hard_challenge - 幽境危战挑战数据
|
||||
* @property {number} hydroculus_number - 水神瞳数量
|
||||
* @property {number} luxurious_chest_number - 豪华宝箱数量
|
||||
* @property {number} magic_chest_number - 奇馈宝箱数量
|
||||
* @property {number} moonoculus_number - 月神瞳数量
|
||||
* @property {number} precious_chest_number - 珍贵宝箱数量
|
||||
* @property {number} pyroculus_number - 火神瞳数量
|
||||
* @property {CombatStats} role_combat - 幻想真境剧诗数据
|
||||
* @property {string} spiral_abyss - 深境螺旋最深达到几层
|
||||
* @property {number} way_point_number - 解锁传送点数量
|
||||
*/
|
||||
type Stats = {
|
||||
active_day_number: number;
|
||||
achievement_number: number;
|
||||
active_day_number: number;
|
||||
anemoculus_number: number;
|
||||
geoculus_number: number;
|
||||
avatar_number: number;
|
||||
way_point_number: number;
|
||||
domain_number: number;
|
||||
spiral_abyss: string;
|
||||
precious_chest_number: number;
|
||||
luxurious_chest_number: number;
|
||||
exquisite_chest_number: number;
|
||||
common_chest_number: number;
|
||||
electroculus_number: number;
|
||||
magic_chest_number: number;
|
||||
dendroculus_number: number;
|
||||
hydroculus_number: number;
|
||||
pyroculus_number: number;
|
||||
domain_number: number;
|
||||
electroculus_number: number;
|
||||
exquisite_chest_number: number;
|
||||
field_ext_map: unknown;
|
||||
role_combat: CombatStats;
|
||||
full_fetter_avatar_num: number;
|
||||
geoculus_number: number;
|
||||
hard_challenge: ChallengeStats;
|
||||
hydroculus_number: number;
|
||||
luxurious_chest_number: number;
|
||||
magic_chest_number: number;
|
||||
moonoculus_number: number;
|
||||
precious_chest_number: number;
|
||||
pyroculus_number: number;
|
||||
role_combat: CombatStats;
|
||||
spiral_abyss: string;
|
||||
way_point_number: number;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -150,7 +148,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @property {number} max_round_id - 最大报幕数
|
||||
* @property {boolean} has_data - 是否有数据
|
||||
* @property {boolean} has_detail_data - 是否有详细数据
|
||||
* @return CombatStats
|
||||
*/
|
||||
type CombatStats = {
|
||||
is_unlock: boolean;
|
||||
@@ -200,7 +197,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @property {number} seven_status_level - 七天神像等级
|
||||
* @property {NataReputation[] | null} nata_reputation - 纳塔声望
|
||||
* @property {number} world_type - 世界类型
|
||||
* @return WorldExplore
|
||||
*/
|
||||
type WorldExplore = {
|
||||
level: number;
|
||||
@@ -233,7 +229,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @property {string} name - 名称
|
||||
* @property {number} level - 等级
|
||||
* @property {string} icon - 图标
|
||||
* @return WorldOffering
|
||||
*/
|
||||
type WorldOffering = { name: string; level: number; icon: string };
|
||||
|
||||
@@ -242,7 +237,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @interface NataReputation
|
||||
* @since Beta v0.7.2
|
||||
* @property {Array<NataOffering>} tribal_list - 部落列表
|
||||
* @returns NataReputation
|
||||
*/
|
||||
type NataReputation = { tribal_list: Array<NataOffering> };
|
||||
|
||||
@@ -252,7 +246,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @extends WorldOffering
|
||||
* @property {number} id - ID
|
||||
* @property {string} image - 图片
|
||||
* @returns NataOffering
|
||||
*/
|
||||
type NataOffering = WorldOffering & { id: number; image: string };
|
||||
|
||||
@@ -268,7 +261,6 @@ declare namespace TGApp.Game.Record {
|
||||
* @property {string} icon - 图标
|
||||
* @property {string} comfort_level_name - 洞天仙力等级名称
|
||||
* @property {string} comfort_level_icon - 洞天仙力等级图标
|
||||
* @return Home
|
||||
*/
|
||||
type Home = {
|
||||
level: number;
|
||||
|
||||
19
src/types/Sqlite/Record.d.ts
vendored
19
src/types/Sqlite/Record.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file types/Sqlite/Record.d.ts
|
||||
* @description Sqlite 原神战绩相关类型定义文件
|
||||
* @since Beta v0.8.0
|
||||
* @since Beta v0.8.1
|
||||
*/
|
||||
|
||||
declare namespace TGApp.Sqlite.Record {
|
||||
@@ -16,7 +16,6 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {string} worldExplore - 世界探索信息
|
||||
* @property {string} homes - 尘歌壶信息
|
||||
* @property {string} updated - 更新时间
|
||||
* @return SingleTable
|
||||
*/
|
||||
type SingleTable = {
|
||||
uid: number;
|
||||
@@ -39,7 +38,6 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {WorldExplore[]} worldExplore - 世界探索信息
|
||||
* @property {Home[]} homes - 尘歌壶信息
|
||||
* @property {string} updated - 更新时间
|
||||
* @returns RenderData
|
||||
*/
|
||||
type RenderData = {
|
||||
uid: number;
|
||||
@@ -59,7 +57,6 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {string} region - 区域
|
||||
* @property {number} level - 等级
|
||||
* @property {string} avatar - 头像
|
||||
* @return Role
|
||||
*/
|
||||
type Role = { nickname: string; region: string; level: number; avatar: string };
|
||||
|
||||
@@ -75,7 +72,6 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {number} star - 角色星级
|
||||
* @property {number} constellation - 角色命座
|
||||
* @property {boolean} isShow - 角色是否展示
|
||||
* @return Avatar
|
||||
*/
|
||||
type Avatar = {
|
||||
id: number;
|
||||
@@ -91,7 +87,7 @@ declare namespace TGApp.Sqlite.Record {
|
||||
/**
|
||||
* @description 统计信息类型
|
||||
* @interface Stats
|
||||
* @since Beta v0.8.0
|
||||
* @since Beta v0.8.1
|
||||
* @property {number} activeDays - 活跃天数
|
||||
* @property {number} achievementNumber - 成就达成数
|
||||
* @property {number} avatarNumber - 获得角色数
|
||||
@@ -104,6 +100,7 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {number} dendroCulus - 草神瞳数
|
||||
* @property {number} hydroCulus - 水神瞳数
|
||||
* @property {number} pyroCulus - 火神瞳数
|
||||
* @property {number} moonCulus - 月神瞳数
|
||||
* @property {string} sprialAbyss - 深境螺旋信息
|
||||
* @property {string} combatRole - 幻想真境剧诗
|
||||
* @property {string} hardChallenge - 幽境危战挑战
|
||||
@@ -112,7 +109,6 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {number} exquisiteChest - 精致宝箱数
|
||||
* @property {number} commonChest - 普通宝箱数
|
||||
* @property {number} magicChest - 奇馈宝箱数
|
||||
* @return Stats
|
||||
*/
|
||||
type Stats = {
|
||||
activeDays: number;
|
||||
@@ -127,6 +123,7 @@ declare namespace TGApp.Sqlite.Record {
|
||||
dendroCulus: number;
|
||||
hydroCulus: number;
|
||||
pyroCulus: number;
|
||||
moonCulus: number;
|
||||
sprialAbyss: string;
|
||||
combatRole: string;
|
||||
hardChallenge: string;
|
||||
@@ -149,8 +146,7 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {number} reputation - 地区声望等级
|
||||
* @property {WorldOffering} offering - 地区供奉信息
|
||||
* @property {number} exploration - 地区探索进度
|
||||
* @property {WorldChild[]} children - 子地区
|
||||
* @return WorldExplore
|
||||
* @property {Array<WorldChild>} children - 子地区
|
||||
*/
|
||||
type WorldExplore = {
|
||||
id: number;
|
||||
@@ -162,7 +158,7 @@ declare namespace TGApp.Sqlite.Record {
|
||||
reputation?: number;
|
||||
offering?: WorldOffering;
|
||||
exploration: number;
|
||||
children: WorldChild[];
|
||||
children: Array<WorldChild>;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -172,7 +168,6 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {string} name - 名称
|
||||
* @property {number} level - 等级
|
||||
* @property {string} icon - 图标
|
||||
* @return WorldOffering
|
||||
*/
|
||||
type WorldOffering = { name: string; level: number; icon: string };
|
||||
|
||||
@@ -183,7 +178,6 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {number} id - 子地区 ID
|
||||
* @property {string} name - 子地区名称
|
||||
* @property {number} exploration - 子地区探索进度
|
||||
* @return WorldChild
|
||||
*/
|
||||
type WorldChild = { id: number; name: string; exploration: number };
|
||||
|
||||
@@ -199,7 +193,6 @@ declare namespace TGApp.Sqlite.Record {
|
||||
* @property {number} furniture - 获得摆设数
|
||||
* @property {number} visit - ;历史访客数
|
||||
* @property {string} bg - 背景
|
||||
* @return Home
|
||||
*/
|
||||
type Home = {
|
||||
comfortIcon: string;
|
||||
|
||||
Reference in New Issue
Block a user