From 34bb878e2e0948b9abf0255656b636db6a594546 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sun, 2 Apr 2023 23:02:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(calendar):=20=E7=BB=84=E4=BB=B6=E5=86=99?= =?UTF-8?q?=E5=A5=BD=E4=BA=86=EF=BC=8C=E7=84=B6=E5=90=8E=E5=B0=B1=E6=98=AF?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E7=9A=84=E4=BA=8B=E6=83=85=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/t-calendar.vue | 187 ++++++++++++++++++++++++++ src/components/t-position.vue | 2 +- src/pages/Home.vue | 2 + src/plugins/Mys/interface/calendar.ts | 9 +- src/plugins/Mys/utils/calendar.ts | 4 +- 5 files changed, 199 insertions(+), 5 deletions(-) create mode 100644 src/components/t-calendar.vue diff --git a/src/components/t-calendar.vue b/src/components/t-calendar.vue new file mode 100644 index 00000000..3c8c6f4d --- /dev/null +++ b/src/components/t-calendar.vue @@ -0,0 +1,187 @@ + + + diff --git a/src/components/t-position.vue b/src/components/t-position.vue index 8a4cc3a0..acd1c6f8 100644 --- a/src/components/t-position.vue +++ b/src/components/t-position.vue @@ -49,8 +49,8 @@ diff --git a/src/plugins/Mys/interface/calendar.ts b/src/plugins/Mys/interface/calendar.ts index 6c77c592..9ad838b3 100644 --- a/src/plugins/Mys/interface/calendar.ts +++ b/src/plugins/Mys/interface/calendar.ts @@ -87,19 +87,22 @@ export interface CalendarContent { * @since Alpha v0.1.1 * @interface CalendarCard * @property {number} id 角色/武器 ID + * @property {number} type 角色/武器,角色为 2,武器为 1 * @property {string} title 角色/武器 名称 * @property {string} cover 角色/武器 封面 - * @property {string} url 跳转链接 + * @property {string} url 跳转链接,一般为 content_id * @property {string[]} drop_day 掉落日 - * @property {Map} sort 排序 + * @property {Map} sort_day 排序 * @property {CalendarContent[]} contentInfos 材料内容 * @return {CalendarCard} */ export interface CalendarCard { id: number; + type: number; title: string; cover: string; url: string; drop_day: string[]; - sort: Map; + sort_day: Map; + contentInfos: CalendarContent[]; } diff --git a/src/plugins/Mys/utils/calendar.ts b/src/plugins/Mys/utils/calendar.ts index 83f89496..d7bb09ac 100644 --- a/src/plugins/Mys/utils/calendar.ts +++ b/src/plugins/Mys/utils/calendar.ts @@ -18,11 +18,13 @@ export function getCalendarCard(calendarData: CalendarData[]): CalendarCard[] { calendarData.forEach((data: CalendarData) => { return calendarCard.push({ id: Number(data.id), + type: Number(data.break_type), title: data.title, cover: data.img_url, url: data.jump_type === "1" ? data.jump_url : data.content_id, drop_day: data.drop_day, - sort: JSON.parse(data.sort), + sort_day: JSON.parse(data.sort), + contentInfos: data.contentInfos, }); }); return calendarCard;