mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-16 04:03:17 +08:00
💄 深境螺旋UI迭代
This commit is contained in:
BIN
public/icon/star/abyss0.webp
Normal file
BIN
public/icon/star/abyss0.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/icon/star/abyss1.webp
Normal file
BIN
public/icon/star/abyss1.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -1,25 +1,38 @@
|
||||
<!-- 战斗组件 -->
|
||||
<template>
|
||||
<div class="tud-db-box">
|
||||
<div class="tud-db-time">{{ props.title }} {{ props.modelValue.time }}</div>
|
||||
<div class="tud-db-icons-grid">
|
||||
<div class="tua-db-box">
|
||||
<div class="tua-db-time">{{ props.title }} {{ props.battle.time }}</div>
|
||||
<div v-if="props.battle.monsters && props.battle.monsters.length > 0" class="tua-db-monsters">
|
||||
<div v-for="(monster, idx) in props.battle.monsters" :key="idx" class="tua-db-monster">
|
||||
<div class="icon">
|
||||
<TMiImg :ori="true" :src="monster.icon" alt="icon" />
|
||||
</div>
|
||||
<div class="info">
|
||||
<span>{{ monster.name }}</span>
|
||||
<span>Lv.{{ monster.level }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tua-db-grid">
|
||||
<TItemBox
|
||||
v-for="avatar in props.modelValue.characters"
|
||||
v-for="avatar in props.battle.characters"
|
||||
:key="avatar.id"
|
||||
:model-value="getBoxData(avatar)"
|
||||
:model-value="getAvatarBox(avatar)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import TItemBox, { type TItemBoxData } from "@comp/app/t-itemBox.vue";
|
||||
import TMiImg from "@comp/app/t-mi-img.vue";
|
||||
|
||||
import { AppCharacterData } from "@/data/index.js";
|
||||
|
||||
type TuaDetailBattleProps = { title: string; modelValue: TGApp.Sqlite.Abyss.Battle };
|
||||
type TuaDetailBattleProps = { title: string; battle: TGApp.Sqlite.Abyss.Battle };
|
||||
|
||||
const props = defineProps<TuaDetailBattleProps>();
|
||||
|
||||
function getBoxData(avatar: TGApp.Sqlite.Abyss.CharacterInfo): TItemBoxData {
|
||||
function getAvatarBox(avatar: TGApp.Sqlite.Abyss.CharacterInfo): TItemBoxData {
|
||||
const res = AppCharacterData.find((i) => i.id === avatar.id);
|
||||
if (avatar.id === 10000005 || avatar.id === 10000007) {
|
||||
return {
|
||||
@@ -49,18 +62,80 @@ function getBoxData(avatar: TGApp.Sqlite.Abyss.CharacterInfo): TItemBoxData {
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.tud-db-icons-grid {
|
||||
<style lang="scss" scoped>
|
||||
.tua-db-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
row-gap: 4px;
|
||||
}
|
||||
|
||||
.tua-db-time {
|
||||
color: var(--box-text-2);
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.tua-db-grid {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.tud-db-time {
|
||||
color: var(--box-text-1);
|
||||
font-size: 12px;
|
||||
opacity: 0.6;
|
||||
text-align: left;
|
||||
.tua-db-monsters {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-wrap: wrap-reverse;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.tua-db-monster {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 4px 12px 4px 4px;
|
||||
border-radius: 40px;
|
||||
background: var(--box-bg-3);
|
||||
color: var(--box-text-4);
|
||||
column-gap: 4px;
|
||||
|
||||
.icon {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
background: var(--box-bg-4);
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
font-size: 12px;
|
||||
|
||||
span {
|
||||
line-height: 14px;
|
||||
|
||||
&:first-child {
|
||||
font-family: var(--font-title);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,40 +1,78 @@
|
||||
<!-- 关卡组件 -->
|
||||
<template>
|
||||
<div class="tua-dl-box">
|
||||
<TuaDetailTitle
|
||||
:val="props.modelValue.winStar"
|
||||
:name="`第${props.modelValue.id}间`"
|
||||
mode="level"
|
||||
/>
|
||||
<TuaDetailBattle
|
||||
v-if="props.modelValue.upBattle"
|
||||
title="上半"
|
||||
:model-value="props.modelValue.upBattle"
|
||||
/>
|
||||
<TuaDetailBattle
|
||||
v-if="props.modelValue.downBattle"
|
||||
title="下半"
|
||||
:model-value="props.modelValue.downBattle"
|
||||
/>
|
||||
<div class="tua-dl-title">
|
||||
<div class="title">第{{ props.level.id }}间</div>
|
||||
<div class="star">
|
||||
<img
|
||||
v-for="(i, idx) in genStarList()"
|
||||
:key="idx"
|
||||
:src="`/icon/star/abyss${i}.webp`"
|
||||
alt="icon"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<TuaDetailBattle v-if="props.level.upBattle" :battle="props.level.upBattle" title="上半" />
|
||||
<TuaDetailBattle v-if="props.level.downBattle" :battle="props.level.downBattle" title="下半" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import TuaDetailBattle from "./tua-detail-battle.vue";
|
||||
import TuaDetailTitle from "./tua-detail-title.vue";
|
||||
|
||||
type TuaDetailLevelProps = { modelValue: TGApp.Sqlite.Abyss.Level };
|
||||
type TuaDetailLevelProps = { level: TGApp.Sqlite.Abyss.Level };
|
||||
|
||||
const props = defineProps<TuaDetailLevelProps>();
|
||||
|
||||
function genStarList(): Array<number> {
|
||||
const arr: Array<number> = [];
|
||||
for (let i = 0; i < props.level.maxStar; i++) {
|
||||
if (i < props.level.winStar) arr.push(1);
|
||||
else arr.push(0);
|
||||
}
|
||||
return arr.reverse();
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.tua-dl-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 8px;
|
||||
border: 1px solid var(--common-shadow-1);
|
||||
border-radius: 4px;
|
||||
margin-top: 8px;
|
||||
background: var(--box-bg-2);
|
||||
gap: 8px;
|
||||
row-gap: 8px;
|
||||
}
|
||||
|
||||
.tua-dl-title {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
column-gap: 12px;
|
||||
|
||||
.title {
|
||||
color: var(--box-text-4);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.star {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
column-gap: 4px;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 2px;
|
||||
border-radius: 50%;
|
||||
background: #2c313c;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<template>
|
||||
<div class="tud-t-box">
|
||||
<div class="tud-t-title">
|
||||
<slot name="title">{{ props.name }}</slot>
|
||||
</div>
|
||||
<div class="tud-t-val">
|
||||
<img src="/icon/star/Abyss.webp" alt="Abyss" />
|
||||
<slot name="val">{{ props.val }}</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
type TuaDetailTitleProps = { name: string; val: number; mode: "floor" | "level" };
|
||||
|
||||
const props = defineProps<TuaDetailTitleProps>();
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.tud-t-box {
|
||||
display: flex;
|
||||
height: 30px;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid var(--common-shadow-4);
|
||||
font-family: v-bind("props.mode === 'level' ? 'var(--font-text)' : 'var(--font-title)'");
|
||||
}
|
||||
|
||||
.tud-t-title {
|
||||
color: var(--box-text-4);
|
||||
font-size: v-bind("props.mode === 'level' ? '18px' : '20px'");
|
||||
}
|
||||
|
||||
.tud-t-val {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--tgc-yellow-1);
|
||||
font-family: var(--font-title);
|
||||
font-size: v-bind("props.mode === 'level' ? '18px' : '20px'");
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.tud-t-val img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 1px;
|
||||
filter: invert(22%) sepia(7%) saturate(1241%) hue-rotate(182deg) brightness(95%) contrast(99%);
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.dark .tud-t-val img {
|
||||
filter: none;
|
||||
}
|
||||
</style>
|
||||
@@ -1,38 +1,89 @@
|
||||
<!-- 楼层组件 -->
|
||||
<template>
|
||||
<div class="tuad-box">
|
||||
<TuaDetailTitle
|
||||
:val="props.modelValue.winStar"
|
||||
:name="`第${props.modelValue.id}层`"
|
||||
mode="floor"
|
||||
/>
|
||||
<div class="tuad-title">
|
||||
<div class="title">第{{ props.floor.id }}层</div>
|
||||
<div class="append">
|
||||
<span>{{ props.floor.winStar }}</span>
|
||||
<span>/{{ props.floor.maxStar }}</span>
|
||||
<img alt="Abyss" src="/icon/star/Abyss.webp" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="props.floor.buff && props.floor.buff.length > 0" class="tuad-buff">
|
||||
<span>地脉异常:</span>
|
||||
<span v-for="(b, i) in props.floor.buff" :key="i">{{ b }}</span>
|
||||
</div>
|
||||
<div class="tuad-index-box">
|
||||
<TuaDetailLevel
|
||||
v-for="level in props.modelValue.levels"
|
||||
:key="level.id"
|
||||
:model-value="level"
|
||||
/>
|
||||
<TuaDetailLevel v-for="level in props.floor.levels" :key="level.id" :level />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import TuaDetailLevel from "./tua-detail-level.vue";
|
||||
import TuaDetailTitle from "./tua-detail-title.vue";
|
||||
|
||||
type TuaDetailProps = { modelValue: TGApp.Sqlite.Abyss.Floor };
|
||||
type TuaDetailProps = { floor: TGApp.Sqlite.Abyss.Floor };
|
||||
|
||||
const props = defineProps<TuaDetailProps>();
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.tuad-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
background: var(--box-bg-1);
|
||||
row-gap: 4px;
|
||||
}
|
||||
|
||||
.tuad-title {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 4px;
|
||||
border-bottom: 1px solid var(--common-shadow-4);
|
||||
font-size: 20px;
|
||||
line-height: 24px;
|
||||
|
||||
.append {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
column-gap: 4px;
|
||||
|
||||
span:first-child {
|
||||
color: var(--tgc-od-orange);
|
||||
font-family: var(--font-title);
|
||||
}
|
||||
|
||||
img {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
padding: 2px;
|
||||
border-radius: 50%;
|
||||
background: #2c313c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tuad-buff {
|
||||
position: relative;
|
||||
margin-left: auto;
|
||||
color: var(--box-text-1);
|
||||
font-size: 14px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.tuad-index-box {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
grid-gap: 8px;
|
||||
gap: 8px;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<!-- 概览 -->
|
||||
<template>
|
||||
<div class="tuao-box">
|
||||
<div class="tuao-title">
|
||||
@@ -23,15 +24,19 @@ import TItemBox, { type TItemBoxData } from "@comp/app/t-itemBox.vue";
|
||||
import { AppCharacterData } from "@/data/index.js";
|
||||
|
||||
type TAOProps = {
|
||||
/** 标题 */
|
||||
title: string;
|
||||
/**值文本 */
|
||||
valText?: string | number;
|
||||
valIcons?: Array<TGApp.Sqlite.Abyss.Character>;
|
||||
/** 值图标 */
|
||||
valIcons?: Array<TGApp.Sqlite.Abyss.CharacterData>;
|
||||
/* 是否多个 */
|
||||
multi4?: boolean;
|
||||
};
|
||||
|
||||
const props = defineProps<TAOProps>();
|
||||
|
||||
function getBoxData(avatar: TGApp.Sqlite.Abyss.Character): TItemBoxData {
|
||||
function getBoxData(avatar: TGApp.Sqlite.Abyss.CharacterData): TItemBoxData {
|
||||
const res = AppCharacterData.find((a) => a.id === avatar.id);
|
||||
return {
|
||||
height: "80px",
|
||||
@@ -42,6 +47,7 @@ function getBoxData(avatar: TGApp.Sqlite.Abyss.Character): TItemBoxData {
|
||||
lt: `/icon/element/${res?.element ?? "风"}元素.webp`,
|
||||
innerText: avatar.value.toString(),
|
||||
display: "inner",
|
||||
innerBlur: "5px",
|
||||
size: "80px",
|
||||
innerHeight: 20,
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="tuc-ae-flex">
|
||||
<div v-for="(enemy, idx) in props.enemies" :key="idx" class="tuc-enemy">
|
||||
<div class="tuc-enemy-icon">
|
||||
<img :src="enemy.icon" alt="icon" />
|
||||
<TMiImg :ori="true" :src="enemy.icon" alt="icon" />
|
||||
</div>
|
||||
<div class="tuc-enemy-info">
|
||||
<span>{{ enemy.name }}</span>
|
||||
@@ -29,6 +29,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import TItembox, { type TItemBoxData } from "@comp/app/t-itemBox.vue";
|
||||
import TMiImg from "@comp/app/t-mi-img.vue";
|
||||
import { getWikiBrief, getZhElement } from "@utils/toolFunc.js";
|
||||
|
||||
type TucAeBoxProps = {
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<TuaOverview title="元素爆发" :val-icons="item.energySkillRank" />
|
||||
</div>
|
||||
<div class="uaw-d-box">
|
||||
<TuaDetail v-for="floor in item.floors" :key="floor.id" :model-value="floor" />
|
||||
<TuaDetail v-for="floor in item.floors" :key="floor.id" :floor />
|
||||
</div>
|
||||
</div>
|
||||
</v-window-item>
|
||||
@@ -178,6 +178,7 @@ async function refreshAbyss(): Promise<void> {
|
||||
await TGLogger.Info("[UserAbyss][getAbyssData] 更新深渊数据");
|
||||
await showLoading.start(`正在获取${account.value.gameUid}的深渊数据`, "正在获取上期数据");
|
||||
const resP = await recordReq.spiralAbyss(cookie.value, account.value, "2");
|
||||
console.log(resP);
|
||||
if ("retcode" in resP) {
|
||||
await showLoading.end();
|
||||
showSnackbar.error(`[${resP.retcode}]${resP.message}`);
|
||||
@@ -192,6 +193,7 @@ async function refreshAbyss(): Promise<void> {
|
||||
await TSUserAbyss.saveAbyss(account.value.gameUid, resP);
|
||||
await showLoading.update("正在获取本期深渊数据");
|
||||
const res = await recordReq.spiralAbyss(cookie.value, account.value, "1");
|
||||
console.log(res);
|
||||
if ("retcode" in res) {
|
||||
await showLoading.end();
|
||||
showSnackbar.error(`[${res.retcode}]${res.message}`);
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
/**
|
||||
* @file plugins/Sqlite/utils/transCharacter.ts
|
||||
* @description Sqlite 数据转换
|
||||
* @since Beta v0.6.0
|
||||
* 深境螺旋数据转换
|
||||
* @since Beta v0.9.0
|
||||
*/
|
||||
|
||||
import { timestampToDate } from "@utils/toolFunc.js";
|
||||
|
||||
/**
|
||||
* @description 将通过 api 获取到的深渊数据转换为数据库中的数据
|
||||
* 转换角色数据
|
||||
* @since Alpha v0.2.0
|
||||
* @param {TGApp.Game.Abyss.CharacterData[]} data 深渊数据
|
||||
* @returns {string} 转换后的深渊数据
|
||||
* @param {Array<TGApp.Game.Abyss.CharacterData>} data 接口获取角色数据
|
||||
* @returns {string} 转换后的角色数据
|
||||
*/
|
||||
export function transCharacterData(data: TGApp.Game.Abyss.CharacterData[]): string {
|
||||
const res: TGApp.Sqlite.Abyss.Character[] = data.map((item) => ({
|
||||
export function transCharacterData(data: Array<TGApp.Game.Abyss.CharacterData>): string {
|
||||
const res: Array<TGApp.Sqlite.Abyss.CharacterData> = data.map((item) => ({
|
||||
id: item.avatar_id,
|
||||
value: item.value,
|
||||
star: item.rarity,
|
||||
@@ -22,27 +21,28 @@ export function transCharacterData(data: TGApp.Game.Abyss.CharacterData[]): stri
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 将通过 api 获取到的深渊数据转换为数据库中的数据
|
||||
* @since Beta v0.3.9
|
||||
* @param {TGApp.Game.Abyss.Floor} data 深渊数据
|
||||
* @returns {string} 转换后的深渊数据
|
||||
* 转换楼层数据
|
||||
* @since Beta v0.9.0
|
||||
* @param {Array<TGApp.Game.Abyss.Floor>} data 接口获取楼层数据
|
||||
* @returns {string} 转换后的楼层数据
|
||||
*/
|
||||
export function transFloorData(data: TGApp.Game.Abyss.Floor[]): string {
|
||||
export function transFloorData(data: Array<TGApp.Game.Abyss.Floor>): string {
|
||||
const floor: TGApp.Sqlite.Abyss.Floor[] = data.map((item) => ({
|
||||
id: item.index,
|
||||
winStar: item.star,
|
||||
maxStar: item.max_star,
|
||||
isUnlock: item.is_unlock ? 1 : 0,
|
||||
levels: item.levels.map((level) => transLevelData(level)),
|
||||
levels: item.levels.map(transLevelData),
|
||||
buff: item.ley_line_disorder,
|
||||
}));
|
||||
return JSON.stringify(floor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 将通过 api 获取到的深渊数据转换为数据库中的数据
|
||||
* @since Beta v0.3.9
|
||||
* @param {TGApp.Game.Abyss.Level} data 深渊数据
|
||||
* @returns {TGApp.Sqlite.Abyss.Level} 转换后的深渊数据
|
||||
* 转换关卡数据
|
||||
* @since Beta v0.9.0
|
||||
* @param {TGApp.Game.Abyss.Level} data 接口获取关卡数据
|
||||
* @returns {TGApp.Sqlite.Abyss.Level} 转换后的关卡数据
|
||||
*/
|
||||
function transLevelData(data: TGApp.Game.Abyss.Level): TGApp.Sqlite.Abyss.Level {
|
||||
const res: TGApp.Sqlite.Abyss.Level = {
|
||||
@@ -51,19 +51,23 @@ function transLevelData(data: TGApp.Game.Abyss.Level): TGApp.Sqlite.Abyss.Level
|
||||
maxStar: data.max_star,
|
||||
};
|
||||
for (const battle of data.battles) {
|
||||
if (battle.index === 1) res.upBattle = transBattleData(battle);
|
||||
else res.downBattle = transBattleData(battle);
|
||||
if (battle.index === 1) res.upBattle = transBattleData(battle, data.top_half_floor_monster);
|
||||
else res.downBattle = transBattleData(battle, data.bottom_half_floor_monster);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 将通过 api 获取到的深渊数据转换为数据库中的数据
|
||||
* @since Beta v0.6.0
|
||||
* @param {TGApp.Game.Abyss.Battle} data 深渊数据
|
||||
* 转换战斗数据
|
||||
* @since Beta v0.9.0
|
||||
* @param {TGApp.Game.Abyss.Battle} data 接口获取战斗数据
|
||||
* @param {Array<TGApp.Game.Abyss.MonsterInfo>} monsters 对应战斗怪物数据
|
||||
* @returns {TGApp.Sqlite.Abyss.Battle} 转换后的深渊数据
|
||||
*/
|
||||
function transBattleData(data: TGApp.Game.Abyss.Battle): TGApp.Sqlite.Abyss.Battle {
|
||||
function transBattleData(
|
||||
data: TGApp.Game.Abyss.Battle,
|
||||
monsters: Array<TGApp.Sqlite.Abyss.MonsterInfo>,
|
||||
): TGApp.Sqlite.Abyss.Battle {
|
||||
return {
|
||||
time: timestampToDate(Number(data.timestamp) * 1000),
|
||||
characters: data.avatars.map((item) => ({
|
||||
@@ -71,5 +75,6 @@ function transBattleData(data: TGApp.Game.Abyss.Battle): TGApp.Sqlite.Abyss.Batt
|
||||
level: item.level,
|
||||
star: item.rarity,
|
||||
})),
|
||||
monsters: monsters,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* @file request/recordReq.ts
|
||||
* @description TakumiRecordGenshinApi 相关请求
|
||||
* TakumiRecordGenshinApi 相关请求
|
||||
* @since Beta v0.8.0
|
||||
*/
|
||||
|
||||
@@ -107,7 +106,7 @@ async function roleCombat(
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取深渊螺旋记录
|
||||
* 获取深渊螺旋记录
|
||||
* @since Beta v0.6.3
|
||||
* @param {TGApp.App.Account.Cookie} cookie Cookie
|
||||
* @param {TGApp.Sqlite.Account.Game} user 用户
|
||||
|
||||
2
src/types/Game/Abyss.d.ts
vendored
2
src/types/Game/Abyss.d.ts
vendored
@@ -94,7 +94,7 @@ declare namespace TGApp.Game.Abyss {
|
||||
* @remarks 一般为 null
|
||||
*/
|
||||
settle_date_time: TGApp.Game.Base.DateTime | null;
|
||||
/** 关卡Buff */
|
||||
/** 地脉异常 */
|
||||
ley_line_disorder: Array<string>;
|
||||
};
|
||||
|
||||
|
||||
273
src/types/Sqlite/Abyss.d.ts
vendored
273
src/types/Sqlite/Abyss.d.ts
vendored
@@ -1,180 +1,217 @@
|
||||
/**
|
||||
* @file types/Sqlite/Abyss.d.ts
|
||||
* @description 数据库深境螺旋相关类型定义文件
|
||||
* @since Beta v0.6.3
|
||||
* 深境螺旋数据库
|
||||
* @since Beta v0.9.0
|
||||
*/
|
||||
|
||||
declare namespace TGApp.Sqlite.Abyss {
|
||||
/**
|
||||
* @description 数据库-深境螺旋表
|
||||
* 深境螺旋表
|
||||
* @since Beta v0.6.1
|
||||
* @interface TableRaw
|
||||
* @property {string} uid - 用户 UID
|
||||
* @property {number} id - 深境螺旋 ID
|
||||
* @property {string} startTime - 开始时间
|
||||
* @property {string} endTime - 结束时间
|
||||
* @property {number} totalBattleTimes - 总战斗次数
|
||||
* @property {number} totalWinTimes - 总胜利次数
|
||||
* @property {string} maxFloor - 最深抵达
|
||||
* @property {number} totalStar - 总星数
|
||||
* @property {boolean} isUnlock - 是否解锁
|
||||
* @description 后面的几个数据在数据库中是存储的 JSON 字符串,需要在使用时进行 JSON.parse
|
||||
* @property {Character[]} revealRank - 出战次数
|
||||
* @property {Character[]} defeatRank - 最多击破数
|
||||
* @property {Character[]} damageRank - 最强一击
|
||||
* @property {Character[]} takeDamageRank - 承受最多伤害
|
||||
* @property {Character[]} normalSkillRank - 元素战技释放数
|
||||
* @property {Character[]} energySkillRank - 元素爆发次数
|
||||
* @property {Floor[]} floors - 深境螺旋各层数据
|
||||
* @property {string} skippedFloor - 跳过楼层
|
||||
* @property {string} updated - 更新时间
|
||||
* @return TableRaw
|
||||
*/
|
||||
interface TableRaw {
|
||||
type TableRaw = {
|
||||
/** 用户UID */
|
||||
uid: string;
|
||||
/** 深渊ID */
|
||||
id: number;
|
||||
/** 开始时间 */
|
||||
startTime: string;
|
||||
/** 结束时间 */
|
||||
endTime: string;
|
||||
/** 总战斗次数 */
|
||||
totalBattleTimes: number;
|
||||
/** 总胜利次数 */
|
||||
totalWinTimes: number;
|
||||
/** 最深抵达 */
|
||||
maxFloor: string;
|
||||
/** 总星数 */
|
||||
totalStar: number;
|
||||
/** 是否解锁
|
||||
* @remarks 0-未解锁,1-已解锁
|
||||
*/
|
||||
isUnlock: 0 | 1;
|
||||
revealRank: string; // Character[]
|
||||
defeatRank: string; // Character[]
|
||||
damageRank: string; // Character[]
|
||||
takeDamageRank: string; // Character[]
|
||||
normalSkillRank: string; // Character[]
|
||||
energySkillRank: string; // Character[]
|
||||
floors: string; // Floor[]
|
||||
skippedFloor: string;
|
||||
/**
|
||||
* 出战次数
|
||||
* @remarks 序列化,反序列化后是 Array<Character>
|
||||
*/
|
||||
revealRank: string;
|
||||
/**
|
||||
* 最多击败数
|
||||
* @remarks 序列化,反序列化后是 Array<Character>
|
||||
*/
|
||||
defeatRank: string;
|
||||
/**
|
||||
* 最强一击
|
||||
* @remarks 序列化,反序列化后是 Array<Character>
|
||||
*/
|
||||
damageRank: string;
|
||||
/**
|
||||
* 最多承伤
|
||||
* @remarks 序列化,反序列化后是 Array<Character>
|
||||
*/
|
||||
takeDamageRank: string;
|
||||
/**
|
||||
* 元素战技
|
||||
* @remarks 序列化,反序列化后是 Array<Character>
|
||||
*/
|
||||
normalSkillRank: string;
|
||||
/**
|
||||
* 元素爆发
|
||||
* @remarks 序列化,反序列化后是 Array<Character>
|
||||
*/
|
||||
energySkillRank: string;
|
||||
/**
|
||||
* 楼层数据
|
||||
* @remarks 序列化,反序列化后是 Array<Floor>
|
||||
*/
|
||||
floors: string;
|
||||
/** 跳过楼层 */
|
||||
skippedFloor: string | null;
|
||||
/** 更新时间 */
|
||||
updated: string;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @description 数据库-深境螺旋表
|
||||
* 深境螺旋表-解析
|
||||
* @since Beta v0.6.1
|
||||
* @interface TableData
|
||||
* @property {string} uid - 用户 UID
|
||||
* @property {number} id - 深境螺旋 ID
|
||||
* @property {string} startTime - 开始时间
|
||||
* @property {string} endTime - 结束时间
|
||||
* @property {number} totalBattleTimes - 总战斗次数
|
||||
* @property {number} totalWinTimes - 总胜利次数
|
||||
* @property {string} maxFloor - 最深抵达
|
||||
* @property {number} totalStar - 总星数
|
||||
* @property {boolean} isUnlock - 是否解锁
|
||||
* @description 后面的几个数据在数据库中是存储的 JSON 字符串,需要在使用时进行 JSON.parse
|
||||
* @property {Character[]} revealRank - 出战次数
|
||||
* @property {Character[]} defeatRank - 最多击破数
|
||||
* @property {Character[]} damageRank - 最强一击
|
||||
* @property {Character[]} takeDamageRank - 承受最多伤害
|
||||
* @property {Character[]} normalSkillRank - 元素战技释放数
|
||||
* @property {Character[]} energySkillRank - 元素爆发次数
|
||||
* @property {Floor[]} floors - 深境螺旋各层数据
|
||||
* @property {string} skippedFloor - 跳过楼层
|
||||
* @property {string} updated - 更新时间
|
||||
* @return TableData
|
||||
*/
|
||||
interface TableData {
|
||||
type TableData = {
|
||||
/** 用户UID */
|
||||
uid: string;
|
||||
/** 深渊ID */
|
||||
id: number;
|
||||
/** 开始时间 */
|
||||
startTime: string;
|
||||
/** 结束时间 */
|
||||
endTime: string;
|
||||
/** 总战斗次数 */
|
||||
totalBattleTimes: number;
|
||||
/** 总胜利次数 */
|
||||
totalWinTimes: number;
|
||||
/** 最深抵达 */
|
||||
maxFloor: string;
|
||||
/** 总星数 */
|
||||
totalStar: number;
|
||||
/** 是否解锁
|
||||
* @remarks 0-未解锁,1-已解锁
|
||||
*/
|
||||
isUnlock: 0 | 1;
|
||||
revealRank: Character[];
|
||||
defeatRank: Character[];
|
||||
damageRank: Character[];
|
||||
takeDamageRank: Character[];
|
||||
normalSkillRank: Character[];
|
||||
energySkillRank: Character[];
|
||||
floors: Floor[];
|
||||
skippedFloor: string;
|
||||
/** 出战次数 */
|
||||
revealRank: Array<CharacterData>;
|
||||
/** 最多击败数 */
|
||||
defeatRank: Array<CharacterData>;
|
||||
/** 最强一击 */
|
||||
damageRank: Array<CharacterData>;
|
||||
/** 最多承伤 */
|
||||
takeDamageRank: Array<CharacterData>;
|
||||
/** 元素战技 */
|
||||
normalSkillRank: Array<CharacterData>;
|
||||
/** 元素爆发 */
|
||||
energySkillRank: Array<CharacterData>;
|
||||
/** 楼层数据 */
|
||||
floors: Array<Floor>;
|
||||
/** 跳过楼层 */
|
||||
skippedFloor: string | null;
|
||||
/** 更新时间 */
|
||||
updated: string;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @description 数据库-深境螺旋表-角色数据
|
||||
* 角色数据
|
||||
* @since Alpha v0.2.0
|
||||
* @interface Character
|
||||
* @property {number} id - 角色 ID
|
||||
* @property {number} value - 值
|
||||
* @property {number} star - 星级
|
||||
* @return Character
|
||||
*/
|
||||
interface Character {
|
||||
type CharacterData = {
|
||||
/** 角色ID */
|
||||
id: number;
|
||||
/** 值 */
|
||||
value: number;
|
||||
/** 星级 */
|
||||
star: number;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @description 数据库-深境螺旋表-层数据
|
||||
* @since Alpha v0.2.0
|
||||
* @interface Floor
|
||||
* @property {number} id - 层 ID
|
||||
* @property {number} winStar - 获得星数
|
||||
* @property {number} maxStar - 最大星级
|
||||
* @property {boolean} isUnlock - 是否解锁
|
||||
* @property {Level[]} levels - 关卡数据
|
||||
* @return Floor
|
||||
* 楼层数据
|
||||
* @since Beta v0.9.0
|
||||
*/
|
||||
interface Floor {
|
||||
type Floor = {
|
||||
/** 楼层 */
|
||||
id: number;
|
||||
winStar: number;
|
||||
maxStar: number;
|
||||
/**
|
||||
* 是否解锁
|
||||
* @remarks 0-未解锁,1-已解锁
|
||||
*/
|
||||
isUnlock: 0 | 1;
|
||||
levels: Level[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 数据库-深境螺旋表-关卡数据
|
||||
* @since Beta v0.3.9
|
||||
* @interface Level
|
||||
* @property {number} id - 关卡 ID
|
||||
* @property {number} winStar - 获得星数
|
||||
* @property {number} maxStar - 最大星级
|
||||
* @property {Battle} upBattle - 上半场数据
|
||||
* @property {Battle} downBattle - 下半场数据
|
||||
* @return Level
|
||||
*/
|
||||
interface Level {
|
||||
id: number;
|
||||
/** 获得星数 */
|
||||
winStar: number;
|
||||
/** 最大星数 */
|
||||
maxStar: number;
|
||||
upBattle?: Battle;
|
||||
downBattle?: Battle;
|
||||
}
|
||||
/** 关卡数据 */
|
||||
levels: Array<Level>;
|
||||
/**
|
||||
* 地脉异常
|
||||
* @remarks v0.9.0新增,之前数据缺失
|
||||
*/
|
||||
buff?: Array<string>;
|
||||
};
|
||||
|
||||
/**
|
||||
* @description 数据库-深境螺旋表-战斗数据
|
||||
* @since Alpha v0.2.0
|
||||
* @interface Battle
|
||||
* 关卡数据
|
||||
* @since Beta v0.3.9
|
||||
*/
|
||||
type Level = {
|
||||
/** 关卡ID */
|
||||
id: number;
|
||||
/** 获得星数 */
|
||||
winStar: number;
|
||||
/** 最大星数 */
|
||||
maxStar: number;
|
||||
/** 上半场数据 */
|
||||
upBattle?: Battle;
|
||||
/** 下半场数据 */
|
||||
downBattle?: Battle;
|
||||
};
|
||||
|
||||
/**
|
||||
* 战斗数据
|
||||
* @since Beta v0.9.0
|
||||
* @property {string} time - 时间
|
||||
* @property {CharacterInfo[]} characters - 角色数据
|
||||
* @return Battle
|
||||
*/
|
||||
interface Battle {
|
||||
/** 结束时间 */
|
||||
time: string;
|
||||
characters: CharacterInfo[];
|
||||
/** 上场角色 */
|
||||
characters: Array<CharacterInfo>;
|
||||
/**
|
||||
* 怪物数据
|
||||
* @remarks v0.9.0 版本新增,之前数据缺失
|
||||
*/
|
||||
monsters?: Array<MonsterInfo>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 数据库-深境螺旋表-角色数据
|
||||
* 角色信息
|
||||
* @since Alpha v0.2.0
|
||||
* @interface CharacterInfo
|
||||
* @property {number} id - 角色 ID
|
||||
* @property {number} star - 星级
|
||||
* @property {number} level - 等级
|
||||
* @return CharacterInfo
|
||||
*/
|
||||
interface CharacterInfo {
|
||||
type CharacterInfo = {
|
||||
/** 角色ID */
|
||||
id: number;
|
||||
/** 角色等级 */
|
||||
level: number;
|
||||
/** 角色星级 */
|
||||
star: number;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 怪物信息
|
||||
* @since Beta v0.9.0
|
||||
*/
|
||||
type MonsterInfo = {
|
||||
/** 名称 */
|
||||
name: string;
|
||||
/** 图标 */
|
||||
icon: string;
|
||||
/** 等级 */
|
||||
level: number;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user