404.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <div class="error-container">
  3. <div class="error-content">
  4. <el-row :gutter="20">
  5. <el-col
  6. :xs="24"
  7. :sm="24"
  8. :md="12"
  9. :lg="12"
  10. :xl="12"
  11. >
  12. <div class="pic-error">
  13. <img
  14. alt="401"
  15. class="pic-error-parent"
  16. src="@/assets/error_images/404.png"
  17. >
  18. <img
  19. alt="401"
  20. class="pic-error-child left"
  21. src="@/assets/error_images/cloud.png"
  22. >
  23. <img
  24. alt="401"
  25. class="pic-error-child"
  26. src="@/assets/error_images/cloud.png"
  27. >
  28. <img
  29. alt="401"
  30. class="pic-error-child"
  31. src="@/assets/error_images/cloud.png"
  32. >
  33. </div>
  34. </el-col>
  35. <el-col
  36. :xs="24"
  37. :sm="24"
  38. :md="12"
  39. :lg="12"
  40. :xl="12"
  41. >
  42. <div class="bullshit">
  43. <div class="bullshit-oops">
  44. {{ oops }}
  45. </div>
  46. <div class="bullshit-headline">
  47. {{ headline }}
  48. </div>
  49. <div class="bullshit-info">
  50. {{ info }}
  51. </div>
  52. <a
  53. class="bullshit-return-home"
  54. href="#/index"
  55. >
  56. {{ jumpTime }}s&nbsp;{{ btn }}
  57. </a>
  58. </div>
  59. </el-col>
  60. </el-row>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. export default {
  66. name: 'Page404',
  67. data() {
  68. return {
  69. jumpTime: 5,
  70. oops: '抱歉!',
  71. headline: '当前页面不存在...',
  72. info: '请检查您输入的网址是否正确,或点击下面的按钮返回首页。',
  73. btn: '返回首页',
  74. timer: 0,
  75. }
  76. },
  77. mounted() {
  78. this.timeChange()
  79. },
  80. beforeDestroy() {
  81. clearInterval(this.timer)
  82. },
  83. methods: {
  84. timeChange() {
  85. this.timer = setInterval(() => {
  86. if (this.jumpTime) {
  87. this.jumpTime--
  88. } else {
  89. this.$router.push({ path: '/' })
  90. this.$store.dispatch('tabsBar/delOthersRoutes', {
  91. path: '/',
  92. })
  93. clearInterval(this.timer)
  94. }
  95. }, 1000)
  96. },
  97. },
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .error-container {
  102. position: absolute;
  103. top: 40%;
  104. left: 50%;
  105. transform: translate(-50%, -50%);
  106. .error-content {
  107. .pic-error {
  108. position: relative;
  109. float: left;
  110. width: 120%;
  111. overflow: hidden;
  112. &-parent {
  113. width: 100%;
  114. }
  115. &-child {
  116. position: absolute;
  117. &.left {
  118. top: 17px;
  119. left: 220px;
  120. width: 80px;
  121. opacity: 0;
  122. animation-name: cloudLeft;
  123. animation-duration: 2s;
  124. animation-timing-function: linear;
  125. animation-delay: 1s;
  126. animation-fill-mode: forwards;
  127. }
  128. &.mid {
  129. top: 10px;
  130. left: 420px;
  131. width: 46px;
  132. opacity: 0;
  133. animation-name: cloudMid;
  134. animation-duration: 2s;
  135. animation-timing-function: linear;
  136. animation-delay: 1.2s;
  137. animation-fill-mode: forwards;
  138. }
  139. &.right {
  140. top: 100px;
  141. left: 500px;
  142. width: 62px;
  143. opacity: 0;
  144. animation-name: cloudRight;
  145. animation-duration: 2s;
  146. animation-timing-function: linear;
  147. animation-delay: 1s;
  148. animation-fill-mode: forwards;
  149. }
  150. @keyframes cloudLeft {
  151. 0% {
  152. top: 17px;
  153. left: 220px;
  154. opacity: 0;
  155. }
  156. 20% {
  157. top: 33px;
  158. left: 188px;
  159. opacity: 1;
  160. }
  161. 80% {
  162. top: 81px;
  163. left: 92px;
  164. opacity: 1;
  165. }
  166. 100% {
  167. top: 97px;
  168. left: 60px;
  169. opacity: 0;
  170. }
  171. }
  172. @keyframes cloudMid {
  173. 0% {
  174. top: 10px;
  175. left: 420px;
  176. opacity: 0;
  177. }
  178. 20% {
  179. top: 40px;
  180. left: 360px;
  181. opacity: 1;
  182. }
  183. 70% {
  184. top: 130px;
  185. left: 180px;
  186. opacity: 1;
  187. }
  188. 100% {
  189. top: 160px;
  190. left: 120px;
  191. opacity: 0;
  192. }
  193. }
  194. @keyframes cloudRight {
  195. 0% {
  196. top: 100px;
  197. left: 500px;
  198. opacity: 0;
  199. }
  200. 20% {
  201. top: 120px;
  202. left: 460px;
  203. opacity: 1;
  204. }
  205. 80% {
  206. top: 180px;
  207. left: 340px;
  208. opacity: 1;
  209. }
  210. 100% {
  211. top: 200px;
  212. left: 300px;
  213. opacity: 0;
  214. }
  215. }
  216. }
  217. }
  218. .bullshit {
  219. position: relative;
  220. float: left;
  221. width: 300px;
  222. padding: 30px 0;
  223. overflow: hidden;
  224. &-oops {
  225. margin-bottom: 20px;
  226. font-size: 32px;
  227. font-weight: bold;
  228. line-height: 40px;
  229. color: $base-color-blue;
  230. opacity: 0;
  231. animation-name: slideUp;
  232. animation-duration: 0.5s;
  233. animation-fill-mode: forwards;
  234. }
  235. &-headline {
  236. margin-bottom: 10px;
  237. font-size: 20px;
  238. font-weight: bold;
  239. line-height: 24px;
  240. color: #222;
  241. opacity: 0;
  242. animation-name: slideUp;
  243. animation-duration: 0.5s;
  244. animation-delay: 0.1s;
  245. animation-fill-mode: forwards;
  246. }
  247. &-info {
  248. margin-bottom: 30px;
  249. font-size: 13px;
  250. line-height: 21px;
  251. color: $base-color-gray;
  252. opacity: 0;
  253. animation-name: slideUp;
  254. animation-duration: 0.5s;
  255. animation-delay: 0.2s;
  256. animation-fill-mode: forwards;
  257. }
  258. &-return-home {
  259. display: block;
  260. float: left;
  261. width: 110px;
  262. height: 36px;
  263. font-size: 14px;
  264. line-height: 36px;
  265. color: #fff;
  266. text-align: center;
  267. cursor: pointer;
  268. background: $base-color-blue;
  269. border-radius: 100px;
  270. opacity: 0;
  271. animation-name: slideUp;
  272. animation-duration: 0.5s;
  273. animation-delay: 0.3s;
  274. animation-fill-mode: forwards;
  275. }
  276. @keyframes slideUp {
  277. 0% {
  278. opacity: 0;
  279. transform: translateY(60px);
  280. }
  281. 100% {
  282. opacity: 1;
  283. transform: translateY(0);
  284. }
  285. }
  286. }
  287. }
  288. }
  289. </style>