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(() => {