mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-04-30 23:19:36 +08:00
⚡️ 一些优化
*修正琳妮特unread链接 *修复数据概览高度溢出 *调整生日组件样式
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
<span>今天是{{ cur.map((i) => i.name).join("、") }}的生日哦~</span>
|
||||
</div>
|
||||
<div>即将到来:{{ next[0].role_birthday }}</div>
|
||||
<div v-for="i in next" :key="i.role_id" class="tcb-item" @click="toBirth(i)">
|
||||
<img :src="i.head_icon" :alt="i.introduce" />
|
||||
<div v-for="i in next" :key="i.role_id" class="tcb-item">
|
||||
<img :src="i.head_icon" :alt="i.name" @click="toBirth(i)" />
|
||||
<div class="tcb-item-info">
|
||||
<span>{{ i.name }} 所属:{{ i.belong }}</span>
|
||||
<span>{{ i.text }}</span>
|
||||
<span>{{ i.introduce }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="tc-content">
|
||||
<TCalendarBirth />
|
||||
<div class="calendar-grid">
|
||||
<div v-for="item in getGrid()" :key="item.id" @click="selectItem(item)">
|
||||
<div v-for="item in renderItems" :key="item.id" @click="selectItem(item)">
|
||||
<TibCalendarItem
|
||||
:data="<TGApp.App.Calendar.Item>item"
|
||||
:model="switchType"
|
||||
@@ -43,7 +43,7 @@
|
||||
<ToCalendar v-model="showItem" :data-type="selectedType" :data-val="selectedItem" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
|
||||
import TCalendarBirth from "./t-calendar-birth.vue";
|
||||
import THomeCard from "./t-homecard.vue";
|
||||
@@ -70,6 +70,7 @@ const showItem = ref<boolean>(false);
|
||||
const switchType = ref<"avatar" | "weapon">("avatar");
|
||||
const selectedItem = ref<TGApp.App.Calendar.Item>(<TGApp.App.Calendar.Item>{});
|
||||
const selectedType = ref<"avatar" | "weapon">("avatar");
|
||||
const renderItems = ref<TGApp.App.Calendar.Item[]>([]);
|
||||
|
||||
const btnText = [
|
||||
{
|
||||
@@ -126,9 +127,28 @@ onMounted(async () => {
|
||||
calendarNow.value = getCalendar(dayNow);
|
||||
characterCards.value = calendarNow.value.filter((item) => item.itemType === "character");
|
||||
weaponCards.value = calendarNow.value.filter((item) => item.itemType === "weapon");
|
||||
renderItems.value = getGrid();
|
||||
emits("success");
|
||||
});
|
||||
|
||||
watch(
|
||||
() => page.value,
|
||||
() => {
|
||||
renderItems.value = getGrid();
|
||||
},
|
||||
);
|
||||
|
||||
watch(
|
||||
() => switchType.value,
|
||||
() => {
|
||||
if (page.value !== 1) {
|
||||
page.value = 1;
|
||||
} else {
|
||||
renderItems.value = getGrid();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// 获取当前日历
|
||||
function getCalendar(day: number): TGApp.App.Calendar.Item[] {
|
||||
return AppCalendarData.filter((item) => item.dropDays.includes(day));
|
||||
|
||||
Reference in New Issue
Block a user