diff --git a/src/components/userGacha/gro-data-line.vue b/src/components/userGacha/gro-data-line.vue index 00c3421b..65a9fb4f 100644 --- a/src/components/userGacha/gro-data-line.vue +++ b/src/components/userGacha/gro-data-line.vue @@ -1,3 +1,4 @@ + @@ -10,7 +11,7 @@ {{ props.count }} - {{ hint }} + {{ props.isUp ? "UP" : "歪" }} @@ -18,12 +19,19 @@ import { getWikiBrief } from "@utils/toolFunc.js"; import { computed } from "vue"; -import { AppGachaData } from "@/data/index.js"; - -export type GroDataLineProps = { data: TGApp.Sqlite.GachaRecords.TableGacha; count: number }; +/** + * 祈愿数据项展示行组件参数 + */ +export type GroDataLineProps = { + /* 原始数据 */ + data: TGApp.Sqlite.GachaRecords.TableGacha; + /* 抽数 */ + count: number; + /* 是否是 Up */ + isUp: boolean | undefined; +}; const props = defineProps(); -const hint = getEndHint(); function getIcon(): string { const find = getWikiBrief(props.data.itemId); @@ -32,32 +40,11 @@ function getIcon(): string { return `/WIKI/weapon/${props.data.itemId}.webp`; } -function getEndHint(): string { - if (props.data.gachaType === "100" || props.data.gachaType === "200") return ""; - // if (props.data.rank !== "5") return ""; - const itemTime = new Date(props.data.time).getTime(); - const poolsFind = AppGachaData.filter((pool) => { - if (pool.type.toLocaleString() !== props.data.gachaType) return false; - const startTime = new Date(pool.from).getTime(); - const endTime = new Date(pool.to).getTime(); - return itemTime >= startTime && itemTime <= endTime; - }); - if (poolsFind.length === 0) return ""; - if (props.data.rank === "5") { - if (poolsFind.some((pool) => pool.up5List.includes(Number(props.data.itemId)))) return "UP"; - return "歪"; - } - if (props.data.rank === "4") { - if (poolsFind.some((pool) => pool.up4List.includes(Number(props.data.itemId)))) return "UP"; - return "歪"; - } - return ""; -} - const progressColor = computed(() => { - if (hint === "UP" && props.data.rank === "5") return "#d19a66"; - if (hint === "UP" && props.data.rank === "4") return "#c678dd"; - if (hint === "歪") return "#e06c75"; + if (props.isUp === undefined) return "#61afef"; + if (props.isUp && props.data.rank === "5") return "#d19a66"; + if (props.isUp && props.data.rank === "4") return "#c678dd"; + if (!props.isUp) return "#e06c75"; return "#61afef"; }); const progressWidth = computed(() => { diff --git a/src/components/userGacha/gro-data-view.vue b/src/components/userGacha/gro-data-view.vue index 703a8bc6..d0e4df06 100644 --- a/src/components/userGacha/gro-data-view.vue +++ b/src/components/userGacha/gro-data-view.vue @@ -1,51 +1,61 @@ - - - {{ title }} - {{ props.dataVal.length }} - - - 暂无数据 - {{ startDate }} ~ {{ endDate }} - - - - ★★★★ - - 已垫 - {{ reset4count - 1 }} + + + + {{ title }} + {{ props.dataVal.length }} - - 平均 - {{ star4avg }} + + 暂无数据 + {{ startDate }} ~ {{ endDate }} - - 统计 - {{ star4List.length }} + + + ★★★★ + + 垫 + {{ reset4count - 1 }} + + + 均 + {{ star4avg }} + + + UP + {{ star4UpAvg }} + + + 总 + {{ star4List.length }} + - - - - ★★★★★ - - 已垫 - {{ reset5count - 1 }} + + + ★★★★★ + + 垫 + {{ reset5count - 1 }} + + + 均 + {{ star5avg }} + + + UP + {{ star5UpAvg }} + + + 总 + {{ star5List.length }} + - - 平均 - {{ star5avg }} + + + + + - - 统计 - {{ star5List.length }} - - - - - - - @@ -57,14 +67,24 @@ - + - + @@ -73,10 +93,12 @@