mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
✏️ itemType 收束
This commit is contained in:
@@ -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",
|
||||
|
||||
15
src/types/App/Calendar.d.ts
vendored
15
src/types/App/Calendar.d.ts
vendored
@@ -1,14 +1,13 @@
|
||||
/**
|
||||
* @file types App Calendar.d.ts
|
||||
* @file types/App/Calendar.d.ts
|
||||
* @description 应用素材日历相关类型定义文件
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @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;
|
||||
|
||||
Reference in New Issue
Block a user