errorPage.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 center center;
  55. position: fixed;
  56. top: 0;
  57. bottom: 0;
  58. left: 0;
  59. right: 0;
  60. height: auto;
  61. .btn-click{
  62. top: 66%;
  63. left: 1.2rem;
  64. margin-left: 0;
  65. a{
  66. width: 2.3rem;
  67. height: .63rem;
  68. font-size: .32rem;
  69. line-height: .63rem;
  70. margin: 0 .1rem;
  71. border-radius: .04rem;
  72. }
  73. }
  74. }
  75. }
  76. </style>