👽️ 更新用户活动日历处理

This commit is contained in:
BTMuli
2025-12-11 17:23:54 +08:00
parent abe34b8ee5
commit 073cd5e35d
11 changed files with 349 additions and 209 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,20 +1,21 @@
<!-- 首页近期活动组件 -->
<template>
<THomeCard :append="isLogin">
<template #title>近期活动</template>
<template #title-append v-if="isLogin">
<v-switch class="tp-switch" v-model="isUserPos"></v-switch>
<template v-if="isLogin" #title-append>
<v-switch v-model="isUserPos" class="tp-switch"></v-switch>
<span>{{ isUserPos ? "用户" : "百科" }}</span>
</template>
<template #default>
<div class="tp-grid" v-show="!isUserPos">
<div v-show="!isUserPos" class="tp-grid">
<PhPosObc v-for="(card, index) in obsPos" :key="index" :pos="card" />
</div>
<div class="tp-grid" v-show="isUserPos">
<div v-show="isUserPos" class="tp-grid">
<PhPosUser
@click-m="handleMaterial"
v-for="(card, index) in userPos"
:key="index"
:pos="card"
@click-m="handleMaterial"
/>
</div>
</template>
@@ -34,7 +35,7 @@ import useUserStore from "@store/user.js";
import { openUrl } from "@tauri-apps/plugin-opener";
import TGLogger from "@utils/TGLogger.js";
import { storeToRefs } from "pinia";
import { onMounted, shallowRef, ref, watch } from "vue";
import { onMounted, ref, shallowRef, watch } from "vue";
import THomeCard from "./ph-comp-card.vue";
@@ -78,6 +79,7 @@ async function loadUserPosition(): Promise<void> {
}
if (isInit.value) await showLoading.start("正在获取近期活动");
const resp = await recordReq.actCalendar(cookie.value, account.value);
console.log(resp);
if (isInit.value) await showLoading.end();
if ("retcode" in resp) {
showSnackbar.error(`获取近期活动失败:[${resp.retcode}-${resp.message}`);

View File

@@ -1,18 +1,18 @@
<!-- 近期活动卡片组件用户-->
<template>
<div class="ph-pos-user-card" ref="posRef">
<div ref="posRef" class="ph-pos-user-card">
<div class="ph-puc-top">
<div class="title">
<v-icon title="已完成" color="var(--tgc-od-green)" v-if="props.pos.is_finished">
<v-icon v-if="props.pos.is_finished" color="var(--tgc-od-green)" title="已完成">
mdi-checkbox-marked-circle-outline
</v-icon>
<v-icon v-else title="未完成" color="var(--tgc-od-white)">mdi-circle</v-icon>
<span @click="sharePos()" title="点击分享">{{ props.pos.name }}</span>
<v-icon v-else color="var(--tgc-od-white)" title="未完成">mdi-circle</v-icon>
<span title="点击分享" @click="sharePos()">{{ props.pos.name }}</span>
</div>
<div class="subtitle">
<!-- 处理幽境危战 -->
<template v-if="props.pos.type === ActCalendarTypeEnum.HardChallenge">
<div class="challenge-append" @click="toChallenge()" title="点击前往幽境页面">
<div class="challenge-append" title="点击前往幽境页面" @click="toChallenge()">
<template v-if="!props.pos.hard_challenge_detail.is_unlock">
<span>未解锁</span>
</template>
@@ -20,22 +20,31 @@
<span>最佳记录</span>
<span>{{ props.pos.hard_challenge_detail.second }}s</span>
<img
:title="getHardChallengeDesc(props.pos.hard_challenge_detail.difficulty)"
:src="`/icon/challenge/UI_LeyLineChallenge_Medal_${props.pos.hard_challenge_detail.difficulty}.webp`"
:title="getHardChallengeDesc(props.pos.hard_challenge_detail.difficulty)"
alt="medal"
/>
<div
v-if="props.pos.hard_challenge_detail.sub.seconds > 0"
:title="`紊乱爆发期结束:${endHd}`"
class="challenge-sub"
>
<span>{{ props.pos.hard_challenge_detail.sub.x }}</span>
<span>/{{ props.pos.hard_challenge_detail.sub.y }}</span>
<img alt="sub" src="/icon/challenge/pos_sub.webp" />
</div>
</template>
</div>
</template>
<!-- 处理真境剧诗 -->
<template v-else-if="props.pos.type === ActCalendarTypeEnum.RoleCombat">
<div class="combat-append" @click="toCombat()" title="点击前往剧诗页面">
<div class="combat-append" title="点击前往剧诗页面" @click="toCombat()">
<span>{{ getCombatStat(props.pos.role_combat_detail) }}</span>
</div>
</template>
<!-- 处理深境螺旋 -->
<template v-else-if="props.pos.type === ActCalendarTypeEnum.Tower">
<div class="abyss-append" @click="toAbyss()" title="点击前往深渊页面">
<div class="abyss-append" title="点击前往深渊页面" @click="toAbyss()">
<template v-if="!props.pos.tower_detail.is_unlock">
<span>未解锁</span>
</template>
@@ -46,7 +55,7 @@
<span>
{{ props.pos.tower_detail.max_star }}/{{ props.pos.tower_detail.total_star }}
</span>
<img src="/icon/star/Abyss.webp" alt="abyss" />
<img alt="abyss" src="/icon/star/Abyss.webp" />
</template>
</div>
</template>
@@ -60,11 +69,24 @@
剩余双倍次数: {{ props.pos.double_detail.left }}/{{ props.pos.double_detail.total }}
</span>
</template>
<!-- 处理立本活动 TODO:待完善 -->
<template v-else-if="props.pos.type === ActCalendarTypeEnum.LiBen">
<span>当天{{ props.pos.liben_detail.status === 1 ? "未" : "已" }}兑换</span>
<span>{{ props.pos.liben_detail.progress }}/{{ props.pos.liben_detail.total }}</span>
<span>
{{ props.pos.liben_detail.is_has_taken_special_reward ? "已" : "未" }}领取礼盒
</span>
</template>
<!-- 处理累登活动 TODO:待完善 -->
<template v-else-if="props.pos.type === ActCalendarTypeEnum.SignIn">
<span>{{ props.pos.sign_in_detail.progress }}/{{ props.pos.sign_in_detail.total }}</span>
<span>当天{{ props.pos.sign_in_detail.status === 1 ? "未领取" : "已领取" }}</span>
</template>
</div>
</div>
<div class="ph-puc-duration">
<template v-if="isStart">
<span title="剩余时间" data-html2canvas-ignore>{{ stamp2LastTime(restTs * 1000) }}</span>
<span data-html2canvas-ignore title="剩余时间">{{ stamp2LastTime(restTs * 1000) }}</span>
<span title="活动时间">
{{ timestampToDate(Number(props.pos.start_timestamp) * 1000) }} ~
{{ timestampToDate(Number(props.pos.end_timestamp) * 1000) }}
@@ -74,16 +96,17 @@
<span>未开始</span>
</template>
</div>
<div class="ph-puc-desc">{{ props.pos.desc }}</div>
<div class="ph-puc-rewards">
<div
:title="`${reward.name}${reward.num > 0 ? `x${reward.num}` : ''}`"
v-for="reward in props.pos.reward_list"
:key="reward.item_id"
:title="`${reward.name}${reward.num > 0 ? `x${reward.num}` : ''}`"
class="ph-puc-reward"
@click="showMaterial(reward)"
>
<img :src="`/icon/bg/${reward.rarity}-Star.webp`" class="bg" alt="bg" />
<TMiImg :ori="true" :alt="reward.name" :src="reward.icon" class="icon" />
<img :src="`/icon/bg/${reward.rarity}-Star.webp`" alt="bg" class="bg" />
<TMiImg :alt="reward.name" :ori="true" :src="reward.icon" class="icon" />
<span v-if="reward.num > 0" class="count">{{ reward.num }}</span>
</div>
</div>
@@ -112,6 +135,7 @@ const posEl = useTemplateRef<HTMLDivElement>("posRef");
const endTs = ref<number>(0);
const restTs = ref<number>(0);
const durationTs = ref<number>(0);
const endHd = ref<string>();
const isStart = computed<boolean>(() => {
return props.pos.start_timestamp !== "0";
});
@@ -124,6 +148,12 @@ onMounted(() => {
}
if (timer !== null) clearInterval(timer);
timer = setInterval(handlePosition, 1000);
if (
props.pos.type === "ActTypeHardChallenge" &&
props.pos.hard_challenge_detail.sub.seconds >= 0
) {
endHd.value = timestampToDate(Date.now() + props.pos.hard_challenge_detail.sub.seconds * 1000);
}
});
onUnmounted(() => {
@@ -226,9 +256,22 @@ async function sharePos(): Promise<void> {
img {
width: 24px;
height: 24px;
padding: 2px;
border-radius: 50%;
background: #2c313c;
cursor: pointer;
}
}
.challenge-sub {
position: relative;
display: flex;
align-items: center;
img {
background: unset;
}
}
}
}
@@ -247,6 +290,11 @@ async function sharePos(): Promise<void> {
}
}
.ph-puc-desc {
font-size: 12px;
opacity: 0.8;
}
.ph-puc-rewards {
position: relative;
display: flex;

View File

@@ -49,7 +49,7 @@ import TucMonsterTag from "./tuc-monster-tag.vue";
import { AppCharacterData } from "@/data/index.js";
type TucChallengeItemProps = { data: TGApp.Game.Challenge.ChallengeList };
type TucChallengeItemProps = { data: TGApp.Game.Challenge.ChallengeData };
const props = defineProps<TucChallengeItemProps>();

View File

@@ -1,6 +1,6 @@
/**
* 游戏相关枚举
* @since Beta v0.8.0
* @since Beta v0.9.0
*/
/**
@@ -47,7 +47,7 @@ export function getGameServerDesc(server: TGApp.Game.Base.ServerTypeEnum): strin
/**
* 近期活动活动类型枚举
* @since Beta v0.8.0
* @since Beta v0.9.0
*/
export const ActCalendarTypeEnum: typeof TGApp.Game.ActCalendar.ActType = {
/** 幽境危战 */
@@ -60,6 +60,10 @@ export const ActCalendarTypeEnum: typeof TGApp.Game.ActCalendar.ActType = {
Double: "ActTypeDouble",
/** 探索活动 */
Explore: "ActTypeExplore",
/** 立本活动 */
LiBen: "ActTypeLiBen",
/** 累登活动 */
SignIn: "ActTypeSignIn",
/** 其他活动 */
Other: "ActTypeOther",
};

View File

@@ -6,20 +6,20 @@
<img alt="icon" src="/source/UI/userChallenge.webp" />
<span>幽境危战</span>
<v-select
density="compact"
variant="outlined"
v-model="uidCur"
:items="uidList"
:hide-details="true"
:items="uidList"
density="compact"
label="游戏UID"
variant="outlined"
@update:model-value="switchUid"
/>
<v-btn :rounded="true" class="ucp-btn" @click="toAbyss()">
<img src="/source/UI/userAbyss.webp" alt="abyss" />
<img alt="abyss" src="/source/UI/userAbyss.webp" />
<span>深境螺旋</span>
</v-btn>
<v-btn :rounded="true" class="ucp-btn" @click="toCombat()">
<img src="/source/UI/userCombat.webp" alt="abyss" />
<img alt="abyss" src="/source/UI/userCombat.webp" />
<span>真境剧诗</span>
</v-btn>
</div>
@@ -27,14 +27,14 @@
<template #append>
<div class="ucp-top-append">
<v-select
:items="serverList"
v-model="server"
:disabled="reqPop"
:items="serverList"
density="compact"
item-title="text"
item-value="value"
label="服务器"
width="200px"
density="compact"
:disabled="reqPop"
/>
</div>
</template>
@@ -42,28 +42,28 @@
<div class="ucp-top-extension">
<div class="act-list">
<v-btn
class="ucp-btn"
@click="shareChallenge()"
:disabled="localChallenge.length === 0"
class="ucp-btn"
prepend-icon="mdi-share"
@click="shareChallenge()"
>
分享
</v-btn>
<v-btn class="ucp-btn" @click="refreshChallenge()" prepend-icon="mdi-refresh">刷新</v-btn>
<v-btn class="ucp-btn" @click="tryReadChallenge()" prepend-icon="mdi-download">
<v-btn class="ucp-btn" prepend-icon="mdi-refresh" @click="refreshChallenge()">刷新</v-btn>
<v-btn class="ucp-btn" prepend-icon="mdi-download" @click="tryReadChallenge()">
导入
</v-btn>
<v-btn class="ucp-btn" @click="deleteChallenge()" prepend-icon="mdi-delete">删除</v-btn>
<v-btn class="ucp-btn" prepend-icon="mdi-delete" @click="deleteChallenge()">删除</v-btn>
</div>
<div class="pop-list">
<TucPopItem v-for="avatar in popList" :key="avatar.avatar_id" :avatar />
<v-btn
:loading="reqPop"
size="36"
class="pop-btn"
@click="refreshPopList"
icon="mdi-refresh"
:disabled="reqPop"
:loading="reqPop"
class="pop-btn"
icon="mdi-refresh"
size="36"
@click="refreshPopList"
/>
</div>
</div>
@@ -71,11 +71,11 @@
</v-app-bar>
<div class="user-challenge-box">
<v-tabs
v-model="userTab"
direction="vertical"
class="ucb-tabs"
center-active
v-if="localChallenge.length > 0"
v-model="userTab"
center-active
class="ucb-tabs"
direction="vertical"
>
<v-tab v-for="item in localChallenge" :key="item.id" :value="item.id">
<div class="ucb-tab">
@@ -102,14 +102,14 @@
幽境危战 | UID-{{ item.uid }} | Render by TeyvatGuide v{{ version }}
</div>
</div>
<TucBlings :data="item.blings" v-if="item.blings.length > 0" />
<TucOverview title="单人模式" :data="item.single" />
<TucOverview title="联机模式" :data="item.mp" v-if="item.mp.has_data" />
<TucBlings v-if="item.blings.length > 0" :data="item.blings" />
<TucOverview :data="item.single" title="单人模式" />
<TucOverview v-if="item.mp.has_data" :data="item.mp" title="联机模式" />
</div>
</v-window-item>
</v-window>
<div v-show="localChallenge.length === 0" class="ucb-empty">
<img src="/source/UI/empty.webp" alt="empty" />
<img alt="empty" src="/source/UI/empty.webp" />
<span>暂无数据请尝试刷新</span>
</div>
</div>
@@ -276,6 +276,7 @@ async function refreshChallenge(): Promise<void> {
await TGLogger.Info("[UserChallenge][refreshChallenge] 开始刷新挑战数据");
await showLoading.start(`正在获取${account.value.gameUid}的幽境危战数据`);
const resp = await recordReq.challenge.detail(cookie.value, account.value);
console.log(resp);
if ("retcode" in resp) {
await showLoading.end();
isReq.value = false;
@@ -326,6 +327,7 @@ async function refreshPopList(hint: boolean = true): Promise<void> {
await showLoading.start("正在加载赋光之人列表", `服务器: ${getGameServerDesc(server.value)}`);
}
const resp = await recordReq.challenge.pop(server.value);
console.log("赋光之人列表", resp);
if (resp.retcode !== 0) {
reqPop.value = false;
showSnackbar.error(`[${resp.retcode}] ${resp.message}`);

View File

@@ -1,23 +1,24 @@
<!-- 首页 -->
<template>
<div class="home-container">
<div class="home-top">
<div class="home-tools" v-if="isLogin">
<div v-if="isLogin" class="home-tools">
<v-select
v-model="curGid"
class="home-tool-select"
:items="games"
:hide-details="true"
:items="games"
class="home-tool-select"
item-value="gid"
label="小工具(右侧)分区"
variant="outlined"
label="分区"
>
<template #selection="{ item }">
<div class="select-item main">
<TMiImg
v-if="item.raw.icon"
:alt="item.raw.title"
:ori="true"
:src="item.raw.icon"
:alt="item.raw.title"
:title="item.raw.title"
class="icon"
/>
@@ -26,14 +27,14 @@
</template>
<template #item="{ props, item }">
<div
v-bind="props"
class="select-item sub"
:class="item.raw.gid === curGid ? 'selected' : ''"
class="select-item sub"
v-bind="props"
>
<TMiImg
v-if="item.raw.icon"
:src="item.raw.icon"
:alt="item.raw.title"
:src="item.raw.icon"
:title="item.raw.title"
class="icon"
/>
@@ -45,16 +46,16 @@
</div>
<div class="home-select">
<v-select
width="300px"
variant="outlined"
v-model="showItems"
:items="showItemsAll"
:hide-details="true"
:multiple="true"
:chips="true"
:hide-details="true"
:items="showItemsAll"
:multiple="true"
label="首页组件显示"
variant="outlined"
width="300px"
/>
<v-btn class="select-btn" @click="submitHome" :rounded="true">确定</v-btn>
<v-btn :rounded="true" class="select-btn" @click="submitHome">确定</v-btn>
</div>
</div>
<component :is="item" v-for="item in components" :key="item" @success="loadEnd(item)" />

View File

@@ -1,7 +1,6 @@
/**
* @file plugins/Sqlite/utils/transUserRecord.ts
* @description Sqlite 数据转换 用户战绩数据转换模块
* @since Beta v0.8.1
* 原神战绩数据转换
* @since Beta v0.9.0
*/
import { getZhElement } from "@utils/toolFunc.js";
@@ -63,13 +62,15 @@ function transAvatar(data: TGApp.Game.Record.Avatar): TGApp.Sqlite.Record.Avatar
}
/**
* @description 获取幽境危战难度描述
* @since Beta v0.8.0
* 获取幽境危战难度描述
* @since Beta v0.9.0
* @param {number} difficulty 幽境危战难度
* @return {string} 幽境危战难度描述
*/
export function getHardChallengeDesc(difficulty: number): string {
switch (difficulty) {
case 0:
return "未挑战";
case 1:
return "普通";
case 2:

View File

@@ -104,8 +104,7 @@ declare namespace TGApp.Game.ActCalendar {
/**
* 活动类型枚举
* @since Beta v0.8.0
* @remarks TODO:可能不完整,等待补充
* @since Beta v0.9.0
*/
const ActType = <const>{
/** 幽境危战 */
@@ -118,6 +117,10 @@ declare namespace TGApp.Game.ActCalendar {
Double: "ActTypeDouble",
/** 探索活动 */
Explore: "ActTypeExplore",
/** 立本活动 */
LiBen: "ActTypeLiBen",
/** 累登活动 */
SignIn: "ActTypeSignIn",
/** 其他活动 */
Other: "ActTypeOther",
};
@@ -130,7 +133,7 @@ declare namespace TGApp.Game.ActCalendar {
/**
* 活动信息
* @since Beta v0.8.0
* @since Beta v0.9.0
*/
type ActItem =
| ActItemHardChallenge
@@ -138,6 +141,8 @@ declare namespace TGApp.Game.ActCalendar {
| ActItemTower
| ActItemDouble
| ActItemExplore
| ActItemLiBen
| ActItemSignIn
| ActItemOther;
/**
@@ -170,7 +175,6 @@ declare namespace TGApp.Game.ActCalendar {
* @remarks
* 1:未开始
* 2:进行中
* 3:已结束
*/
status: number;
/** 活动奖励列表 */
@@ -201,7 +205,7 @@ declare namespace TGApp.Game.ActCalendar {
};
/**
* 活动信息-幽境危战
* 幽境危战
* @since Beta v0.8.0
*/
type ActItemHardChallenge = ActItemBase<"ActTypeHardChallenge"> & {
@@ -231,16 +235,16 @@ declare namespace TGApp.Game.ActCalendar {
* @since Beta v0.8.0
*/
type ActHardChallengeSub = {
/** 挑战耗时(秒) */
/** 紊乱爆发期剩余时间 */
seconds: number;
/** 未知参数 */
/** 已获得奖励进度 */
x: number;
/** 未知参数 */
/** 总奖励进度 */
y: number;
};
/**
* 活动信息-真境剧诗
* 真境剧诗
* @since Beta v0.8.0剧诗活动详情
*/
type ActItemRoleCombat = ActItemBase<"ActTypeRoleCombat"> & {
@@ -266,7 +270,7 @@ declare namespace TGApp.Game.ActCalendar {
};
/**
* 活动信息-深渊螺旋
* 深渊螺旋
* @since Beta v0.8.0
*/
type ActItemTower = ActItemBase<"ActTypeTower"> & {
@@ -290,7 +294,7 @@ declare namespace TGApp.Game.ActCalendar {
};
/**
* 活动信息-双倍活动
* 双倍活动
* @since Beta v0.8.0
*/
type ActItemDouble = ActItemBase<"ActTypeDouble"> & {
@@ -310,7 +314,7 @@ declare namespace TGApp.Game.ActCalendar {
};
/**
* 活动信息-探索活动
* 探索活动
* @since Beta v0.8.0
*/
type ActItemExplore = ActItemBase<"ActTypeExplore"> & {
@@ -330,7 +334,59 @@ declare namespace TGApp.Game.ActCalendar {
};
/**
* 活动信息-其他活动
* 立本活动
* @since Beta v0.9.0
*/
type ActItemLiBen = ActItemBase<"ActTypeLiBen"> & {
/** 立本活动详情 */
liben_detail: ActLiBen;
};
/**
* 立本活动详情
* @since Beta v0.9.0
*/
type ActLiBen = {
/**
* 状态
* @remarks 1-未兑换2-已兑换
*/
status: number;
/** 进度 */
progress: number;
/** 总数 */
total: number;
/** 是否领取大礼盒 */
is_has_taken_special_reward: boolean;
};
/**
* 累登活动
* @since Beta v0.9.0
*/
type ActItemSignIn = ActItemBase<"ActTypeSignIn"> & {
/** 累登活动详情 */
sign_in_detail: ActSignIn;
};
/**
* 累登活动详情
* @since Beta v0.9.0
*/
type ActSignIn = {
/**
* 状态
* @remarks 1-未领取2-已领取
*/
status: number;
/** 进度 */
progress: number;
/** 总数 */
total: number;
};
/**
* 其他活动
* @since Beta v0.8.0
*/
type ActItemOther = ActItemBase<"ActTypeOther"> & {

View File

@@ -1,28 +1,26 @@
/**
* @file types/Game/Challenge.d.ts
* @description 幽境危战相关类型定义文件
* 幽境危战
* @since Beta v0.8.0
*/
declare namespace TGApp.Game.Challenge {
/**
* @description 幽境危战赋光之人列表返回响应
* 赋光之人列表返回响应
* @since Beta v0.8.0
* @interface PopularityResp
* @extends TGApp.BBS.Response.BaseWithData<PopularityRes>
*/
type PopularityResp = TGApp.BBS.Response.BaseWithData<PopularityRes>;
/**
* @description 幽境危战赋光之人列表数据
* 赋光之人列表数据
* @since Beta v0.8.0
* @interface PopularityRes
* @property {Array<PopularityItem>} avatar_list - 赋光之人列表
*/
type PopularityRes = { avatar_list: Array<PopularityItem> };
type PopularityRes = {
/** 赋光之人列表 */
avatar_list: Array<PopularityItem>;
};
/**
* @description 幽境危战赋光之人列表项
* 赋光之人
* @since Beta v0.8.0
* @interface PopularityItem
* @property {number} avatar_id - 角色 ID
@@ -32,204 +30,232 @@ declare namespace TGApp.Game.Challenge {
* @property {number} rarity - 角色稀有度
*/
type PopularityItem = {
/** 角色ID */
avatar_id: number;
/** 角色名称 */
name: string;
/**
* 角色元素
* @remarks Anemo,Cryo,Electro等
*/
element: string;
/** 角色图标 */
image: string;
/** 角色星级 */
rarity: number;
};
/**
* @description 挑战数据返回响应(详细)
* 挑战数据返回响应(详细)
* @since Beta v0.8.0
* @interface ChallengeResp
* @extends TGApp.BBS.Response.BaseWithData<ChallengeRes>
*/
type ChallengeResp = TGApp.BBS.Response.BaseWithData<ChallengeRes>;
/**
* @description 挑战数据返回(详细)
* 挑战数据(详细)
* @since Beta v0.8.0
* @interface ChallengeRes
* @property {Array<ChallengeItem>} data - 挑战数据列表
* @property {boolean} is_unlock - 是否解锁挑战
* @property {ChallengeLink} link - 挑战链接信息
*/
type ChallengeRes = { data: Array<ChallengeItem>; is_unlock: boolean; link: ChallengeLink };
type ChallengeRes = {
/** 挑战数据 */
data: Array<ChallengeItem>;
/** 是否解锁 */
is_unlock: boolean;
/** 外部链接 */
link: ChallengeLink;
};
/**
* @description 挑战链接信息
* 外部链接
* @since Beta v0.8.0
* @interface ChallengeLink
* @property {string} lineup_link - 队伍配置链接
* @property {string} play_link - 挑战链接
*/
type ChallengeLink = { lineup_link: string; play_link: string };
type ChallengeLink = {
/** 未知URL */
lineup_link: string;
/** 活动攻略链接 */
play_link: string;
};
/**
* @description 挑战数据
* 挑战数据
* @since Beta v0.8.0
* @interface ChallengeItem
* @property {ChallengeSchedule} schedule - 挑战周期信息
* @property {Challenge} single - 单次挑战数据
* @property {Challenge} mp - 多人挑战数据
* @property {ChallengeBlings} blings - 赋予辉光数据
*/
type ChallengeItem = {
/** 周期数据 */
schedule: ChallengeSchedule;
/** 单人挑战 */
single: Challenge;
/** 联机挑战 */
mp: Challenge;
/** 赋光信息 */
blings: ChallengeBlings;
};
/**
* @description 挑战周期信息
* 挑战周期信息
* @since Beta v0.8.0
* @interface ChallengeSchedule
* @property {string} schedule_id - 挑战周期 ID
* @property {string} start_time - 挑战开始时间(秒级时间戳)
* @property {string} end_time - 挑战结束时间(秒级时间戳)
* @property {TGApp.Game.Base.DateTime} start_date_time - 挑战开始时间DateTime 对象)
* @property {TGApp.Game.Base.DateTime} end_date_time - 挑战结束时间DateTime 对象)
* @property {boolean} is_valid - 是否有效
* @property {string} name - 挑战名称
*/
type ChallengeSchedule = {
/** 周期ID */
schedule_id: string;
/** 开始时间戳(秒级) */
start_time: string;
/** 结束时间戳(秒级) */
end_time: string;
/** 开始时间 */
start_date_time: TGApp.Game.Base.DateTime;
/** 结束时间 */
end_date_time: TGApp.Game.Base.DateTime;
/** 是否有效 */
is_valid: boolean;
/** 名称 */
name: string;
};
/**
* @description 单次挑战数据
* 挑战数据
* @since Beta v0.8.0
* @interface Challenge
* @property {ChallengeBest} best - 最佳挑战数据
* @property {Array<ChallengeList>} challenge - 挑战列表
* @property {boolean} has_data - 是否有数据
*/
type Challenge = { best: ChallengeBest; challenge: Array<ChallengeList>; has_data: boolean };
type Challenge = {
/** 最佳数据 */
best: ChallengeBest;
/** 挑战列表 */
challenge: Array<ChallengeData>;
/** 是否有数据 */
has_data: boolean;
};
/**
* @description 单次挑战最佳数据
* 最佳数据
* @since Beta v0.8.0
* @interface ChallengeBest
* @property {number} difficulty - 挑战难度
* @property {number} second - 挑战用时(秒)
* @property {string} icon - 挑战图标名称
*/
type ChallengeBest = { difficulty: number; second: number; icon: string };
/**
* @description 单次挑战数据项
* @since Beta v0.8.0
* @interface ChallengeList
* @property {string} name - 怪物名称
* @property {number} second - 挑战用时(秒)
* @property {Array<ChallengeTeam>} teams - 挑战队伍列表
* @property {Array<ChallengeAvatar>} best_avatar - 最佳角色列表
* @property {ChallengeMonster} monster - 挑战怪物数据
*/
type ChallengeList = {
name: string;
type ChallengeBest = {
/** 难度 */
difficulty: number;
/** 耗时(秒) */
second: number;
/** 图标 */
icon: string;
};
/**
* 挑战数据
* @since Beta v0.8.0
*/
type ChallengeData = {
/** 怪物名称 */
name: string;
/** 耗时(秒) */
second: number;
/** 上场队伍 */
teams: Array<ChallengeTeam>;
/** 最佳角色 */
best_avatar: Array<ChallengeAvatar>;
/** 怪物信息 */
monster: ChallengeMonster;
};
/**
* @description 单次挑战队伍数据
* 队伍数据
* @since Beta v0.8.0
* @interface ChallengeTeam
* @property {number} avatar_id - 角色 ID
* @property {string} name - 角色名称
* @property {string} element - 角色元素
* @property {string} image - 角色头像图片 URL
* @property {number} level - 角色等级
* @property {number} rarity - 角色稀有度
* @property {number} rank - 角色命座
*/
type ChallengeTeam = {
/** 角色ID */
avatar_id: number;
/** 角色名称 */
name: string;
/**
* 角色元素
* @remarks Cryo 等
*/
element: string;
/** 角色图标 */
image: string;
/** 角色等级 */
level: number;
/** 角色星级 */
rarity: number;
/** 角色命座 */
rank: number;
};
/**
* @description 单次挑战最佳角色数据
* 最佳角色数据
* @since Beta v0.8.0
* @interface ChallengeAvatar
* @property {number} avatar_id - 角色 ID
* @property {string} side_icon - 角色侧边图标 URL
* @property {string} dps - 角色 DPS 数据
* @property {number} type - 1-最强一击2-最高总伤害
*/
type ChallengeAvatar = { avatar_id: number; side_icon: string; dps: string; type: number };
/**
* @description 单次挑战怪物数据
* @since Beta v0.8.0
* @interface ChallengeMonster
* @property {string} name - 怪物名称
* @property {number} level - 怪物等级
* @property {string} icon - 怪物图标 URL
* @property {Array<string>} desc - 怪物描述列表
* @property {Array<MonsterTag>} tags - 怪物标签列表
* @property {string} monster_id - 怪物 ID
*/
type ChallengeMonster = {
name: string;
level: number;
icon: string;
desc: Array<string>;
tags: Array<MonsterTag>;
monster_id: string;
type ChallengeAvatar = {
/** 角色ID */
avatar_id: number;
/** 侧边图标 */
side_icon: string;
/**输出 */
dps: string;
/**
* 数据类型
* @remarks 1-最强一击2-最高总伤
*/
type: number;
};
/**
* @description 怪物标签
* 怪物数据
* @since Beta v0.8.0
* @interface MonsterTag
* @property {string} type - 标签类型
* @property {string} desc - 标签描述
*/
type MonsterTag = { type: string; desc: string };
type ChallengeMonster = {
/** 名称 */
name: string;
/** 等级 */
level: number;
/** 图标 */
icon: string;
/** 描述 */
desc: Array<string>;
/**
* 标签
* @remarks 一般为空
*/
tags: Array<MonsterTag>;
/** 怪物ID */
monster_id: number;
};
/**
* @description 赋予辉光数据
* 怪物标签
* @since Beta v0.8.0
*/
type MonsterTag = {
/** 标签类型 */
type: string;
/** 标签描述 */
desc: string;
};
/**
* 赋予辉光数据
* @since Beta v0.8.0
* @interface ChallengeBlings
*/
type ChallengeBlings = Array<ChallengeBling>;
/**
* @description 赋予辉光数据项
* 赋予辉光数据项
* @since Beta v0.8.0
* @interface ChallengeBling
* @property {number} avatar_id - 角色 ID
* @property {string} name - 角色名称
* @property {string} element - 角色元素
* @property {string} image - 角色头像图片 URL
* @property {string} side_icon - 角色侧边图标 URL
* @property {number} rarity - 角色稀有度
* @property {boolean} is_plus - 是否上榜
*/
type ChallengeBling = {
/** 角色ID */
avatar_id: number;
/** 角色名称 */
name: string;
/**
* 角色元素
* @remarks Cyro 等
*/
element: string;
/** 角色图标 */
image: string;
/** 侧边栏图标 */
side_icon: string;
/** 星级 */
rarity: number;
/** 是否上榜 */
is_plus: boolean;
};
}

View File

@@ -9,9 +9,9 @@ declare namespace TGApp.Plugins.UIAF {
* @since Alpha v0.1.5
*/
type Data = {
/* UIAF 头部信息 */
/** UIAF 头部信息 */
info: Export;
/* UIAF 成就列表 */
/** UIAF 成就列表 */
list: Array<Achievement>;
};
@@ -20,13 +20,13 @@ declare namespace TGApp.Plugins.UIAF {
* @since Alpha v0.1.5
*/
type Export = {
/* 导出的应用名称 */
/** 导出的应用名称 */
export_app: string;
/* 导出时间戳,秒级 */
/** 导出时间戳,秒级 */
export_timestamp: number;
/* 导出的应用版本 */
/** 导出的应用版本 */
export_app_version: string;
/* UIAF 版本 */
/** UIAF 版本 */
uiaf_version: string;
};
@@ -35,13 +35,13 @@ declare namespace TGApp.Plugins.UIAF {
* @since Beta v0.7.8
*/
const AchiItemStat = <const>{
/* 无效状态 */
/** 无效状态 */
Invalid: 0,
/* 未完成 */
/** 未完成 */
Unfinished: 1,
/* 已完成未领取奖励 */
/** 已完成未领取奖励 */
Finished: 2,
/* 已领取奖励 */
/** 已领取奖励 */
RewardTaken: 3,
};
@@ -57,13 +57,13 @@ declare namespace TGApp.Plugins.UIAF {
* @description UIAF 单个成就数据
*/
type Achievement = {
/* 成就 ID */
/** 成就 ID */
id: number;
/* 成就记录时间戳,秒级 */
/** 成就记录时间戳,秒级 */
timestamp: number;
/* 成就进度 */
/** 成就进度 */
current: number;
/* 成就状态 */
/** 成就状态 */
status: AchiItemStatEnum;
};
}