2025-01-12 16:04:03 +08:00
|
|
|
<template>
|
2026-03-27 23:00:39 +08:00
|
|
|
<div class="fixed left-6 bottom-24 z-[999]">
|
2025-01-12 16:04:03 +08:00
|
|
|
<n-badge :value="downloadingCount" :max="99" :show="downloadingCount > 0">
|
2026-03-27 23:00:39 +08:00
|
|
|
<n-button
|
|
|
|
|
circle
|
|
|
|
|
class="bg-white/80 dark:bg-gray-800/80 shadow-lg backdrop-blur-sm hover:bg-light dark:hover:bg-dark-200 text-gray-600 dark:text-gray-300 transition-all duration-300 w-10 h-10"
|
|
|
|
|
@click="navigateToDownloads"
|
|
|
|
|
>
|
2025-01-12 16:04:03 +08:00
|
|
|
<template #icon>
|
2026-03-27 23:00:39 +08:00
|
|
|
<i class="iconfont ri-download-cloud-2-line text-xl"></i>
|
2025-01-12 16:04:03 +08:00
|
|
|
</template>
|
|
|
|
|
</n-button>
|
|
|
|
|
</n-badge>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-03-27 23:00:39 +08:00
|
|
|
import { computed, onMounted } from 'vue';
|
2025-06-03 22:35:04 +08:00
|
|
|
import { useRouter } from 'vue-router';
|
2025-01-12 16:04:03 +08:00
|
|
|
|
2026-03-27 23:00:39 +08:00
|
|
|
import { useDownloadStore } from '@/store/modules/download';
|
|
|
|
|
|
2025-06-03 22:35:04 +08:00
|
|
|
const router = useRouter();
|
2026-03-27 23:00:39 +08:00
|
|
|
const downloadStore = useDownloadStore();
|
2025-01-12 16:04:03 +08:00
|
|
|
|
2026-03-27 23:00:39 +08:00
|
|
|
const downloadingCount = computed(() => downloadStore.downloadingCount);
|
2025-01-12 16:04:03 +08:00
|
|
|
|
2025-06-03 22:35:04 +08:00
|
|
|
const navigateToDownloads = () => {
|
|
|
|
|
router.push('/downloads');
|
2025-01-12 16:04:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
2026-03-27 23:00:39 +08:00
|
|
|
downloadStore.initListeners();
|
|
|
|
|
downloadStore.loadPersistedQueue();
|
2025-01-12 16:04:03 +08:00
|
|
|
});
|
|
|
|
|
</script>
|