From d9cdea967026c6434ed23c8131c05e89cb221c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Thu, 11 Apr 2024 00:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=A7=92=E8=89=B2=E7=94=9F=E6=97=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/t-calendar-birth.vue | 27 +++++++++++++++++------ src/pages/common/News.vue | 5 ++++- src/plugins/Sqlite/modules/avatarBirth.ts | 16 ++++++++++++-- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/components/home/t-calendar-birth.vue b/src/components/home/t-calendar-birth.vue index 8f436e71..5bef965f 100644 --- a/src/components/home/t-calendar-birth.vue +++ b/src/components/home/t-calendar-birth.vue @@ -4,13 +4,14 @@ empty 今天没有角色过生日哦~ -
- empty +
+ empty 今天是{{ cur.map((i) => i.name).join("、") }}的生日哦~ +
即将到来:{{ next[0].role_birthday }}
- +
{{ i.name }} 所属:{{ i.belong }} {{ i.introduce }} @@ -38,10 +39,6 @@ onBeforeMount(async () => { next.value = TSAvatarBirth.getNextAvatarBirth(); }); -async function toPost() { - await router.push("/news/2"); -} - function toBirth(type: TGApp.Archive.Birth.RoleItem | true) { let dateStr; if (type === true) { @@ -52,6 +49,14 @@ function toBirth(type: TGApp.Archive.Birth.RoleItem | true) { } else { dateStr = type.role_birthday; } + if (type != true) { + router.push({ name: "留影叙佳期", params: { date: dateStr } }); + return; + } + if (cur.value.length > 0 && !cur.value[0].is_subscribe) { + router.push("/news/2/news"); + return; + } router.push({ name: "留影叙佳期", params: { date: dateStr } }); } @@ -87,6 +92,14 @@ function toBirth(type: TGApp.Archive.Birth.RoleItem | true) { cursor: pointer; } +.tcb-top-active img.tcb-cur { + width: 50px; + height: 50px; + border-radius: 50%; + margin-left: 5px; + background: var(--common-shadow-1); +} + .tcb-item { position: relative; display: flex; diff --git a/src/pages/common/News.vue b/src/pages/common/News.vue index 891488d2..1a2381b6 100644 --- a/src/pages/common/News.vue +++ b/src/pages/common/News.vue @@ -79,7 +79,7 @@ type RawData = { // 路由 const router = useRouter(); const gid = useRoute().params.gid; - +let type = useRoute().params.type; // loading const loading = ref(true); const loadingTitle = ref("正在加载"); @@ -120,6 +120,9 @@ const rawData = ref({ onMounted(async () => { await TGLogger.Info(`[News][${gid}][onMounted] 打开咨讯页面`); const typeList = ["notice", "activity", "news"]; + if (type != undefined) { + appStore.recentNewsType = type; + } const curType = appStore.recentNewsType; if (typeList.includes(curType)) { tab.value = curType; diff --git a/src/plugins/Sqlite/modules/avatarBirth.ts b/src/plugins/Sqlite/modules/avatarBirth.ts index 9888d992..0aaa5371 100644 --- a/src/plugins/Sqlite/modules/avatarBirth.ts +++ b/src/plugins/Sqlite/modules/avatarBirth.ts @@ -4,7 +4,7 @@ * @since Beta v0.4.6 */ -import { ArcBirCalendar, ArcBirRole } from "../../../data"; +import { AppCharacterData, ArcBirCalendar, ArcBirRole } from "../../../data"; /** * @description 判断今天是不是角色生日 @@ -16,7 +16,19 @@ function isAvatarBirth(): TGApp.Archive.Birth.CalendarItem[] { const month = date.getMonth() + 1; const day = date.getDate(); const days = ArcBirCalendar[month]; - return days.filter((i) => i.role_birthday === `${month}/${day}`); + const find = days.filter((i) => i.role_birthday === `${month}/${day}`); + if (find.length > 0) return find.map((i) => (i.is_subscribe = true)); + const find2 = AppCharacterData.filter((i) => i.birthday.toString() === [month, day].toString()); + return find2.map( + (i) => + { + role_id: i.id, + name: i.name, + role_birthday: `${month}/${day}`, + head_icon: `/WIKI/character/${i.id}.webp`, + is_subscribe: false, + }, + ); } /**