ExceptionPage.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="exception">
  3. <div class="imgBlock">
  4. <div class="imgEle" :style="{backgroundImage: `url(${config[type].img})`}">
  5. </div>
  6. </div>
  7. <div class="content">
  8. <h1>{{ config[type].title }}</h1>
  9. <div class="desc">{{ config[type].desc }}</div>
  10. <div class="actions">
  11. <a-button type="primary" @click="handleToHome">返回首页</a-button>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import types from './type'
  18. export default {
  19. name: 'Exception',
  20. props: {
  21. type: {
  22. type: String,
  23. default: '404'
  24. }
  25. },
  26. data () {
  27. return {
  28. config: types
  29. }
  30. },
  31. methods: {
  32. handleToHome () {
  33. this.$router.push({ path: this.MyGlobalConstant.MOBILE_INDEX_PATH })
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="less">
  39. @import "~ant-design-vue/lib/style/index";
  40. .exception {
  41. display: flex;
  42. align-items: center;
  43. height: 80%;
  44. min-height: 500px;
  45. .imgBlock {
  46. flex: 0 0 62.5%;
  47. width: 62.5%;
  48. padding-right: 152px;
  49. zoom: 1;
  50. &::before,
  51. &::after {
  52. content: ' ';
  53. display: table;
  54. }
  55. &::after {
  56. clear: both;
  57. height: 0;
  58. font-size: 0;
  59. visibility: hidden;
  60. }
  61. }
  62. .imgEle {
  63. float: right;
  64. width: 100%;
  65. max-width: 430px;
  66. height: 360px;
  67. background-repeat: no-repeat;
  68. background-position: 50% 50%;
  69. background-size: contain;
  70. }
  71. .content {
  72. flex: auto;
  73. h1 {
  74. margin-bottom: 24px;
  75. color: #434e59;
  76. font-weight: 600;
  77. font-size: 72px;
  78. line-height: 72px;
  79. }
  80. .desc {
  81. margin-bottom: 16px;
  82. color: @text-color-secondary;
  83. font-size: 20px;
  84. line-height: 28px;
  85. }
  86. .actions {
  87. button:not(:last-child) {
  88. margin-right: 8px;
  89. }
  90. }
  91. }
  92. }
  93. @media screen and (max-width: @screen-xl) {
  94. .exception {
  95. .imgBlock {
  96. padding-right: 88px;
  97. }
  98. }
  99. }
  100. @media screen and (max-width: @screen-sm) {
  101. .exception {
  102. display: block;
  103. text-align: center;
  104. .imgBlock {
  105. margin: 0 auto 24px;
  106. padding-right: 0;
  107. }
  108. }
  109. }
  110. @media screen and (max-width: @screen-xs) {
  111. .exception {
  112. .imgBlock {
  113. margin-bottom: -24px;
  114. overflow: hidden;
  115. }
  116. }
  117. }
  118. </style>