mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
feat(calendar): 组件写好了,然后就是跳转的事情了
This commit is contained in:
@@ -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<number>} sort 排序
|
||||
* @property {Map<number>} 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<number>;
|
||||
sort_day: Map<number>;
|
||||
contentInfos: CalendarContent[];
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user