From 120a12edde47b313506fcfac73d2fff690bbdfa5 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 18 Apr 2025 17:46:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20TorrentItem=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=A0=B7=E5=BC=8F=E5=92=8C=E7=BB=93=E6=9E=84?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E6=96=B0=E4=BC=98=E6=83=A0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C=E3=80=82=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=96=B0=E7=9A=84=E4=BC=98=E6=83=A0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=B1=BB=E4=BB=A5=E6=94=AF=E6=8C=81=E4=B8=8D=E5=90=8C=E7=9A=84?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E7=B1=BB=E5=9E=8B=EF=BC=8C=E5=B9=B6=E6=94=B9?= =?UTF-8?q?=E8=BF=9B=E4=BA=86=E5=AA=92=E4=BD=93=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=92=8C=E4=BA=A4=E4=BA=92=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/TorrentItem.vue | 430 ++++++++------------------- 1 file changed, 125 insertions(+), 305 deletions(-) diff --git a/src/components/cards/TorrentItem.vue b/src/components/cards/TorrentItem.vue index 78907136..72d6a512 100644 --- a/src/components/cards/TorrentItem.vue +++ b/src/components/cards/TorrentItem.vue @@ -58,10 +58,19 @@ async function getSiteIcon() { // 获取优惠类型样式 function getPromotionClass(downloadVolumeFactor: number | undefined, uploadVolumeFactor: number | undefined) { - if (!downloadVolumeFactor) return 'free-discount' - if (downloadVolumeFactor === 0) return 'free-discount' - else if (downloadVolumeFactor < 1) return 'percent-discount' - else if (uploadVolumeFactor !== undefined && uploadVolumeFactor > 1) return 'upload-bonus' + if (!downloadVolumeFactor) return 'bg-success' + if (downloadVolumeFactor === 0) return 'bg-success' + else if (downloadVolumeFactor < 1) return 'bg-orange' + else if (uploadVolumeFactor !== undefined && uploadVolumeFactor > 1) return 'bg-purple' + else return '' +} + +// 获取优惠标签类 +function getPromotionChipClass(downloadVolumeFactor: number | undefined, uploadVolumeFactor: number | undefined) { + if (!downloadVolumeFactor) return 'chip-free' + if (downloadVolumeFactor === 0) return 'chip-free' + else if (downloadVolumeFactor < 1) return 'chip-discount' + else if (uploadVolumeFactor !== undefined && uploadVolumeFactor > 1) return 'chip-bonus' else return '' } @@ -95,80 +104,113 @@ onMounted(() => {