error.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <section class="page-container container-error">
  3. <my-header ref="myHeader"/>
  4. <div class="page-wrap">
  5. <img
  6. src="//static.hoolihome.com/pc/3.0.0/assets/img/v3.1/no-data.png"
  7. class="photo">
  8. <h1 class="title">{{ error.statusCode }}</h1>
  9. <h2 class="info">{{ error.message }}</h2>
  10. <nuxt-link
  11. v-if="error.statusCode === 404"
  12. class="button"
  13. to="/">{{ $t("home") }}</nuxt-link>
  14. </div>
  15. <my-footer :friendship-link-arr="friendshipLinkArr"/>
  16. </section>
  17. </template>
  18. <script>
  19. import MyHeader from '~/components/common/MyHeader'
  20. import MyFooter from '~/components/common/MyFooter'
  21. import { php_api_link_list } from '~/common/apis.js'
  22. export default {
  23. components: {
  24. MyHeader,
  25. MyFooter
  26. },
  27. props: {
  28. error: {
  29. type: Object,
  30. default: () => {}
  31. }
  32. },
  33. data() {
  34. return {
  35. locale: this.$store.state.locale,
  36. friendshipLinkArr: []
  37. }
  38. },
  39. scrollToTop: true,
  40. mounted() {
  41. this.loadFriendshipLink()
  42. },
  43. methods: {
  44. handleShowView() {
  45. this.$refs.myHeader.handleShowView('LoginByPassword')
  46. },
  47. loadFriendshipLink() {
  48. this.$axios
  49. .$post(php_api_link_list)
  50. .then(res => {
  51. if (res) {
  52. let { code, data } = res
  53. code = parseInt(code)
  54. if (code === 0 && data && Array.isArray(data.list)) {
  55. this.friendshipLinkArr = data.list
  56. }
  57. }
  58. })
  59. .catch(e => {})
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="less" scoped>
  65. .page-container {
  66. .page-wrap {
  67. display: flex;
  68. flex-flow: column nowrap;
  69. justify-content: center;
  70. align-items: center;
  71. max-width: 1200px;
  72. min-height: 400px;
  73. margin: 0 auto;
  74. .photo {
  75. width: 70px;
  76. }
  77. .title {
  78. max-width: 200px;
  79. height: 22px;
  80. margin-top: 24px;
  81. font-size: 14px;
  82. font-family: PingFangSC-Regular;
  83. font-weight: 400;
  84. color: rgba(153, 153, 153, 1);
  85. text-align: center;
  86. line-height: 22px;
  87. }
  88. .info {
  89. max-width: 200px;
  90. height: 22px;
  91. margin-top: 10px;
  92. font-size: 14px;
  93. font-family: PingFangSC-Regular;
  94. font-weight: 400;
  95. color: rgba(153, 153, 153, 1);
  96. text-align: center;
  97. line-height: 22px;
  98. }
  99. .button {
  100. max-width: 200px;
  101. height: 22px;
  102. margin-top: 10px;
  103. font-size: 14px;
  104. font-family: PingFangSC-Regular;
  105. font-weight: 400;
  106. color: #ff523d;
  107. text-align: center;
  108. line-height: 22px;
  109. }
  110. }
  111. }
  112. </style>