diff --git a/src/components/pageHome/ph-calendar-material.vue b/src/components/pageHome/ph-calendar-material.vue deleted file mode 100644 index 67328743..00000000 --- a/src/components/pageHome/ph-calendar-material.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - {{ item.name }} - - - - diff --git a/src/components/pageHome/ph-calendar-overlay.vue b/src/components/pageHome/ph-calendar-overlay.vue index 9b9efff5..65c8cf63 100644 --- a/src/components/pageHome/ph-calendar-overlay.vue +++ b/src/components/pageHome/ph-calendar-overlay.vue @@ -1,3 +1,4 @@ + @@ -5,23 +6,19 @@ - + 来源: - + - {{ props.dataVal.source.area }} - {{ props.dataVal.source.name }} + {{ props.item.source.area }} - {{ props.item.source.name }} - 详情 + 详情 @@ -31,33 +28,44 @@ import TItemBox, { type TItemBoxData } from "@comp/app/t-itemBox.vue"; import TOverlay from "@comp/app/t-overlay.vue"; import showSnackbar from "@comp/func/snackbar.js"; +import PwMaterialItem from "@comp/pageWiki/pw-material-item.vue"; import { computed } from "vue"; import { useRouter } from "vue-router"; -import TibCalendarMaterial from "./ph-calendar-material.vue"; +import { WikiMaterialData } from "@/data/index.js"; -type ToCalendarProps = { dataType: "weapon" | "character"; dataVal: TGApp.App.Calendar.Item }; +type ToCalendarProps = { item: TGApp.App.Calendar.Item }; const router = useRouter(); const props = defineProps(); const visible = defineModel(); +const materialList = computed>(() => loadData()); const boxData = computed(() => ({ - bg: `/icon/bg/${props.dataVal.star}-Star.webp`, - icon: `/WIKI/${props.dataType}/${props.dataVal.id}.webp`, + bg: `/icon/bg/${props.item.star}-Star.webp`, + icon: `/WIKI/${props.item.itemType}/${props.item.id}.webp`, size: "100px", height: "100px", display: "inner", clickable: false, - lt: props.dataVal.element - ? `/icon/element/${props.dataVal.element}元素.webp` - : `/icon/weapon/${props.dataVal.weapon}.webp`, + lt: props.item.element + ? `/icon/element/${props.item.element}元素.webp` + : `/icon/weapon/${props.item.weapon}.webp`, ltSize: "20px", innerHeight: 25, - innerIcon: props.dataVal.element ? `/icon/weapon/${props.dataVal.weapon}.webp` : undefined, - innerText: props.dataVal.name, + innerIcon: props.item.element ? `/icon/weapon/${props.item.weapon}.webp` : undefined, + innerText: props.item.name, })); +function loadData(): Array { + const tmp: Array = []; + for (const d of props.item.materials) { + const material = WikiMaterialData.find((m) => m.id === d.id); + if (material) tmp.push(material); + } + return tmp; +} + async function toDetail(item: TGApp.App.Calendar.Item): Promise { if (!["character", "weapon"].includes(item.itemType)) { showSnackbar.error("未知类型"); @@ -96,7 +104,7 @@ async function toDetail(item: TGApp.App.Calendar.Item): Promise { display: grid; width: 100%; font-family: var(--font-title); - grid-gap: 10px; + gap: 10px; grid-template-columns: repeat(2, 1fr); } diff --git a/src/components/pageHome/ph-comp-calendar.vue b/src/components/pageHome/ph-comp-calendar.vue index 6950ba1c..e5a2c246 100644 --- a/src/components/pageHome/ph-comp-calendar.vue +++ b/src/components/pageHome/ph-comp-calendar.vue @@ -34,7 +34,7 @@ - +