mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
✏️ itemType 收束
This commit is contained in:
@@ -74,7 +74,7 @@ const onCancel = (): void => {
|
|||||||
|
|
||||||
function toDetail(item: TGApp.App.Calendar.Item): void {
|
function toDetail(item: TGApp.App.Calendar.Item): void {
|
||||||
if (item.contentId === 0) {
|
if (item.contentId === 0) {
|
||||||
const itemType = item.itemType === "avatar" ? "角色" : "武器";
|
const itemType = item.itemType === "character" ? "角色" : "武器";
|
||||||
showSnackbar({
|
showSnackbar({
|
||||||
text: `[${itemType}] ${item.name} 暂无详情`,
|
text: `[${itemType}] ${item.name} 暂无详情`,
|
||||||
color: "warn",
|
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 应用素材日历相关类型定义文件
|
* @description 应用素材日历相关类型定义文件
|
||||||
* @author BTMuli <bt-muli@outlook.com>
|
* @since Beta v0.3.5
|
||||||
* @since Alpha v0.2.2
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
declare namespace TGApp.App.Calendar {
|
declare namespace TGApp.App.Calendar {
|
||||||
/**
|
/**
|
||||||
* @description 素材日历类型
|
* @description 素材日历类型
|
||||||
* @since Alpha v0.2.2
|
* @since Beta v0.3.5
|
||||||
* @interface Item
|
* @interface Item
|
||||||
* @property {number} id - 角色ID/武器ID
|
* @property {number} id - 角色ID/武器ID
|
||||||
* @property {number} contentId - 观测枢的 content_id
|
* @property {number} contentId - 观测枢的 content_id
|
||||||
@@ -24,12 +23,12 @@ declare namespace TGApp.App.Calendar {
|
|||||||
* @property {Source} source - 日历项来源
|
* @property {Source} source - 日历项来源
|
||||||
* @return Item
|
* @return Item
|
||||||
*/
|
*/
|
||||||
export interface Item {
|
interface Item {
|
||||||
id: number;
|
id: number;
|
||||||
contentId: number;
|
contentId: number;
|
||||||
dropDays: number[];
|
dropDays: number[];
|
||||||
name: string;
|
name: string;
|
||||||
itemType: string;
|
itemType: "character" | "weapon";
|
||||||
star: number;
|
star: number;
|
||||||
bg: string;
|
bg: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
@@ -51,7 +50,7 @@ declare namespace TGApp.App.Calendar {
|
|||||||
* @property {string} icon - 素材图标
|
* @property {string} icon - 素材图标
|
||||||
* @return Material
|
* @return Material
|
||||||
*/
|
*/
|
||||||
export interface Material {
|
interface Material {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
star: number;
|
star: number;
|
||||||
@@ -69,7 +68,7 @@ declare namespace TGApp.App.Calendar {
|
|||||||
* @property {string} name - 来源名称
|
* @property {string} name - 来源名称
|
||||||
* @return Source
|
* @return Source
|
||||||
*/
|
*/
|
||||||
export interface Source {
|
interface Source {
|
||||||
area: string;
|
area: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user