errorPage.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!--
  2. * @FileDescription: 错误
  3. * @Author: 黄琪勇
  4. * @Date:2022-05-16 15:48:53
  5. -->
  6. <template>
  7. <div class="errorPage">
  8. <div class="error">
  9. <img class="img" src="@/img/loginErr/404.png" />
  10. <div class="errName">糟糕,页面找不到了</div>
  11. <div class="title">您可以通过以下方式继续访问</div>
  12. <div class="btnCon">
  13. <div class="btn" @click="handleGoHome">跳转到首页</div>
  14. <div class="btn" @click="handleGoBack">返回上一步</div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script setup lang="ts">
  20. import "vant/lib/index.css"
  21. import { useRouter } from "vue-router"
  22. const router = useRouter()
  23. function handleGoHome() {
  24. router.push({
  25. path: "/"
  26. })
  27. }
  28. function handleGoBack() {
  29. router.back()
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .errorPage {
  34. width: 100%;
  35. height: 100%;
  36. display: flex;
  37. justify-content: center;
  38. align-items: center;
  39. .error {
  40. display: flex;
  41. flex-direction: column;
  42. justify-content: center;
  43. align-items: center;
  44. .img {
  45. width: 630px;
  46. height: 514px;
  47. }
  48. .errName {
  49. margin-top: -100px;
  50. font-weight: 500;
  51. font-size: 29px;
  52. color: #333333;
  53. line-height: 41px;
  54. }
  55. .title {
  56. margin-top: 10px;
  57. font-weight: 400;
  58. font-size: 22px;
  59. color: #aaaaaa;
  60. line-height: 30px;
  61. }
  62. .btnCon {
  63. margin-top: 50px;
  64. display: flex;
  65. justify-content: center;
  66. .btn {
  67. background: url("@/img/loginErr/btn.png") no-repeat;
  68. width: 170px;
  69. height: 52px;
  70. background-size: 100% 100%;
  71. font-weight: bold;
  72. font-size: 22px;
  73. color: #ffffff;
  74. line-height: 52px;
  75. text-align: center;
  76. letter-spacing: 1px;
  77. margin-right: 25px;
  78. cursor: pointer;
  79. &:hover {
  80. opacity: $opacity-hover;
  81. }
  82. &:last-child {
  83. margin-right: 0;
  84. }
  85. }
  86. }
  87. }
  88. }
  89. </style>