From 8d5cb52320786864af415534ea82a77d07d5a4be Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 12:57:54 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E7=A5=88=E6=84=BF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0UP=E6=8A=BD=E6=95=B0=E6=95=B0=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?=E9=87=87=E5=8F=96=E5=8A=A8=E6=80=81=E9=AB=98=E5=BA=A6=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=20(#174)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial plan * feat: Add UP average pull count for 5-star items in gacha records Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * refactor: Optimize isStar5Up function by extracting Number conversion Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * refactor: Add 4-star UP average and optimize hint calculation - Add star4UpAvg variable and getStar4UpAvg() for 4-star UP average - Add getItemHint() to calculate UP/歪 hint for both 4 and 5-star items - Calculate hints in gro-data-view and pass via hint prop to gro-data-line - Remove duplicate getEndHint() calculation from gro-data-line.vue - Add UP average display in 4-star section with dynamic grid layout Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * ♻️ 调整传递数据类型,样式适配调整 * 💄 微调高度 * fix: Use flexbox for dynamic height calculation in gro-data-view Replace hardcoded height calculations with flexbox layout: - Make gro-dv-container a flex column container - Use flex: 1 for gro-bottom and gro-bottom-window to take remaining space - Add min-height: 0 to enable proper flex shrinking for scrollable areas Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * fix: Resolve v-window height overflow issue - Add overflow: hidden to .gro-bottom and .gro-bottom-window containers - Move overflow-y: auto scrolling to .gro-b-window-item level - Add height: 100% to .gro-b-window-item for proper containment Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * fix: Use dynamic height calculation via template refs - Add template refs for container and header elements - Calculate bottom and window heights dynamically based on actual DOM element sizes - Remove flexbox approach that didn't work with Vuetify v-window - Apply calculated heights via style binding Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> * 🎨 useTemplateRef & v-bind --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BTMuli <72692909+BTMuli@users.noreply.github.com> Co-authored-by: BTMuli --- src/components/userGacha/gro-data-line.vue | 47 ++--- src/components/userGacha/gro-data-view.vue | 217 ++++++++++++++++----- 2 files changed, 181 insertions(+), 83 deletions(-) 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 @@ + @@ -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 @@