From b70d03e86bfcab6e7945fd569b56cb481b3b0a39 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 31 Mar 2025 13:03:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20TorrentCard=20=E5=92=8C=20?= =?UTF-8?q?TorrentItem=20=E7=BB=84=E4=BB=B6=E7=9A=84=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E8=BF=87=E6=BB=A4=E5=99=A8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=20UI=20=E7=BB=84=E4=BB=B6=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/TorrentCard.vue | 8 ++-- src/components/cards/TorrentItem.vue | 4 -- src/views/torrent/TorrentCardListView.vue | 19 +++----- src/views/torrent/TorrentRowListView.vue | 53 ++++------------------- 4 files changed, 16 insertions(+), 68 deletions(-) diff --git a/src/components/cards/TorrentCard.vue b/src/components/cards/TorrentCard.vue index b459dba2..8f30f1e6 100644 --- a/src/components/cards/TorrentCard.vue +++ b/src/components/cards/TorrentCard.vue @@ -103,13 +103,12 @@ onMounted(() => { @@ -495,7 +486,7 @@ function loadMore({ done }: { done: any }) { @@ -526,7 +517,7 @@ function loadMore({ done }: { done: any }) { class="filter-btn-mobile" @click="toggleFilterMenu(key)" > - + {{ title }} @@ -765,7 +756,7 @@ function loadMore({ done }: { done: any }) { } .filter-label { - font-size: 0.7rem; + font-size: 0.8rem; text-align: center; } diff --git a/src/views/torrent/TorrentRowListView.vue b/src/views/torrent/TorrentRowListView.vue index 1be8fe5f..e76ae759 100644 --- a/src/views/torrent/TorrentRowListView.vue +++ b/src/views/torrent/TorrentRowListView.vue @@ -60,15 +60,6 @@ const filterOptions: Record = reactive({ releaseGroup: [] as string[], }) -// 非空值的过滤选项 -const filterOptionsNotEmpty = computed(() => { - const options: Record = {} - for (const key in filterOptions) { - if (filterOptions[key].length > 0) options[key] = filterOptions[key] - } - return options -}) - // 对季过滤选项进行排序 const sortSeasonFilterOptions = computed(() => { // 预解析所有选项 @@ -187,13 +178,6 @@ const sortSeasonFilterOptions = computed(() => { return parsedOptions.map(option => option.original) }) -// 列表样式 -const listStyle = computed(() => { - return appMode - ? 'height: calc(100vh - 7.5rem - env(safe-area-inset-bottom) - 3.5rem)' - : 'height: calc(100vh - 6.5rem - env(safe-area-inset-bottom)' -}) - // 排序字段 const sortField = ref('default') @@ -277,7 +261,6 @@ watchEffect(() => { if (props.items?.length) { // 首先收集所有过滤选项 props.items.forEach(data => { - const { meta_info, torrent_info } = data initOptions(data) }) @@ -306,19 +289,8 @@ watchEffect(() => { } }) -// 切换过滤器选项 -function toggleFilter(key: string, value: string) { - const index = filterForm[key].indexOf(value) - if (index === -1) { - filterForm[key].push(value) - } else { - filterForm[key].splice(index, 1) - } -} - // 过滤菜单相关 const filterMenuOpen = ref(false) -const filterMenuAnchor = ref(null) const currentFilter = ref('site') const currentFilterTitle = computed(() => filterTitles[currentFilter.value]) const currentFilterOptions = computed(() => { @@ -328,12 +300,6 @@ const currentFilterOptions = computed(() => { return filterOptions[currentFilter.value] }) -// 打开过滤菜单 -function openFilterMenu(key: string) { - currentFilter.value = key - filterMenuOpen.value = true -} - // 给定过滤类型返回不同图标 function getFilterIcon(key: string) { const icons: Record = { @@ -417,9 +383,9 @@ function toggleFilterMenu(key: string) { rounded="pill" > {{ title }} - {{ - filterForm[key].length - }} + + {{ filterForm[key].length }} + @@ -452,7 +418,7 @@ function toggleFilterMenu(key: string) { class="me-1 mb-1 mt-1 filter-tag" @click:close="removeFilter(key, value)" > - + {{ filterTitles[key] }}: {{ value }} @@ -469,7 +435,7 @@ function toggleFilterMenu(key: string) { @@ -500,7 +466,7 @@ function toggleFilterMenu(key: string) { class="filter-btn-mobile" @click="toggleFilterMenu(key)" > - + {{ title }} @@ -571,6 +537,7 @@ function toggleFilterMenu(key: string) {
+
@@ -741,15 +708,11 @@ function toggleFilterMenu(key: string) { } .filter-label { - font-size: 0.7rem; + font-size: 0.8rem; text-align: center; } @media (max-width: 600px) { - .filter-btn { - font-size: 0.75rem; - } - .sort-select { min-width: 100px; }