You need to sign in or sign up before continuing.
NotFound.vue 1.66 KB
<!--
 * @Date: 2025-10-30 10:32:36
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2025-11-01 21:08:44
 * @FilePath: /stdj_h5/src/views/NotFound.vue
 * @Description: 文件描述
-->
<template>
  <div class="not-found-container">
    <div class="not-found-content">
      <!-- 404 图标 -->
      <div class="not-found-icon">
        <svg viewBox="0 0 200 200" class="w-32 h-32 text-gray-300">
          <circle cx="100" cy="100" r="90" fill="none" stroke="currentColor" stroke-width="4"/>
          <text x="100" y="120" text-anchor="middle" font-size="48" font-weight="bold" fill="currentColor">404</text>
        </svg>
      </div>

      <!-- 错误信息 -->
      <div class="not-found-text">
        <h1 class="text-2xl font-bold text-gray-800 mb-2">页面不存在</h1>
        <p class="text-gray-600 mb-8">抱歉,您访问的页面不存在或已被删除</p>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

// 返回首页
const goHome = () => {
  router.push('/')
}

// 返回上一页
const goBack = () => {
  if (window.history.length > 1) {
    router.back()
  } else {
    router.push('/')
  }
}
</script>

<style scoped>
.not-found-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.not-found-content {
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.not-found-icon {
  margin-bottom: 2rem;
}

.suggested-links {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
</style>