diff --git a/public/UI/daily/coin.webp b/public/UI/daily/coin.webp new file mode 100644 index 00000000..4e27a8f1 Binary files /dev/null and b/public/UI/daily/coin.webp differ diff --git a/public/UI/daily/domain.webp b/public/UI/daily/domain.webp new file mode 100644 index 00000000..e6db7ded Binary files /dev/null and b/public/UI/daily/domain.webp differ diff --git a/public/UI/daily/mission.webp b/public/UI/daily/mission.webp new file mode 100644 index 00000000..0eafef4e Binary files /dev/null and b/public/UI/daily/mission.webp differ diff --git a/public/UI/daily/resin.webp b/public/UI/daily/resin.webp new file mode 100644 index 00000000..f849ce64 Binary files /dev/null and b/public/UI/daily/resin.webp differ diff --git a/public/UI/daily/task.webp b/public/UI/daily/task.webp new file mode 100644 index 00000000..fbddda20 Binary files /dev/null and b/public/UI/daily/task.webp differ diff --git a/public/UI/daily/trans.webp b/public/UI/daily/trans.webp new file mode 100644 index 00000000..be61aba3 Binary files /dev/null and b/public/UI/daily/trans.webp differ diff --git a/src/components/pageHome/ph-comp-daily-note.vue b/src/components/pageHome/ph-comp-daily-note.vue new file mode 100644 index 00000000..b1f1ae27 --- /dev/null +++ b/src/components/pageHome/ph-comp-daily-note.vue @@ -0,0 +1,187 @@ + + + + + + + + 请先登录 + 暂无游戏账户 + + + + {{ loadingText }} + + + + + + + + + + diff --git a/src/components/pageHome/ph-daily-note-boss.vue b/src/components/pageHome/ph-daily-note-boss.vue new file mode 100644 index 00000000..978802a5 --- /dev/null +++ b/src/components/pageHome/ph-daily-note-boss.vue @@ -0,0 +1,80 @@ + + + + + + + + 周本 BOSS + 剩余减半次数 {{ current }}/{{ max }} + + + + + diff --git a/src/components/pageHome/ph-daily-note-coin.vue b/src/components/pageHome/ph-daily-note-coin.vue new file mode 100644 index 00000000..c1004c57 --- /dev/null +++ b/src/components/pageHome/ph-daily-note-coin.vue @@ -0,0 +1,134 @@ + + + + + + + + + 洞天宝钱 + {{ current }}/{{ max }} + + + {{ formattedTime }} + + + + + + diff --git a/src/components/pageHome/ph-daily-note-expedition.vue b/src/components/pageHome/ph-daily-note-expedition.vue new file mode 100644 index 00000000..deb37932 --- /dev/null +++ b/src/components/pageHome/ph-daily-note-expedition.vue @@ -0,0 +1,151 @@ + + + + + + + + 已完成 + + 派遣中 + {{ formattedTime }} + + + + + + diff --git a/src/components/pageHome/ph-daily-note-item.vue b/src/components/pageHome/ph-daily-note-item.vue new file mode 100644 index 00000000..475626db --- /dev/null +++ b/src/components/pageHome/ph-daily-note-item.vue @@ -0,0 +1,248 @@ + + + + + + {{ props.account.nickname }} + + + + {{ props.account.gameUid }} + {{ props.account.regionName }} + + + + + + + + + + + + + + + + + + 探索派遣 + + {{ props.data.current_expedition_num }}/{{ props.data.max_expedition_num }} + + + + + + + + + + diff --git a/src/components/pageHome/ph-daily-note-quest.vue b/src/components/pageHome/ph-daily-note-quest.vue new file mode 100644 index 00000000..935979c7 --- /dev/null +++ b/src/components/pageHome/ph-daily-note-quest.vue @@ -0,0 +1,110 @@ + + + + + + + + + 魔神任务 + + {{ + props.quest.is_finish_all_mainline && props.quest.is_finish_all_interchapter + ? "已完成" + : `未完成:${props.quest.list.length}` + }} + + + + + {{ q.chapter_num }} {{ q.chapter_title }} {{ getQuestStatus(q.status) }} + + + + + + + diff --git a/src/components/pageHome/ph-daily-note-resin.vue b/src/components/pageHome/ph-daily-note-resin.vue new file mode 100644 index 00000000..9950760f --- /dev/null +++ b/src/components/pageHome/ph-daily-note-resin.vue @@ -0,0 +1,142 @@ + + + + + + + + + 原粹树脂 + {{ current }}/{{ max }} + + + {{ formattedTime }} + + + + + + diff --git a/src/components/pageHome/ph-daily-note-task.vue b/src/components/pageHome/ph-daily-note-task.vue new file mode 100644 index 00000000..ac00571a --- /dev/null +++ b/src/components/pageHome/ph-daily-note-task.vue @@ -0,0 +1,228 @@ + + + + + + + + + + 每日委托 + {{ taskStatus }} + + + mdi-circle + {{ task.stored_attendance }} + + + + + 日常 + + + mdi-check + + mdi-square-outline + + + + 历练 + + + + + + mdi-check + + mdi-gift + + + + 可领取 + + + + + + + + diff --git a/src/components/pageHome/ph-daily-note-transformer.vue b/src/components/pageHome/ph-daily-note-transformer.vue new file mode 100644 index 00000000..93846c2d --- /dev/null +++ b/src/components/pageHome/ph-daily-note-transformer.vue @@ -0,0 +1,152 @@ + + + + + + + + 参量质变仪 + + {{ valueText }} + + + + + + diff --git a/src/enum/dailyNote.ts b/src/enum/dailyNote.ts new file mode 100644 index 00000000..da579849 --- /dev/null +++ b/src/enum/dailyNote.ts @@ -0,0 +1,118 @@ +/** + * 实时便笺相关枚举 + * @since Beta v0.10.0 + */ + +/** + * 探索派遣状态枚举 + * @since Beta v0.10.0 + * @see TGApp.Game.DailyNote.ExpeditionStatusEnum + */ +const ExpeditionStatusEnum: typeof TGApp.Game.DailyNote.ExpeditionStatus = { + ONGOING: "Ongoing", + FINISHED: "Finished", +}; + +/** + * 获取探索派遣状态描述 + * @since Beta v0.10.0 + * @param status - 探索派遣状态 + * @returns 探索派遣状态描述 + */ +function getExpeditionStatusDesc(status: TGApp.Game.DailyNote.ExpeditionStatusEnum): string { + switch (status) { + case ExpeditionStatusEnum.ONGOING: + return "派遣中"; + case ExpeditionStatusEnum.FINISHED: + return "已完成"; + } +} + +/** + * 任务奖励状态枚举 + * @since Beta v0.10.0 + * @see TGApp.Game.DailyNote.TaskRewardStatusEnum + */ +const TaskRewardStatusEnum: typeof TGApp.Game.DailyNote.TaskRewardStatus = { + UNFINISHED: "TaskRewardStatusUnfinished", + FINISHED: "TaskRewardStatusFinished", + RECEIVED: "TaskRewardStatusReceived", +}; + +/** + * 获取任务奖励状态描述 + * @since Beta v0.10.0 + * @param status - 任务奖励状态 + * @returns 任务奖励状态描述 + */ +function getTaskRewardStatusDesc(status: TGApp.Game.DailyNote.TaskRewardStatusEnum): string { + switch (status) { + case TaskRewardStatusEnum.UNFINISHED: + return "未完成"; + case TaskRewardStatusEnum.FINISHED: + return "已完成"; + case TaskRewardStatusEnum.RECEIVED: + return "已领取"; + } +} + +/** + * 历练点奖励状态枚举 + * @since Beta v0.10.0 + * @see TGApp.Game.DailyNote.AttendanceRewardStatusEnum + */ +const AttendanceRewardStatusEnum: typeof TGApp.Game.DailyNote.AttendanceRewardStatus = { + UNFINISHED: "AttendanceRewardStatusUnfinished", + TAKEN: "AttendanceRewardStatusTakenAward", +}; + +/** + * 获取历练点奖励状态描述 + * @since Beta v0.10.0 + * @param status - 历练点奖励状态 + * @returns 历练点奖励状态描述 + */ +function getAttendanceRewardStatusDesc( + status: TGApp.Game.DailyNote.AttendanceRewardStatusEnum, +): string { + switch (status) { + case AttendanceRewardStatusEnum.UNFINISHED: + return "未完成"; + case AttendanceRewardStatusEnum.TAKEN: + return "已领取"; + } +} + +/** + * 参量质变仪状态枚举 + * @since Beta v0.10.0 + * @see TGApp.Game.DailyNote.TransformerStatusEnum + */ +const TransformerStatusEnum: typeof TGApp.Game.DailyNote.TransformerStatus = { + OBTAINED: "Obtained", + NOT_OBTAINED: "NotObtained", +}; + +/** + * 实时便笺枚举 + * @since Beta v0.10.0 + */ +const dailyNoteEnum = { + expedition: { + status: ExpeditionStatusEnum, + statusDesc: getExpeditionStatusDesc, + }, + taskReward: { + status: TaskRewardStatusEnum, + statusDesc: getTaskRewardStatusDesc, + }, + attendanceReward: { + status: AttendanceRewardStatusEnum, + statusDesc: getAttendanceRewardStatusDesc, + }, + transformer: { + status: TransformerStatusEnum, + }, +}; + +export default dailyNoteEnum; diff --git a/src/pages/User/Gacha.vue b/src/pages/User/Gacha.vue index 7a8ef259..9a825090 100644 --- a/src/pages/User/Gacha.vue +++ b/src/pages/User/Gacha.vue @@ -399,7 +399,7 @@ async function handleHutaoDownload(uids: Array): Promise { await showLoading.end(); showSnackbar.success("成功下载,即将刷新页面"); await new Promise((resolve) => setTimeout(resolve, 1000)); - // window.location.reload(); + window.location.reload(); } async function handleHutaoDelete(uids: Array): Promise { diff --git a/src/pages/common/PageHome.vue b/src/pages/common/PageHome.vue index 371658a5..a00a4efc 100644 --- a/src/pages/common/PageHome.vue +++ b/src/pages/common/PageHome.vue @@ -54,7 +54,7 @@ density="compact" label="首页组件显示" variant="outlined" - width="360px" + width="440px" /> 确定 @@ -72,6 +72,7 @@ import showDialog from "@comp/func/dialog.js"; import showLoading from "@comp/func/loading.js"; import showSnackbar from "@comp/func/snackbar.js"; import PhCompCalendar from "@comp/pageHome/ph-comp-calendar.vue"; +import PhCompDailyNote from "@comp/pageHome/ph-comp-daily-note.vue"; import PhCompPool from "@comp/pageHome/ph-comp-pool.vue"; import PhCompPosition from "@comp/pageHome/ph-comp-position.vue"; import PhCompSign from "@comp/pageHome/ph-comp-sign.vue"; @@ -129,9 +130,10 @@ onMounted(async () => { await showLoading.start("正在加载首页小部件"); games.value = gameList.value.map((i) => ({ icon: i.app_icon, title: i.name, gid: i.id })); showItems.value = homeStore.getShowItems(); - showItemsAll.value = ["游戏签到", "素材日历", "限时祈愿", "近期活动"]; + showItemsAll.value = ["游戏签到", "实时便笺", "素材日历", "限时祈愿", "近期活动"]; } else { showItems.value = homeStore.getShowItems().filter((i) => i !== "游戏签到"); + showItemsAll.value = ["实时便笺", "素材日历", "限时祈愿", "近期活动"]; } oldItems.value = showItems.value; await loadComp(); @@ -157,6 +159,13 @@ async function loadComp(): Promise { showSnackbar.warn("未登录不可设置游戏签到组件"); } break; + case "实时便笺": + if (isLogin.value) { + temp.push(PhCompDailyNote); + } else { + showSnackbar.warn("未登录不可设置实时便笺组件"); + } + break; case "限时祈愿": temp.push(PhCompPool); break; @@ -191,6 +200,8 @@ function getName(name: string): string | undefined { switch (name) { case "ph-comp-sign": return "游戏签到"; + case "ph-comp-daily-note": + return "实时便笺"; case "ph-comp-pool": return "限时祈愿"; case "ph-comp-position": diff --git a/src/store/modules/home.ts b/src/store/modules/home.ts index b93d64f8..029778a5 100644 --- a/src/store/modules/home.ts +++ b/src/store/modules/home.ts @@ -1,6 +1,6 @@ /** * 首页组件状态 - * @since Beta v0.9.0 + * @since Beta v0.10.0 */ import { defineStore } from "pinia"; @@ -10,10 +10,11 @@ import { ref } from "vue"; * 默认展示项 */ const defaultHomeShow: Array = [ - { show: false, order: 4, label: "游戏签到" }, { show: true, order: 1, label: "限时祈愿" }, { show: true, order: 2, label: "近期活动" }, { show: true, order: 3, label: "素材日历" }, + { show: false, order: 4, label: "游戏签到" }, + { show: true, order: 5, label: "实时便笺" }, ]; const useHomeStore = defineStore("home", () => { diff --git a/src/types/Game/DailyNote.d.ts b/src/types/Game/DailyNote.d.ts index 79939727..82f9bfa4 100644 --- a/src/types/Game/DailyNote.d.ts +++ b/src/types/Game/DailyNote.d.ts @@ -128,13 +128,8 @@ declare namespace TGApp.Game.DailyNote { * @since Beta v0.10.0 */ type DailyTaskReward = { - /** - * 状态 - * @todo 枚举 - * @example - * - TaskRewardStatusUnfinished - */ - status: string; + /** 状态 */ + status: TaskRewardStatusEnum; }; /** @@ -142,13 +137,8 @@ declare namespace TGApp.Game.DailyNote { * @since Beta v0.10.0 */ type AttendanceReward = { - /** - * 状态 - * @todo 枚举 - * @example - * - AttendanceRewardStatusTakenAward - */ - status: string; + /** 状态 */ + status: AttendanceRewardStatusEnum; /** * 进度 * @remarks 2000 点满 @@ -174,5 +164,97 @@ declare namespace TGApp.Game.DailyNote { }; /** 任务 */ - type ArchonQuest = unknown; + type ArchonQuest = { + /** + * 章节数 + * @example 第二章 第三幕 + */ + chapter_num: string; + /** + * 章节标题 + * @example 千手百眼,天下人间 + */ + chapter_title: string; + /** + * 章节类型 + * @todo 枚举 + * @example 1 + */ + chapter_type: number; + /** 任务ID */ + id: number; + /** + * 任务状态 + * @todo 枚举 + * @example + * - StatusNotOpen + */ + status: string; + }; + + /** + * 探索派遣状态 + * @since Beta v0.10.0 + * @todo 待确认 + */ + const ExpeditionStatus = { + ONGOING: "Ongoing", + FINISHED: "Finished", + }; + + /** + * 探索派遣状态类型 + * @since Beta v0.10.0 + */ + type ExpeditionStatusEnum = (typeof ExpeditionStatus)[keyof typeof ExpeditionStatus]; + + /** + * 任务奖励状态 + * @since Beta v0.10.0 + * @todo 待确认 + */ + const TaskRewardStatus = { + UNFINISHED: "TaskRewardStatusUnfinished", + FINISHED: "TaskRewardStatusFinished", + RECEIVED: "TaskRewardStatusReceived", + }; + + /** + * 任务奖励状态类型 + * @since Beta v0.10.0 + */ + type TaskRewardStatusEnum = (typeof TaskRewardStatus)[keyof typeof TaskRewardStatus]; + + /** + * 历练点奖励状态 + * @since Beta v0.10.0 + * @todo 待确认 + */ + const AttendanceRewardStatus = { + UNFINISHED: "AttendanceRewardStatusUnfinished", + TAKEN: "AttendanceRewardStatusTakenAward", + }; + + /** + * 历练点奖励状态类型 + * @since Beta v0.10.0 + */ + type AttendanceRewardStatusEnum = + (typeof AttendanceRewardStatus)[keyof typeof AttendanceRewardStatus]; + + /** + * 参量质变仪状态 + * @since Beta v0.10.0 + * @todo 待确认 + */ + const TransformerStatus = { + OBTAINED: "Obtained", + NOT_OBTAINED: "NotObtained", + }; + + /** + * 参量质变仪状态类型 + * @since Beta v0.10.0 + */ + type TransformerStatusEnum = (typeof TransformerStatus)[keyof typeof TransformerStatus]; }