404.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <div class="error-container">
  3. <div class="error-content">
  4. <a-row :gutter="20">
  5. <a-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
  6. <div class="pic-error">
  7. <img class="pic-error-parent" src="@/assets/error_images/404.png" />
  8. <img
  9. class="pic-error-child left"
  10. src="@/assets/error_images/cloud.png"
  11. />
  12. </div>
  13. </a-col>
  14. <a-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
  15. <div class="bullshit">
  16. <div class="bullshit-oops">{{ oops }}</div>
  17. <div class="bullshit-headline">{{ headline }}</div>
  18. <div class="bullshit-info">{{ info }}</div>
  19. <a class="bullshit-return-home" href="#/index">
  20. {{ jumpTime }}s&nbsp;{{ btn }}
  21. </a>
  22. </div>
  23. </a-col>
  24. </a-row>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import { mapActions } from 'vuex'
  30. export default {
  31. name: 'Page404',
  32. data() {
  33. return {
  34. jumpTime: 5,
  35. oops: '抱歉!',
  36. headline: '当前页面不存在...',
  37. info: '请检查您输入的网址是否正确,或点击下面的按钮返回首页。',
  38. btn: '返回首页',
  39. timer: 0,
  40. }
  41. },
  42. mounted() {
  43. this.timeChange()
  44. },
  45. beforeUnmount() {
  46. clearInterval(this.timer)
  47. },
  48. methods: {
  49. ...mapActions({
  50. delOthersVisitedRoutes: 'tagsBar/delOthersVisitedRoutes',
  51. }),
  52. timeChange() {
  53. this.timer = setInterval(() => {
  54. if (this.jumpTime) {
  55. this.jumpTime--
  56. } else {
  57. this.$router.push({ path: '/' })
  58. this.delOthersVisitedRoutes({ path: '/' })
  59. clearInterval(this.timer)
  60. }
  61. }, 1000)
  62. },
  63. },
  64. }
  65. </script>
  66. <style lang="less" scoped>
  67. .error-container {
  68. position: relative;
  69. height: 100vh;
  70. .error-content {
  71. position: absolute;
  72. top: 55%;
  73. left: 50%;
  74. width: 40vw;
  75. height: 400px;
  76. transform: translate(-50%, -50%);
  77. .pic-error {
  78. position: relative;
  79. float: left;
  80. width: 100%;
  81. overflow: hidden;
  82. &-parent {
  83. width: 100%;
  84. }
  85. &-child {
  86. position: absolute;
  87. &.left {
  88. top: 17px;
  89. left: 220px;
  90. width: 80px;
  91. opacity: 0;
  92. animation-name: cloudLeft;
  93. animation-duration: 2s;
  94. animation-timing-function: linear;
  95. animation-delay: 1s;
  96. animation-fill-mode: forwards;
  97. }
  98. @keyframes cloudLeft {
  99. 0% {
  100. top: 17px;
  101. left: 220px;
  102. opacity: 0;
  103. }
  104. 20% {
  105. top: 33px;
  106. left: 188px;
  107. opacity: 1;
  108. }
  109. 80% {
  110. top: 81px;
  111. left: 92px;
  112. opacity: 1;
  113. }
  114. 100% {
  115. top: 97px;
  116. left: 60px;
  117. opacity: 0;
  118. }
  119. }
  120. }
  121. }
  122. .bullshit {
  123. position: relative;
  124. float: left;
  125. width: 300px;
  126. padding: 30px 0;
  127. overflow: hidden;
  128. &-oops {
  129. margin-bottom: @vab-margin;
  130. font-size: 32px;
  131. font-weight: bold;
  132. line-height: 40px;
  133. opacity: 0;
  134. animation-name: slideUp;
  135. animation-duration: 0.5s;
  136. animation-fill-mode: forwards;
  137. }
  138. &-headline {
  139. margin-bottom: 10px;
  140. font-size: 20px;
  141. font-weight: bold;
  142. line-height: 24px;
  143. color: #222;
  144. opacity: 0;
  145. animation-name: slideUp;
  146. animation-duration: 0.5s;
  147. animation-delay: 0.1s;
  148. animation-fill-mode: forwards;
  149. }
  150. &-info {
  151. margin-bottom: 30px;
  152. font-size: 13px;
  153. line-height: 21px;
  154. opacity: 0;
  155. animation-name: slideUp;
  156. animation-duration: 0.5s;
  157. animation-delay: 0.2s;
  158. animation-fill-mode: forwards;
  159. }
  160. &-return-home {
  161. display: block;
  162. float: left;
  163. width: 110px;
  164. height: 36px;
  165. font-size: 14px;
  166. line-height: 36px;
  167. color: #fff;
  168. text-align: center;
  169. cursor: pointer;
  170. background: @vab-color-blue;
  171. border-radius: 100px;
  172. opacity: 0;
  173. animation-name: slideUp;
  174. animation-duration: 0.5s;
  175. animation-delay: 0.3s;
  176. animation-fill-mode: forwards;
  177. }
  178. @keyframes slideUp {
  179. 0% {
  180. opacity: 0;
  181. transform: translateY(60px);
  182. }
  183. 100% {
  184. opacity: 1;
  185. transform: translateY(0);
  186. }
  187. }
  188. }
  189. }
  190. }
  191. </style>