💄 战绩添加幽境危战数据

This commit is contained in:
BTMuli
2025-07-05 12:12:42 +08:00
parent f8f08cf048
commit ceeec4b4a4
5 changed files with 62 additions and 29 deletions

View File

@@ -7,7 +7,7 @@
<span>最佳记录</span>
<span>{{ props.data.best.second }}s</span>
<img
:title="getDiffTitle(props.data.best)"
:title="getHardChallengeDesc(props.data.best.difficulty)"
:src="`/icon/challenge/UI_LeyLineChallenge_Medal_${props.data.best.difficulty}.webp`"
alt="medal"
/>
@@ -21,30 +21,13 @@
</div>
</template>
<script lang="ts" setup>
import { getHardChallengeDesc } from "@Sql/utils/transUserRecord.js";
import TucChallengeItem from "./tuc-challenge-item.vue";
type TucOverviewProps = { title: string; data: TGApp.Game.Challenge.Challenge };
const props = defineProps<TucOverviewProps>();
function getDiffTitle(best: TGApp.Game.Challenge.ChallengeBest): string {
switch (best.difficulty) {
case 1:
return "普通";
case 2:
return "进阶";
case 3:
return "困难";
case 4:
return "险恶";
case 5:
return "无畏";
case 6:
return "绝境";
default:
return `难度${best.difficulty}`;
}
}
</script>
<style lang="scss" scoped>
.tuc-overview-comp {

View File

@@ -1,7 +1,7 @@
<template>
<div v-if="!modelValue">暂无数据</div>
<div v-else>
<div class="tur-og-box-3">
<div class="tur-og-box">
<TurOverviewSub
:text="modelValue.activeDays"
icon="/source/UI/userRecord.webp"
@@ -17,8 +17,11 @@
icon="/source/UI/userCombat.webp"
title="幻想真境剧诗"
/>
</div>
<div class="tur-og-box">
<TurOverviewSub
:text="modelValue.hardChallenge"
icon="/source/UI/userChallenge.webp"
title="幽境危战"
/>
<TurOverviewSub
:text="modelValue.avatarNumber"
icon="/source/UI/userAvatar.webp"

View File

@@ -62,9 +62,34 @@ function transAvatar(data: TGApp.Game.Record.Avatar): TGApp.Sqlite.Record.Avatar
};
}
/**
* @description 获取幽境危战难度描述
* @since Beta v0.8.0
* @param {number} difficulty 幽境危战难度
* @return {string} 幽境危战难度描述
*/
export function getHardChallengeDesc(difficulty: number): string {
switch (difficulty) {
case 1:
return "普通";
case 2:
return "进阶";
case 3:
return "困难";
case 4:
return "险恶";
case 5:
return "无畏";
case 6:
return "绝境";
default:
return `难度${difficulty}`;
}
}
/**
* @description 将统计信息转换为数据库中的数据
* @since Beta v0.6.0
* @since Beta v0.8.0
* @param {TGApp.Game.Record.Stats} data 统计信息
* @return {TGApp.Sqlite.Record.Stats } 转换后的统计信息
*/
@@ -84,6 +109,9 @@ function transStat(data: TGApp.Game.Record.Stats): TGApp.Sqlite.Record.Stats {
pyroCulus: data.pyroculus_number,
sprialAbyss: data.spiral_abyss,
combatRole: data.role_combat.is_unlock ? `${data.role_combat.max_round_id}` : "未解锁",
hardChallenge: data.hard_challenge.is_unlock
? `${data.hard_challenge.name}-${getHardChallengeDesc(data.hard_challenge.difficulty)}`
: "未解锁",
luxuriousChest: data.luxurious_chest_number,
preciousChest: data.precious_chest_number,
exquisiteChest: data.exquisite_chest_number,

View File

@@ -1,7 +1,7 @@
/**
* @file types/Game/Record.d.ts
* @description 原神战绩相关类型定义文件
* @since Beta v0.7.2
* @since Beta v0.8.0
*/
declare namespace TGApp.Game.Record {
@@ -95,7 +95,7 @@ declare namespace TGApp.Game.Record {
/**
* @description 统计信息类型
* @interface Stats
* @since Beta v0.5.5
* @since Beta v0.8.0
* @property {number} active_day_number - 活跃天数
* @property {number} achievement_number - 成就数量
* @property {number} anemoculus_number - 风神瞳数量
@@ -116,7 +116,7 @@ declare namespace TGApp.Game.Record {
* @property {unknown} field_ext_map - 数据对应链接的map用不到设为 unknown
* @property {CombatStats} role_combat - 幻想真境剧诗数据
* @property {number} full_fetter_avatar_num - 满好感角色数
* @return Stats
* @property {ChallengeStats} hard_challenge - 幽境危战挑战数据
*/
type Stats = {
active_day_number: number;
@@ -139,6 +139,7 @@ declare namespace TGApp.Game.Record {
field_ext_map: unknown;
role_combat: CombatStats;
full_fetter_avatar_num: number;
hard_challenge: ChallengeStats;
};
/**
@@ -158,6 +159,22 @@ declare namespace TGApp.Game.Record {
has_detail_data: boolean;
};
/**
* @description 幽境危战挑战数据类型
* @interface ChallengeStats
* @since Beta v0.8.0
* @property {boolean} is_unlock - 是否解锁
* @property {number} difficulty - 挑战难度
* @property {boolean} has_data - 是否有数据
* @property {string} name - 挑战名称
*/
type ChallengeStats = {
is_unlock: boolean;
difficulty: number;
has_data: boolean;
name: string;
};
/**
* @description 世界探索信息类型
* @interface WorldExplore

View File

@@ -1,7 +1,7 @@
/**
* @file types/Sqlite/Record.d.ts
* @description Sqlite 原神战绩相关类型定义文件
* @since Beta v0.7.2
* @since Beta v0.8.0
*/
declare namespace TGApp.Sqlite.Record {
@@ -91,7 +91,7 @@ declare namespace TGApp.Sqlite.Record {
/**
* @description 统计信息类型
* @interface Stats
* @since Beta v0.5.5
* @since Beta v0.8.0
* @property {number} activeDays - 活跃天数
* @property {number} achievementNumber - 成就达成数
* @property {number} avatarNumber - 获得角色数
@@ -106,6 +106,7 @@ declare namespace TGApp.Sqlite.Record {
* @property {number} pyroCulus - 火神瞳数
* @property {string} sprialAbyss - 深境螺旋信息
* @property {string} combatRole - 幻想真境剧诗
* @property {string} hardChallenge - 幽境危战挑战
* @property {number} luxuriousChest - 华丽宝箱数
* @property {number} preciousChest - 珍贵宝箱数
* @property {number} exquisiteChest - 精致宝箱数
@@ -128,6 +129,7 @@ declare namespace TGApp.Sqlite.Record {
pyroCulus: number;
sprialAbyss: string;
combatRole: string;
hardChallenge: string;
luxuriousChest: number;
preciousChest: number;
exquisiteChest: number;