优化maps页面

This commit is contained in:
Kunagisa 2025-06-14 17:37:18 +08:00
parent 1d74f16b33
commit a4376549ba

View File

@ -174,7 +174,7 @@
<button class="jump-btn" @click="handleJumpPage">跳转</button> <button class="jump-btn" @click="handleJumpPage">跳转</button>
</div> </div>
</div> </div>
<button v-if="showBackTop" class="back-to-top-btn" @click="scrollToTop"> <button v-if="showBackTop && isMobile" class="back-to-top-btn" @click="scrollToTop">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M12 19V5" stroke="#2563eb" stroke-width="2" stroke-linecap="round"/><path d="M6 11L12 5L18 11" stroke="#2563eb" stroke-width="2" stroke-linecap="round"/></svg> <svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M12 19V5" stroke="#2563eb" stroke-width="2" stroke-linecap="round"/><path d="M6 11L12 5L18 11" stroke="#2563eb" stroke-width="2" stroke-linecap="round"/></svg>
</button> </button>
</div> </div>
@ -195,6 +195,7 @@ const hasNextPage = ref(false)
const jumpPage = ref('') const jumpPage = ref('')
const viewMode = ref('table') const viewMode = ref('table')
const showBackTop = ref(false) const showBackTop = ref(false)
const isMobile = ref(window.innerWidth <= 700)
// //
const orderOptions = [ const orderOptions = [
@ -334,6 +335,9 @@ onMounted(() => {
tagOptions.value = tags tagOptions.value = tags
}) })
window.addEventListener('scroll', handleScroll) window.addEventListener('scroll', handleScroll)
window.addEventListener('resize', () => {
isMobile.value = window.innerWidth <= 700
})
}) })
onUnmounted(() => { onUnmounted(() => {
window.removeEventListener('scroll', handleScroll) window.removeEventListener('scroll', handleScroll)
@ -717,6 +721,7 @@ onUnmounted(() => {
vertical-align: middle; vertical-align: middle;
} }
.back-to-top-btn { .back-to-top-btn {
display: flex;
position: fixed; position: fixed;
right: 18px; right: 18px;
bottom: 18px; bottom: 18px;
@ -727,7 +732,6 @@ onUnmounted(() => {
background: #fff; background: #fff;
box-shadow: 0 2px 8px rgba(37,99,235,0.12); box-shadow: 0 2px 8px rgba(37,99,235,0.12);
border: none; border: none;
display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;