errorPage.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <div class="error">
  3. <div class="section" :class="{'mobile-page': isMobile}">
  4. <div class="container">
  5. <div class="btn-click">
  6. <a href="/"><i class="fa fa-home" style="margin-right:5px;"></i>返回首页</a>
  7. <a href="javascript:history.go(-1)"><i class="fa fa-reply" style="margin-right:5px;"></i>返回上一页</a>
  8. </div>
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. props: ['error'],
  16. layout (context) {
  17. return context.store.state.option.isMobile ? 'login' : 'default'
  18. },
  19. computed: {
  20. isMobile () {
  21. return this.$store.state.option.isMobile
  22. }
  23. // background () {
  24. // return this.isMobile ? '#ebfdff url("/images/404-mobile.png")no-repeat center center' : '#ebfdff url("/images/404.png")no-repeat center center'
  25. // }
  26. }
  27. }
  28. </script>
  29. <style scoped lang="scss">
  30. .section{
  31. background: #ebfdff url('/images/404.png')no-repeat center center;
  32. height:900px;
  33. position:relative;
  34. .btn-click{
  35. position:absolute;
  36. top:54%;
  37. left:50%;
  38. margin-left:-150px;
  39. a{
  40. display:inline-block;
  41. width:130px;
  42. height:33px;
  43. font-size: 16px;
  44. line-height: 33px;
  45. color:#fff;
  46. background: #f87c29;
  47. text-align: center;
  48. margin:0 10px;
  49. border-radius: 2px;
  50. text-decoration: none;
  51. }
  52. }
  53. &.mobile-page {
  54. background: #ebfdff url("/images/404-mobile.png")no-repeat;
  55. background-size: contain;
  56. background-position-y: 3rem;
  57. position: fixed;
  58. top: 0;
  59. bottom: 0;
  60. left: 0;
  61. right: 0;
  62. height: auto;
  63. .btn-click{
  64. top: 66%;
  65. left: 1.2rem;
  66. margin-left: 0;
  67. a{
  68. width: 2.3rem;
  69. height: .63rem;
  70. font-size: .32rem;
  71. line-height: .63rem;
  72. margin: 0 .1rem;
  73. border-radius: .04rem;
  74. }
  75. }
  76. }
  77. }
  78. </style>