diff --git a/backend/services/artist.js b/backend/services/artist.js index d51f1b8..ac59340 100644 --- a/backend/services/artist.js +++ b/backend/services/artist.js @@ -55,12 +55,15 @@ class ArtistService { `/v1/user/illusts?${stringify(params)}` ); + console.log('Artworks response keys:', Object.keys(response)); + console.log('Artworks count:', response.illusts?.length || 0); + console.log('Next URL:', response.next_url); + return { success: true, data: { artworks: response.illusts, - next_url: response.next_url, - total: response.illusts.length + next_url: response.next_url } }; diff --git a/backend/services/download.js b/backend/services/download.js index ff723c6..037fd09 100644 --- a/backend/services/download.js +++ b/backend/services/download.js @@ -774,6 +774,9 @@ class DownloadService { allArtworks.push(...artworks); offset += artworks.length; + // 基于 next_url 判断是否还有更多页面 + hasMore = !!artworksResult.data.next_url; + // 添加延迟避免请求过于频繁 await new Promise(resolve => setTimeout(resolve, 500)); } diff --git a/package.json b/package.json index 1482389..1a08268 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "backend", "download" ], - "author": "Your Name", + "author": "kjqwer", "license": "MIT", "engines": { "node": ">=16.0.0" diff --git a/ui/src/views/ArtistView.vue b/ui/src/views/ArtistView.vue index 58115cf..ea911da 100644 --- a/ui/src/views/ArtistView.vue +++ b/ui/src/views/ArtistView.vue @@ -9,6 +9,16 @@ + +
+
+ + + + {{ downloadSuccess }} +
+
+
@@ -30,9 +40,23 @@ - +
+
+ + +
+ +
@@ -65,7 +89,7 @@

作品列表

- @@ -90,10 +114,47 @@

暂无作品

-
- + +
+ +
+ + +
+ + +
+ 第 {{ currentPage }} 页,共 {{ totalPages }} 页 + 共 {{ totalCount }} 个作品
@@ -102,7 +163,7 @@ @@ -302,6 +517,42 @@ onMounted(async () => { min-height: 400px; } +.success-message { + position: fixed; + top: 2rem; + right: 2rem; + background: #10b981; + color: white; + padding: 1rem 1.5rem; + border-radius: 0.5rem; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); + z-index: 1000; + animation: slideIn 0.3s ease-out; +} + +.success-content { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.success-icon { + width: 1.25rem; + height: 1.25rem; + flex-shrink: 0; +} + +@keyframes slideIn { + from { + transform: translateX(100%); + opacity: 0; + } + to { + transform: translateX(0); + opacity: 1; + } +} + .artist-header { background: white; border-radius: 1rem; @@ -356,6 +607,35 @@ onMounted(async () => { gap: 1rem; } +.download-section { + display: flex; + flex-direction: column; + gap: 0.75rem; +} + +.download-input-group { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.download-input-group label { + font-size: 0.875rem; + color: #374151; + font-weight: 500; + white-space: nowrap; +} + +.download-select { + padding: 0.5rem 0.75rem; + border: 1px solid #d1d5db; + border-radius: 0.375rem; + background: white; + font-size: 0.875rem; + color: #374151; + min-width: 100px; +} + .btn { display: inline-flex; align-items: center; @@ -471,8 +751,81 @@ onMounted(async () => { color: #6b7280; } -.load-more { - text-align: center; +/* 分页样式 */ +.pagination { + display: flex; + justify-content: center; + align-items: center; + gap: 1rem; + margin-bottom: 1rem; +} + +.page-btn { + display: flex; + align-items: center; + gap: 0.5rem; + padding: 0.75rem 1rem; + border: 1px solid #d1d5db; + border-radius: 0.5rem; + background: white; + color: #374151; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} + +.page-btn:hover:not(:disabled) { + background: #f3f4f6; + border-color: #9ca3af; +} + +.page-btn:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.page-icon { + width: 1.25rem; + height: 1.25rem; +} + +.page-numbers { + display: flex; + gap: 0.5rem; +} + +.page-number { + display: flex; + align-items: center; + justify-content: center; + width: 2.5rem; + height: 2.5rem; + border: 1px solid #d1d5db; + border-radius: 0.5rem; + background: white; + color: #374151; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} + +.page-number:hover { + background: #f3f4f6; + border-color: #9ca3af; +} + +.page-number.active { + background: #3b82f6; + color: white; + border-color: #3b82f6; +} + +.page-info { + display: flex; + justify-content: center; + gap: 2rem; + color: #6b7280; + font-size: 0.875rem; } @media (max-width: 768px) { @@ -494,6 +847,16 @@ onMounted(async () => { flex-direction: row; } + .download-section { + flex-direction: row; + align-items: center; + gap: 1rem; + } + + .download-input-group { + flex-shrink: 0; + } + .btn { flex: 1; } @@ -507,5 +870,20 @@ onMounted(async () => { .artworks-grid { grid-template-columns: 1fr; } + + .pagination { + flex-direction: column; + gap: 1rem; + } + + .page-numbers { + order: -1; + } + + .page-info { + flex-direction: column; + gap: 0.5rem; + text-align: center; + } } \ No newline at end of file diff --git a/ui/src/views/ArtworkView.vue b/ui/src/views/ArtworkView.vue index 8339e0e..5745b41 100644 --- a/ui/src/views/ArtworkView.vue +++ b/ui/src/views/ArtworkView.vue @@ -85,6 +85,16 @@
+