<template>
<!--  一个宣传页 -->
  <div class="content">
    <lucency-header :lang="lang" page-key="solution" :is-phone="isPhone"/>
    <item-banner :title="'合方圆'" :sub-title="'综合能源管理平台解决方案'"></item-banner>
    <div class="conBox">
<!--      <pdf v-for="i in totalPage" :page="i" :key="i" :src="blobSrc"></pdf>-->
    </div>
    <default-footer :lang="lang"/>

    <site-bar></site-bar>
  </div>

</template>

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


export default {
  name: "adZhnyIndex",
  props:['uLang'],
  data(){
    return {
      langType: langMap.lang,
      lang: this.uLang?this.uLang:langMap.lang.cn,
      blobSrc: null,
      totalPage: 0,
      isPhone: false,
    }
  },
  mounted(){
    this.$root.$on('changeLang',this.switchLang)
    this.isPhone = isMediaView(0,1024);
    this.loadPdf();
  },
  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
        }
      }
    },
    loadPdf(){
      this.blobSrc = this.$pdf.createLoadingTask({ url: "/file/zhny.pdf" });
      this.blobSrc.promise.then(pdf => {
        this.totalPage = pdf.numPages;
      });
    }
  }
}
</script>

<style scoped>

</style>
