From 1d74f16b33e59be856b2dcba25a2d2d80babfc93 Mon Sep 17 00:00:00 2001 From: Kunagisa <1549184870@qq.com> Date: Sat, 14 Jun 2025 15:38:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96maps=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index/Maps.vue | 636 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 592 insertions(+), 44 deletions(-) diff --git a/src/views/index/Maps.vue b/src/views/index/Maps.vue index ff9293f..aaa47de 100644 --- a/src/views/index/Maps.vue +++ b/src/views/index/Maps.vue @@ -2,34 +2,78 @@
-
- 搜索: - - 玩家数: - - 分类: - - 排序: -
-
+
+
+ + + + + + + +
+
+ + +
+
+
@@ -62,6 +106,28 @@
+
暂无此地图
+
+
+
+
+ +
+
{{ map.chinese_name }}
+
作者:{{ map.user }}
+
+ 下载:{{ map.download_count }} + 收藏:{{ map.favourite_count }} + 玩家:{{ map.player_count }} +
+
{{ formatDate(map.create_time) }}
+
+ {{ tag }} +
+
+
+
+
暂无此地图
@@ -71,7 +137,8 @@ :disabled="currentPage === 1" @click="changePage(currentPage - 1)" > - 上一页 + 上一页 +
@@ -81,9 +148,7 @@ class="page-number" :class="{ active: page === currentPage }" @click="changePage(page)" - > - {{ page }} - + >{{ page }} {{ page }}
@@ -93,7 +158,8 @@ :disabled="!hasNextPage" @click="changePage(currentPage + 1)" > - 下一页 + 下一页 +
@@ -108,11 +174,14 @@
+
@@ -326,4 +411,467 @@ onMounted(() => { .jump-btn:hover { background: #1a237e; } +.page-header { + display: block; + position: relative; + margin-bottom: 30px; +} +.page-header h1 { + margin-bottom: 0; +} +.view-toggle-group { + display: flex; + border-radius: 8px; + overflow: hidden; + border: none; +} +.view-toggle-btn { + background: #f5f7fa; + color: #2563eb; + border: none; + padding: 6px 22px; + font-size: 15px; + font-weight: 500; + cursor: pointer; + transition: background 0.2s, color 0.2s; + outline: none; +} +.view-toggle-btn.active { + background: #2563eb; + color: #fff; + z-index: 1; +} +.view-toggle-btn:not(.active):hover { + background: #e3f0ff; + color: #1a237e; +} +.view-toggle-btn:first-child { + border-right: 1px solid #2563eb22; +} +.view-toggle-btn:last-child { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.card-list-container { + width: 100%; + margin-top: 20px; +} +.card-list { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 20px; +} +.map-card { + background: #fff; + border-radius: 12px; + box-shadow: 0 2px 8px rgba(0,0,0,0.08); + padding: 16px; + cursor: pointer; + transition: box-shadow 0.2s, transform 0.2s; + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + min-width: 0; + height: 280px; + max-height: 280px; + overflow: hidden; +} +.map-card:hover { + box-shadow: 0 4px 16px rgba(37,99,235,0.15); + transform: translateY(-2px) scale(1.03); +} +.card-image { + width: 120px; + height: 120px; + object-fit: contain; + border-radius: 8px; + margin-bottom: 12px; + background: #f5f5f5; + display: block; +} +.card-content { + width: 100%; + display: flex; + flex-direction: column; + align-items: flex-start; + flex: 1; + overflow: hidden; +} +.card-title { + font-size: 18px; + font-weight: bold; + color: #1a237e; + margin-bottom: 2px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.card-author { + font-size: 14px; + color: #666; + margin-bottom: 2px; + white-space: normal; + overflow: visible; + text-overflow: initial; +} +.card-info { + font-size: 13px; + color: #2563eb; + margin-bottom: 2px; + display: flex; + gap: 10px; + white-space: normal; + overflow: visible; + text-overflow: initial; +} +.card-date { + font-size: 12px; + color: #aaa; + margin-bottom: 2px; + white-space: normal; + overflow: visible; + text-overflow: initial; +} +.tags { + display: flex; + flex-wrap: wrap; + gap: 2px; + margin-top: 2px; +} +.tag { + padding: 2px 8px; + background: #f5f7fa; + color: #2563eb; + border-radius: 4px; + font-size: 12px; +} +@media (max-width: 1200px) { + .card-list { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 700px) { + .filters-row { + flex-direction: column; + align-items: stretch; + gap: 8px; + } + .filters { + flex-direction: column; + align-items: stretch; + gap: 8px; + width: 100%; + } + .search-box { + width: 100%; + margin-bottom: 0; + } + .search-input { + width: 100%; + min-width: 0; + font-size: 15px; + } + .filter-select { + width: 100%; + font-size: 15px; + margin-bottom: 0; + } + .view-toggle-group.icon-group { + margin-top: 4px; + justify-content: center; + width: 100%; + } + .icon-btn { + min-width: 40px; + height: 40px; + } + .filters label { + margin-bottom: 2px; + font-size: 14px; + } + .search-label { + display: none !important; + } + .header-toggle-group { + display: flex !important; + position: static; + justify-content: flex-end; + margin-top: 12px; + margin-bottom: 10px; + width: 100%; + background: none; + box-shadow: none; + } + .filters-toggle-group { + display: none !important; + } + .page-header { + display: block; + position: relative; + margin-bottom: 0; + } + .card-list { + grid-template-columns: 1fr; + width: 100%; + } + .map-card { + width: 100%; + min-width: 0; + max-width: 100%; + margin: 0 auto; + box-sizing: border-box; + height: auto; + max-height: none; + padding: 16px 16px 24px 16px; + border-radius: 12px; + box-shadow: 0 2px 8px rgba(0,0,0,0.08); + display: flex; + flex-direction: column; + align-items: center; + } + .card-image { + width: 120px; + height: 120px; + margin-bottom: 12px; + object-fit: contain; + border-radius: 8px; + background: #f5f5f5; + display: block; + margin-left: auto; + margin-right: auto; + } + .card-content { + width: 100%; + display: flex; + flex-direction: column; + align-items: flex-start; + flex: 1; + overflow: hidden; + } + .card-title { + font-size: 18px; + font-weight: bold; + color: #1a237e; + margin-bottom: 4px; + white-space: normal; + overflow: visible; + text-overflow: initial; + text-align: left; + word-break: break-all; + } + .card-author { + font-size: 14px; + color: #666; + margin-bottom: 6px; + white-space: normal; + overflow: visible; + text-overflow: initial; + text-align: left; + } + .card-info { + font-size: 13px; + color: #2563eb; + margin-bottom: 6px; + display: flex; + gap: 10px; + white-space: normal; + overflow: visible; + text-overflow: initial; + text-align: left; + } + .card-date { + font-size: 12px; + color: #aaa; + margin-bottom: 6px; + white-space: normal; + overflow: visible; + text-overflow: initial; + text-align: left; + } + .tags { + display: flex; + flex-wrap: wrap; + gap: 4px; + margin-top: 2px; + width: 100%; + justify-content: flex-start; + margin-bottom: 0; + } + .tag { + padding: 4px 8px; + background: #f5f7fa; + color: #2563eb; + border-radius: 4px; + font-size: 12px; + } + .page-jump { + display: none !important; + } + .page-btn-text.desktop-only { + display: none !important; + } + .page-btn-arrow.mobile-only { + display: inline !important; + font-size: 20px; + vertical-align: middle; + } + .back-to-top-btn { + position: fixed; + right: 18px; + bottom: 18px; + z-index: 999; + width: 48px; + height: 48px; + border-radius: 50%; + background: #fff; + box-shadow: 0 2px 8px rgba(37,99,235,0.12); + border: none; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: background 0.2s; + } + .back-to-top-btn:hover { + background: #e3f0ff; + } + .back-to-top-btn svg { + display: block; + } +} +@media (min-width: 701px) { + .header-toggle-group { + display: none !important; + } + .filters-toggle-group { + display: flex !important; + } + .page-btn-text.desktop-only { + display: inline !important; + } + .page-btn-arrow.mobile-only { + display: none !important; + } +} +.filters-row { + display: flex; + align-items: flex-start; + justify-content: space-between; + margin-bottom: 12px; +} +.icon-group { + display: flex; + align-items: center; + height: 36px; + margin-top: 2px; +} +.icon-btn { + padding: 4px 8px; + min-width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + background: #f5f7fa; + color: #2563eb; + border: none; + border-radius: 0; + font-size: 16px; + transition: background 0.2s, color 0.2s; + outline: none; +} +.icon-btn.active { + background: #2563eb; + color: #fff; +} +.icon-btn:not(.active):hover { + background: #e3f0ff; + color: #1a237e; +} +.icon-btn:first-child { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; + border-right: 1px solid #2563eb22; +} +.icon-btn:last-child { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.search-box { + position: relative; + display: flex; + align-items: center; +} +.search-input { + height: 36px; + line-height: 36px; + padding: 0 36px 0 12px; + font-size: 15px; + border-radius: 6px; + border: 1px solid #ddd; + box-sizing: border-box; + background: #fff; +} +.search-btn-icon { + position: absolute; + right: 6px; + top: 50%; + transform: translateY(-50%); + width: 28px; + height: 28px; + background: #fff; + border: none; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + padding: 0; + transition: background 0.2s; +} +.search-btn-icon:hover { + background: #e3f0ff; +} +.search-btn-icon svg { + display: block; +} +.empty-tip { + text-align: center; + color: #aaa; + font-size: 18px; + margin: 32px 0 24px 0; + letter-spacing: 2px; +} +.clear-btn { + position: absolute; + right: 38px; + top: 50%; + transform: translateY(-50%); + width: 24px; + height: 24px; + background: transparent; + border: none; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + padding: 0; + transition: background 0.2s; + z-index: 2; +} +.clear-btn:hover { + background: #f5f5f5; +} +.clear-btn svg { + display: block; +} +.search-label { + font-size: 15px; + color: #222; + margin-right: 6px; + white-space: nowrap; + display: inline-block; +} \ No newline at end of file