404.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class="content">
  3. <lucency-header :lang="lang" page-key="news" :is-phone="isPhone" />
  4. <item-banner :title="'合方圆'" :sub-title="'专致执着,追求无限卓越'"></item-banner>
  5. <div class="conBox err-404">
  6. <div class="error404">
  7. <img src="/image/404.png" alt="">
  8. <p>{{getLangText('404')}}</p>
  9. <p>您当前访问的资源无法找到</p>
  10. </div>
  11. </div>
  12. <default-footer :lang="lang"/>
  13. <site-bar wechat-src="/image/wechat.jpg"></site-bar>
  14. </div>
  15. </template>
  16. <script>
  17. import langMap from "~/map/langMap";
  18. import {isMediaView} from "@/until/mediaView";
  19. export default {
  20. name: "error404",
  21. props:['uLang'],
  22. data(){
  23. return {
  24. langType: langMap.lang,
  25. lang: this.uLang?this.uLang:langMap.lang.cn,
  26. isPhone: false,
  27. }
  28. },
  29. mounted() {
  30. this.$root.$on('changeLang',this.switchLang)
  31. this.isPhone = isMediaView(0,1024);
  32. },
  33. methods:{
  34. getLangText(str) {
  35. return langMap.getText(this.lang, str);
  36. },
  37. getAbbrText(str) {
  38. return langMap.getAbbrText(this.lang, str);
  39. },
  40. switchLang(nextLang){
  41. // console.log("11111111111111111")
  42. if(nextLang){
  43. this.lang = nextLang;
  44. }else{
  45. if(this.lang === langMap.lang.cn){
  46. this.lang = langMap.lang.en
  47. }else{
  48. this.lang = langMap.lang.cn
  49. }
  50. }
  51. },
  52. }
  53. }
  54. </script>
  55. <style scoped>
  56. .err-404{
  57. padding: 0 20px;
  58. color: red;
  59. font-size: 2.5rem;
  60. display: flex;
  61. justify-content: center;
  62. flex-direction: column;
  63. }
  64. .error404{
  65. text-align: center;
  66. margin-top: 100px;
  67. margin-bottom: 100px;
  68. }
  69. .err-404 img{
  70. width: 90%;
  71. }
  72. .error404 p{
  73. margin: 0;
  74. display: block;
  75. }
  76. </style>