<template>
  <div class="content">
    <lucency-header :lang="lang" page-key="news" :is-phone="isPhone" />
    <item-banner :title="'合方圆'" :sub-title="'专致执着，追求无限卓越'"></item-banner>
    <div class="conBox err-404">
      <div class="error404">
        <img src="/image/404.png" alt="">

        <p>{{getLangText('404')}}</p>
        <p>您当前访问的资源无法找到</p>
      </div>
    </div>
    <default-footer :lang="lang"/>

    <site-bar wechat-src="/image/wechat.jpg"></site-bar>
  </div>

</template>

<script>
import langMap from "~/map/langMap";
import {isMediaView} from "@/until/mediaView";

export default {
  name: "error404",
  props:['uLang'],
  data(){
    return {
      langType: langMap.lang,
      lang: this.uLang?this.uLang:langMap.lang.cn,
      isPhone: false,
    }
  },
  mounted() {
    this.$root.$on('changeLang',this.switchLang)
    this.isPhone = isMediaView(0,1024);
  },
  methods:{
    getLangText(str) {
      return langMap.getText(this.lang, str);
    },
    getAbbrText(str) {
      return langMap.getAbbrText(this.lang, str);
    },
    switchLang(nextLang){
      // console.log("11111111111111111")
      if(nextLang){
        this.lang = nextLang;
      }else{
        if(this.lang === langMap.lang.cn){
          this.lang = langMap.lang.en
        }else{
          this.lang = langMap.lang.cn
        }
      }
    },
  }
}
</script>

<style scoped>
.err-404{
  padding: 0 20px;
  color: red;
  font-size: 2.5rem;
  display: flex;
  justify-content: center;
  flex-direction: column;
}
.error404{
  text-align: center;
  margin-top: 100px;
  margin-bottom: 100px;
}
.err-404 img{
  width: 90%;
}
.error404 p{
  margin: 0;
  display: block;
}
</style>
