index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <!-- 一个宣传页 -->
  3. <div class="content">
  4. <lucency-header :lang="lang" page-key="solution" :is-phone="isPhone"/>
  5. <item-banner :title="'合方圆'" :sub-title="'综合能源管理平台解决方案'"></item-banner>
  6. <div class="conBox">
  7. <!-- <pdf v-for="i in totalPage" :page="i" :key="i" :src="blobSrc"></pdf>-->
  8. </div>
  9. <default-footer :lang="lang"/>
  10. <site-bar wechat-src="/image/wechat.jpg"></site-bar>
  11. </div>
  12. </template>
  13. <script>
  14. import langMap from "@/map/langMap";
  15. import {isMediaView} from "@/until/mediaView";
  16. export default {
  17. name: "adZhnyIndex",
  18. props:['uLang'],
  19. data(){
  20. return {
  21. langType: langMap.lang,
  22. lang: this.uLang?this.uLang:langMap.lang.cn,
  23. blobSrc: null,
  24. totalPage: 0,
  25. isPhone: false,
  26. }
  27. },
  28. mounted(){
  29. this.$root.$on('changeLang',this.switchLang)
  30. this.isPhone = isMediaView(0,1024);
  31. this.loadPdf();
  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. loadPdf(){
  53. this.blobSrc = this.$pdf.createLoadingTask({ url: "/file/zhny.pdf" });
  54. this.blobSrc.promise.then(pdf => {
  55. this.totalPage = pdf.numPages;
  56. });
  57. }
  58. }
  59. }
  60. </script>
  61. <style scoped>
  62. </style>