2026-02-27 16:44:41 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="not-found-container">
|
2026-05-31 18:36:52 +08:00
|
|
|
|
<header class="not-found-topbar">
|
|
|
|
|
|
<button class="not-found-back" type="button" aria-label="返回" @click="handleBackClick">
|
|
|
|
|
|
<LeftOutlined />
|
|
|
|
|
|
</button>
|
2026-06-24 22:13:00 +08:00
|
|
|
|
<strong>{{ BRAND_CONFIG.appName }}</strong>
|
2026-05-31 18:36:52 +08:00
|
|
|
|
<span class="not-found-topbar-spacer" aria-hidden="true"></span>
|
|
|
|
|
|
</header>
|
|
|
|
|
|
|
2026-02-27 16:44:41 +08:00
|
|
|
|
<div class="not-found-content">
|
2026-06-24 22:13:00 +08:00
|
|
|
|
<span class="not-found-kicker">{{ BRAND_CONFIG.appName }}</span>
|
2026-02-27 16:44:41 +08:00
|
|
|
|
<div class="error-code">404</div>
|
2026-05-29 13:30:56 +08:00
|
|
|
|
<h1>这页去做护理了</h1>
|
|
|
|
|
|
<p>您访问的页面不存在或已被删除,我们带您回到首页继续浏览作品。</p>
|
2026-02-27 16:44:41 +08:00
|
|
|
|
<p class="redirect-message">
|
|
|
|
|
|
将在 <span class="countdown">{{ countdown }}</span> 秒后自动跳转到首页...
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<a-button type="primary" @click="redirectToHome">立即前往首页</a-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* NotFoundView page script.
|
|
|
|
|
|
* Call guide: the template binds the reactive state below, and the methods are triggered by button clicks, lifecycle hooks, or router events.
|
|
|
|
|
|
*/
|
2026-02-27 16:44:41 +08:00
|
|
|
|
import { ref, onMounted, onUnmounted } from 'vue'
|
|
|
|
|
|
import { useRouter } from 'vue-router'
|
2026-05-31 18:36:52 +08:00
|
|
|
|
import { LeftOutlined } from '@ant-design/icons-vue'
|
2026-06-24 22:13:00 +08:00
|
|
|
|
import { BRAND_CONFIG } from '@/config/brand'
|
2026-02-27 16:44:41 +08:00
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: router supports NotFoundView.vue by holding or executing the router page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-27 16:44:41 +08:00
|
|
|
|
const router = useRouter()
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/** countdown is a reactive state variable used by the template and event handlers. */
|
2026-02-27 16:44:41 +08:00
|
|
|
|
const countdown = ref(5)
|
|
|
|
|
|
let timer: number | null = null
|
|
|
|
|
|
|
2026-05-31 18:36:52 +08:00
|
|
|
|
const clearRedirectTimer = () => {
|
2026-02-27 16:44:41 +08:00
|
|
|
|
if (timer) {
|
|
|
|
|
|
clearInterval(timer)
|
2026-05-31 18:36:52 +08:00
|
|
|
|
timer = null
|
2026-02-27 16:44:41 +08:00
|
|
|
|
}
|
2026-05-31 18:36:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleBackClick = () => {
|
|
|
|
|
|
clearRedirectTimer()
|
|
|
|
|
|
if (window.history.length > 1) {
|
|
|
|
|
|
router.back()
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
router.push('/home')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** redirectToHome is a local helper used by this page script. */
|
|
|
|
|
|
const redirectToHome = () => {
|
|
|
|
|
|
clearRedirectTimer()
|
2026-02-27 16:44:41 +08:00
|
|
|
|
router.push('/home')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
timer = window.setInterval(() => {
|
|
|
|
|
|
if (countdown.value > 0) {
|
|
|
|
|
|
countdown.value--
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (timer) {
|
|
|
|
|
|
clearInterval(timer)
|
|
|
|
|
|
}
|
|
|
|
|
|
redirectToHome()
|
|
|
|
|
|
}
|
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
2026-05-31 18:36:52 +08:00
|
|
|
|
clearRedirectTimer()
|
2026-02-27 16:44:41 +08:00
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
.not-found-container {
|
2026-05-31 18:36:52 +08:00
|
|
|
|
position: relative;
|
2026-02-27 16:44:41 +08:00
|
|
|
|
min-height: 100vh;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
2026-05-29 13:30:56 +08:00
|
|
|
|
background:
|
|
|
|
|
|
radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--theme-primary) 30%, transparent), transparent 34%),
|
|
|
|
|
|
linear-gradient(180deg, var(--theme-tertiary), color-mix(in srgb, var(--theme-secondary) 14%, var(--theme-tertiary)));
|
2026-02-27 16:44:41 +08:00
|
|
|
|
padding: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-31 18:36:52 +08:00
|
|
|
|
.not-found-topbar {
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 12px;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
z-index: 20;
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: 40px minmax(0, 1fr) 40px;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
width: min(calc(100% - 32px), var(--app-mobile-max-width, 480px));
|
|
|
|
|
|
height: 44px;
|
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.not-found-back {
|
|
|
|
|
|
display: inline-grid;
|
|
|
|
|
|
width: 36px;
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
place-items: center;
|
|
|
|
|
|
border: 1px solid color-mix(in srgb, var(--theme-border) 78%, transparent);
|
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
|
color: var(--theme-primary-action);
|
|
|
|
|
|
background: color-mix(in srgb, var(--theme-card-bg) 88%, transparent);
|
|
|
|
|
|
box-shadow: 0 10px 24px color-mix(in srgb, var(--theme-neutral) 8%, transparent);
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.not-found-topbar strong {
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.not-found-topbar-spacer {
|
|
|
|
|
|
width: 36px;
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-27 16:44:41 +08:00
|
|
|
|
.not-found-content {
|
2026-05-29 13:30:56 +08:00
|
|
|
|
background: color-mix(in srgb, var(--theme-card-bg) 88%, transparent);
|
|
|
|
|
|
border: 1px solid var(--theme-border);
|
|
|
|
|
|
border-radius: 28px;
|
|
|
|
|
|
padding: 48px 28px;
|
2026-02-27 16:44:41 +08:00
|
|
|
|
text-align: center;
|
2026-05-29 13:30:56 +08:00
|
|
|
|
box-shadow: 0 24px 54px color-mix(in srgb, var(--theme-neutral) 12%, transparent);
|
2026-02-27 16:44:41 +08:00
|
|
|
|
max-width: 500px;
|
|
|
|
|
|
width: 100%;
|
2026-05-29 13:30:56 +08:00
|
|
|
|
backdrop-filter: blur(16px);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.not-found-kicker {
|
|
|
|
|
|
color: var(--theme-secondary);
|
|
|
|
|
|
font-family: Georgia, 'Times New Roman', serif;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
font-weight: 800;
|
2026-02-27 16:44:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.error-code {
|
2026-05-29 13:30:56 +08:00
|
|
|
|
font-size: 104px;
|
|
|
|
|
|
font-weight: 900;
|
|
|
|
|
|
color: var(--theme-primary-action);
|
|
|
|
|
|
margin: 10px 0 14px;
|
2026-02-27 16:44:41 +08:00
|
|
|
|
line-height: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.not-found-content h1 {
|
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
|
font-weight: 700;
|
2026-05-29 13:30:56 +08:00
|
|
|
|
color: var(--text-primary);
|
2026-02-27 16:44:41 +08:00
|
|
|
|
margin: 0 0 16px 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.not-found-content p {
|
|
|
|
|
|
font-size: 16px;
|
2026-05-29 13:30:56 +08:00
|
|
|
|
color: var(--text-secondary);
|
2026-02-27 16:44:41 +08:00
|
|
|
|
margin: 0 0 24px 0;
|
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.redirect-message {
|
|
|
|
|
|
margin: 20px 0 30px 0;
|
2026-05-29 13:30:56 +08:00
|
|
|
|
color: var(--text-secondary);
|
2026-02-27 16:44:41 +08:00
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.countdown {
|
2026-05-29 13:30:56 +08:00
|
|
|
|
color: var(--theme-primary-action);
|
2026-02-27 16:44:41 +08:00
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
margin: 0 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-btn-primary) {
|
2026-05-29 13:30:56 +08:00
|
|
|
|
background: linear-gradient(135deg, var(--theme-primary-action), var(--theme-secondary));
|
2026-02-27 16:44:41 +08:00
|
|
|
|
border: none;
|
|
|
|
|
|
padding: 12px 32px;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
border-radius: 25px;
|
2026-05-29 13:30:56 +08:00
|
|
|
|
box-shadow: var(--theme-button-shadow);
|
2026-02-27 16:44:41 +08:00
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-btn-primary:hover) {
|
|
|
|
|
|
transform: translateY(-2px);
|
2026-05-29 13:30:56 +08:00
|
|
|
|
box-shadow: var(--theme-button-shadow);
|
2026-02-27 16:44:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
|
.not-found-content {
|
|
|
|
|
|
padding: 40px 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.error-code {
|
|
|
|
|
|
font-size: 80px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.not-found-content h1 {
|
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.not-found-content p {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-05-29 13:30:56 +08:00
|
|
|
|
</style>
|