还是把生日加回来了,不然太空了

This commit is contained in:
目棃
2024-04-01 00:49:13 +08:00
parent d8ade955b4
commit 4985bcde29
7 changed files with 182 additions and 42 deletions

View File

@@ -0,0 +1,64 @@
<template>
<div class="tcb-container">
<img v-if="!isBirthday" src="/source/UI/empty.webp" alt="empty" />
<img @click="toPost()" v-else src="/source/UI/act_birthday.png" alt="empty" class="active" />
<span>{{
isBirthday ? `今天是 ${cur.map((i) => i.name).join("、")} 的生日!` : "没有角色今天过生日哦~"
}}</span>
<span v-if="next.length > 0"
>即将到来{{ next[0].birthday[0] }}{{ next[0].birthday[1] }}</span
>
<span v-if="next.length > 0">{{ next.map((i) => i.name).join("、") }}</span>
</div>
</template>
<script lang="ts" setup>
import { onBeforeMount, ref } from "vue";
import { useRouter } from "vue-router";
import TSAvatarBirth from "../../plugins/Sqlite/modules/avatarBirth";
const isBirthday = ref<boolean>(false);
const router = useRouter();
const cur = ref<TGApp.Sqlite.Character.AppData[]>([]);
const next = ref<TGApp.App.Character.WikiBriefInfo[]>([]);
onBeforeMount(async () => {
const check = await TSAvatarBirth.isAvatarBirth();
if (check.length !== 0) {
isBirthday.value = true;
cur.value = check;
}
next.value = TSAvatarBirth.getNextAvatarBirth();
});
async function toPost() {
await router.push("/news/2");
}
</script>
<style lang="css" scoped>
.tcb-container {
display: flex;
width: 100%;
height: 100%;
flex-direction: column;
align-items: center;
justify-content: center;
box-shadow: 0 0 5px inset var(--common-shadow-2);
overflow-y: auto;
}
.tcb-container img {
width: 100px;
height: 100px;
}
.tcb-container img.active {
cursor: pointer;
}
span {
display: block;
margin-top: 10px;
text-align: center;
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<THomecard append>
<THomeCard append>
<template #title>今日素材 {{ dateNow }}</template>
<template #title-append>
<v-switch
@@ -26,23 +26,27 @@
</div>
<v-pagination class="tc-page" v-model="page" total-visible="20" :length="length" />
</div>
<div class="calendar-grid">
<div v-for="item in getGrid()" :key="item.id" @click="selectItem(item)">
<TibCalendarItem
:data="<TGApp.App.Calendar.Item>item"
:model="switchType"
:clickable="true"
/>
<div class="tc-content">
<TCalendarBirth />
<div class="calendar-grid">
<div v-for="item in getGrid()" :key="item.id" @click="selectItem(item)">
<TibCalendarItem
:data="<TGApp.App.Calendar.Item>item"
:model="switchType"
:clickable="true"
/>
</div>
</div>
</div>
</template>
</THomecard>
</THomeCard>
<ToCalendar v-model="showItem" :data-type="selectedType" :data-val="selectedItem" />
</template>
<script lang="ts" setup>
import { onMounted, ref } from "vue";
import THomecard from "./t-homecard.vue";
import TCalendarBirth from "./t-calendar-birth.vue";
import THomeCard from "./t-homecard.vue";
import { AppCalendarData } from "../../data";
import TibCalendarItem from "../itembox/tib-calendar-item.vue";
import ToCalendar from "../overlay/to-calendar.vue";
@@ -179,10 +183,20 @@ function getContents(day: number): void {
column-gap: 5px;
}
.tc-content {
position: relative;
display: flex;
height: 210px;
align-items: center;
justify-content: space-between;
column-gap: 10px;
}
.calendar-grid {
display: grid;
height: 100%;
grid-gap: 10px;
grid-template-columns: repeat(10, 1fr);
place-items: center flex-start;
grid-template-columns: repeat(10, 100px);
place-items: flex-start flex-start;
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<THomecard :append="hasNew">
<THomeCard :append="hasNew">
<template #title>限时祈愿</template>
<template #title-append>
<v-switch class="pool-switch" @change="switchPool" />
@@ -50,13 +50,13 @@
</div>
</div>
</template>
</THomecard>
</THomeCard>
</template>
<script lang="ts" setup>
import { ref, onMounted, onUnmounted } from "vue";
import { useRouter } from "vue-router";
import THomecard from "./t-homecard.vue";
import THomeCard from "./t-homecard.vue";
import Mys from "../../plugins/Mys";
import { useHomeStore } from "../../store/modules/home";
import { createPost, createTGWindow } from "../../utils/TGWindow";

View File

@@ -1,5 +1,5 @@
<template>
<THomecard>
<THomeCard>
<template #title>近期活动</template>
<template #default>
<div class="position-grid">
@@ -35,12 +35,12 @@
</v-card>
</div>
</template>
</THomecard>
</THomeCard>
</template>
<script lang="ts" setup>
import { ref, onMounted, onUnmounted } from "vue";
import THomecard from "./t-homecard.vue";
import THomeCard from "./t-homecard.vue";
import Mys from "../../plugins/Mys";
import { createPost } from "../../utils/TGWindow";
import { stamp2LastTime } from "../../utils/toolFunc";