From 4d975417daf2f7223bdda560c7ee1fcd9b02c3e2 Mon Sep 17 00:00:00 2001 From: zoujing Date: Tue, 28 Apr 2026 13:59:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E4=BA=86=E6=97=A0?= =?UTF-8?q?=E9=99=90=E8=BD=AE=E6=92=AD=E7=9A=84=E5=B1=95=E7=A4=BA=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Discovery/components/CardSwiper/index.vue | 420 ++++++++++++++++++ .../components/CardSwiper/styles/index.scss | 97 ++++ src/pages/Discovery/index.vue | 57 ++- 3 files changed, 566 insertions(+), 8 deletions(-) create mode 100644 src/pages/Discovery/components/CardSwiper/index.vue create mode 100644 src/pages/Discovery/components/CardSwiper/styles/index.scss diff --git a/src/pages/Discovery/components/CardSwiper/index.vue b/src/pages/Discovery/components/CardSwiper/index.vue new file mode 100644 index 0000000..8d0fb4d --- /dev/null +++ b/src/pages/Discovery/components/CardSwiper/index.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/src/pages/Discovery/components/CardSwiper/styles/index.scss b/src/pages/Discovery/components/CardSwiper/styles/index.scss new file mode 100644 index 0000000..c056c9a --- /dev/null +++ b/src/pages/Discovery/components/CardSwiper/styles/index.scss @@ -0,0 +1,97 @@ +.card-swiper { + width: 100%; +} + +.swiper-stage { + position: relative; + width: 100%; + height: 278px; + overflow: hidden; +} + +.swiper-card { + position: absolute; + left: 50%; + top: 50%; + width: 236px; + height: 234px; + max-width: calc(100% - 56px); + transform-origin: center center; + will-change: transform, opacity; +} + +.card-shell { + position: relative; + width: 100%; + height: 100%; + padding: 8px; + box-sizing: border-box; + overflow: hidden; + border-radius: 24px; + background: #ffffff; + box-shadow: 0 12px 20px rgba(15, 23, 42, 0.14); +} + +.card-media { + width: 100%; + height: 142px; + margin: 0; + overflow: hidden; + border-radius: 20px; +} + +.card-image { + width: 100%; + height: 100%; + display: block; +} + +.card-body { + padding: 0 8px; +} + +.card-tag { + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 12px; + min-width: 50px; + max-width: 100%; + height: 18px; + padding: 0 8px; + border-radius: 4px; + background: #fff4db; + color: #d78621; + font-size: 9px; + font-weight: 600; +} + +.card-title { + margin-top: 6px; + color: #172033; + font-size: 16px; + line-height: 1.2; + font-weight: 700; +} + +.card-desc { + margin-top: 2px; + color: #7f8ea3; + font-size: 12px; + line-height: 18px; +} + +.card-mask { + position: absolute; + inset: 0; + background: rgba(255, 255, 255, 0.42); + pointer-events: none; +} + +.is-current .card-shell { + box-shadow: 0 12px 20px rgba(15, 23, 42, 0.18); +} + +.is-single .swiper-stage { + overflow: visible; +} diff --git a/src/pages/Discovery/index.vue b/src/pages/Discovery/index.vue index 3a82b7a..029e44f 100644 --- a/src/pages/Discovery/index.vue +++ b/src/pages/Discovery/index.vue @@ -1,22 +1,63 @@ \ No newline at end of file +