From f0b2d1450241dab7097c8e092a14ccd09485d1d9 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 29 Mar 2025 20:50:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=20TorrentCard=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BB=A5=E6=94=AF=E6=8C=81=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E5=9B=BE=E6=A0=87=E7=9A=84=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=92=8C=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/TorrentCard.vue | 29 ++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/cards/TorrentCard.vue b/src/components/cards/TorrentCard.vue index 2fb6fc3c..52d35d44 100644 --- a/src/components/cards/TorrentCard.vue +++ b/src/components/cards/TorrentCard.vue @@ -30,7 +30,7 @@ const meta = ref(props.torrent?.meta_info) const downloadItem = ref(props.torrent) // 站点图标 -const siteIcon = ref('') +const siteIcons = ref>({}) // 存储是否已经下载过的记录 const downloaded = ref([]) @@ -51,9 +51,10 @@ function addDownloadError(error: string) { } // 查询站点图标 -async function getSiteIcon() { +async function getSiteIcon(site: number | undefined) { + if (!site) return try { - siteIcon.value = (await api.get(`site/icon/${torrent?.value?.site}`)).data.icon + siteIcons.value[site] = (await api.get(`site/icon/${site}`)).data.icon } catch (error) { console.error(error) } @@ -87,9 +88,17 @@ function getPromotionClass(downloadVolumeFactor: number | undefined, uploadVolum else return '' } +// 打开更多来源对话框 +async function openMoreTorrentsDialog() { + props.more?.forEach(t => { + return getSiteIcon(t.torrent_info?.site) + }) + showMoreTorrents.value = true +} + // 装载时查询站点图标 onMounted(() => { - getSiteIcon() + getSiteIcon(props.torrent?.torrent_info?.site) }) @@ -124,7 +133,7 @@ onMounted(() => {
- + {{ torrent?.site_name?.substring(0, 1) }} {{ torrent?.site_name }}
@@ -171,7 +180,7 @@ onMounted(() => {