From b8aec9fbce3414f2e4cf02643f4b64b8a15877bf Mon Sep 17 00:00:00 2001 From: s1xu Date: Tue, 3 Feb 2026 01:16:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E5=A5=96=E5=93=81=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E8=B6=85=E9=95=BF=E6=97=B6=E6=B7=BB=E5=8A=A0=E6=9D=A5?= =?UTF-8?q?=E5=9B=9E=E6=BB=9A=E5=8A=A8=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parts/OfficialPrizeList/index.scss | 15 ++++++++++ .../parts/OfficialPrizeList/index.vue | 13 +++++++-- .../PrizeList/parts/TemporaryList.vue | 29 +++++++++++++++++-- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/src/views/Home/components/PrizeList/parts/OfficialPrizeList/index.scss b/src/views/Home/components/PrizeList/parts/OfficialPrizeList/index.scss index 833331c6a..d4b673e4e 100644 --- a/src/views/Home/components/PrizeList/parts/OfficialPrizeList/index.scss +++ b/src/views/Home/components/PrizeList/parts/OfficialPrizeList/index.scss @@ -137,4 +137,19 @@ to { transform: translateX(-25%); } +} + +.scroll-text { + display: inline-block; + animation: scroll-left 3s ease-in-out infinite alternate; + will-change: transform; +} + +@keyframes scroll-left { + from { + transform: translateX(0); + } + to { + transform: translateX(calc(-100% + 6rem)); + } } \ No newline at end of file diff --git a/src/views/Home/components/PrizeList/parts/OfficialPrizeList/index.vue b/src/views/Home/components/PrizeList/parts/OfficialPrizeList/index.vue index e1d1f6312..438588294 100644 --- a/src/views/Home/components/PrizeList/parts/OfficialPrizeList/index.vue +++ b/src/views/Home/components/PrizeList/parts/OfficialPrizeList/index.vue @@ -24,6 +24,11 @@ const { handleScroll, } = useGsap(scrollContainerRef, liRefs, isScroll, prizeShow, props.temporaryPrizeShow) +// 超过 6 个字符就滚动 +function shouldScroll(name: string) { + return (name || '').length > 6 +} + // 获取ulContainerRef的高度 function getUlContainerHeight() { if (ulContainerRef.value) { @@ -90,12 +95,16 @@ watch ([prizeShow, () => props.temporaryPrizeShow], (val) => { >
-
+

{{ item.name }}

+

+ {{ item.name }} +

{{ item.isUsedCount }}/{{ diff --git a/src/views/Home/components/PrizeList/parts/TemporaryList.vue b/src/views/Home/components/PrizeList/parts/TemporaryList.vue index 107006afd..9a2334bb2 100644 --- a/src/views/Home/components/PrizeList/parts/TemporaryList.vue +++ b/src/views/Home/components/PrizeList/parts/TemporaryList.vue @@ -1,16 +1,23 @@