From 349bab11733c876b67ae8c64d67207b0bb6df7b1 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Mon, 6 Nov 2023 22:49:42 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20itemType=20=E6=94=B6?= =?UTF-8?q?=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/overlay/to-calendar.vue | 2 +- src/types/App/Calendar.d.ts | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/overlay/to-calendar.vue b/src/components/overlay/to-calendar.vue index 20184814..9305328b 100644 --- a/src/components/overlay/to-calendar.vue +++ b/src/components/overlay/to-calendar.vue @@ -74,7 +74,7 @@ const onCancel = (): void => { function toDetail(item: TGApp.App.Calendar.Item): void { if (item.contentId === 0) { - const itemType = item.itemType === "avatar" ? "角色" : "武器"; + const itemType = item.itemType === "character" ? "角色" : "武器"; showSnackbar({ text: `[${itemType}] ${item.name} 暂无详情`, color: "warn", diff --git a/src/types/App/Calendar.d.ts b/src/types/App/Calendar.d.ts index b68aa1ad..d342bbe8 100644 --- a/src/types/App/Calendar.d.ts +++ b/src/types/App/Calendar.d.ts @@ -1,14 +1,13 @@ /** - * @file types App Calendar.d.ts + * @file types/App/Calendar.d.ts * @description 应用素材日历相关类型定义文件 - * @author BTMuli - * @since Alpha v0.2.2 + * @since Beta v0.3.5 */ declare namespace TGApp.App.Calendar { /** * @description 素材日历类型 - * @since Alpha v0.2.2 + * @since Beta v0.3.5 * @interface Item * @property {number} id - 角色ID/武器ID * @property {number} contentId - 观测枢的 content_id @@ -24,12 +23,12 @@ declare namespace TGApp.App.Calendar { * @property {Source} source - 日历项来源 * @return Item */ - export interface Item { + interface Item { id: number; contentId: number; dropDays: number[]; name: string; - itemType: string; + itemType: "character" | "weapon"; star: number; bg: string; icon: string; @@ -51,7 +50,7 @@ declare namespace TGApp.App.Calendar { * @property {string} icon - 素材图标 * @return Material */ - export interface Material { + interface Material { id: number; name: string; star: number; @@ -69,7 +68,7 @@ declare namespace TGApp.App.Calendar { * @property {string} name - 来源名称 * @return Source */ - export interface Source { + interface Source { area: string; icon: string; name: string;