接口嵌套

This commit is contained in:
2026-06-24 17:16:13 +08:00
parent 3da01972a3
commit d784e10bcf
15 changed files with 1600 additions and 18 deletions
+304 -2
View File
@@ -1,3 +1,305 @@
<template>
<div>404</div>
</template>
<div class="not-found">
<!-- 背景装饰 -->
<div class="bg-decoration">
<div class="circle circle-1"></div>
<div class="circle circle-2"></div>
<div class="circle circle-3"></div>
<div class="circle circle-4"></div>
</div>
<!-- 主内容 -->
<div class="content">
<!-- 404 数字艺术字 -->
<div class="error-code">
<span class="digit digit-1">4</span>
<span class="digit digit-2">0</span>
<span class="digit digit-3">4</span>
</div>
<!-- 插画图标 -->
<div class="illustration">
<van-icon name="warning-o" size="51.2px" color="#ee0a24" />
<div class="illustration-line"></div>
</div>
<!-- 提示文字 -->
<div class="message">
<h1 class="title">哎呀!页面走丢了</h1>
<p class="desc">您访问的页面不存在或已被移除</p>
<p class="sub-desc">可能是链接有误,或页面已更新</p>
</div>
<!-- 操作按钮 -->
<div class="actions">
<van-button
type="danger"
round
block
size="normal"
@click="goBack"
>
返回上一页
</van-button>
</div>
</div>
</div>
</template>
<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
// 返回首页
const goHome = () => {
router.push('/')
}
// 返回上一页
const goBack = () => {
router.go(-1)
}
</script>
<style scoped>
/* ===== 容器 ===== */
.not-found {
position: relative;
min-height: 100vh;
min-height: 100dvh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(145deg, #f8f9fe 0%, #f0f2f8 100%);
padding: 24px 20px;
overflow: hidden;
box-sizing: border-box;
}
/* ===== 背景装饰 ===== */
.not-found .bg-decoration {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 0;
}
.not-found .circle {
position: absolute;
border-radius: 50%;
opacity: 0.4;
animation: float 8s ease-in-out infinite alternate;
}
.not-found .circle-1 {
width: 320px;
height: 320px;
top: -8%;
right: -10%;
background: radial-gradient(circle, rgba(238, 10, 36, 0.08), transparent);
animation-delay: 0s;
}
.not-found .circle-2 {
width: 224px;
height: 224px;
bottom: -5%;
left: -8%;
background: radial-gradient(circle, rgba(238, 10, 36, 0.06), transparent);
animation-delay: 2s;
}
.not-found .circle-3 {
width: 128px;
height: 128px;
top: 30%;
right: 5%;
background: radial-gradient(circle, rgba(238, 10, 36, 0.05), transparent);
animation-delay: 4s;
}
.not-found .circle-4 {
width: 160px;
height: 160px;
bottom: 20%;
left: 5%;
background: radial-gradient(circle, rgba(238, 10, 36, 0.04), transparent);
animation-delay: 1s;
}
@keyframes float {
0% {
transform: translate(0, 0) scale(1);
}
100% {
transform: translate(20px, -20px) scale(1.05);
}
}
/* ===== 内容区 ===== */
.not-found .content {
position: relative;
z-index: 1;
width: 100%;
max-width: 420px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
/* ===== 404 数字 ===== */
.not-found .error-code {
display: flex;
align-items: center;
justify-content: center;
gap: 2.4px;
margin-bottom: 8px;
font-weight: 900;
line-height: 1;
user-select: none;
}
.not-found .error-code .digit {
font-size: 128px;
background: linear-gradient(135deg, #ee0a24 0%, #c41230 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
text-shadow: 0 12px 40px rgba(238, 10, 36, 0.2);
position: relative;
transition: transform 0.3s ease;
}
.not-found .error-code .digit-1 {
animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
.not-found .error-code .digit-2 {
animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
.not-found .error-code .digit-3 {
animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}
@keyframes popIn {
0% {
opacity: 0;
transform: scale(0.5) translateY(30px);
}
100% {
opacity: 1;
transform: scale(1) translateY(0);
}
}
/* ===== 插画 ===== */
.not-found .illustration {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 24px;
opacity: 0;
animation: fadeUp 0.8s ease 0.7s both;
}
.not-found .illustration .van-icon {
filter: drop-shadow(0 4px 12px rgba(238, 10, 36, 0.2));
}
.not-found .illustration-line {
width: 40px;
height: 2px;
background: linear-gradient(90deg, rgba(238, 10, 36, 0.3), rgba(238, 10, 36, 0.05));
border-radius: 2px;
}
@keyframes fadeUp {
0% {
opacity: 0;
transform: translateY(20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
/* ===== 提示文字 ===== */
.not-found .message {
margin-bottom: 32px;
opacity: 0;
animation: fadeUp 0.8s ease 0.9s both;
}
.not-found .message .title {
font-size: 24px;
font-weight: 700;
color: #1a1a2e;
margin: 0 0 8px 0;
letter-spacing: 0.02em;
}
.not-found .message .desc {
font-size: 16px;
color: #6b7280;
margin: 0 0 4px 0;
font-weight: 400;
line-height: 1.6;
}
.not-found .message .sub-desc {
font-size: 14px;
color: #9ca3af;
margin: 0;
font-weight: 300;
line-height: 1.6;
}
/* ===== 按钮 ===== */
.not-found .actions {
width: 100%;
}
/* ===== 移动端适配 ===== */
@media (max-width: 420px) {
.not-found .error-code .digit {
font-size: 96px;
}
.not-found .message .title {
font-size: 20px;
}
.not-found .message .desc {
font-size: 14.4px;
}
}
@media (max-width: 360px) {
.not-found .error-code .digit {
font-size: 76.8px;
}
.not-found .message .title {
font-size: 17.6px;
}
.not-found .content {
padding: 0 4px;
}
}
/* ===== 刘海屏 & 安全区适配 ===== */
@supports (padding: max(0px)) {
.not-found {
padding-top: max(24px, env(safe-area-inset-top));
padding-bottom: max(24px, env(safe-area-inset-bottom));
padding-left: max(20px, env(safe-area-inset-left));
padding-right: max(20px, env(safe-area-inset-right));
}
}
</style>