zhongshujie
2024-10-23 5bb650939875ac8934da83a25d57ee964ea71fd0
src/books/civilAviation/view/components/index.vue
@@ -1,11 +1,11 @@
<template>
  <div class="page-main"  @scroll="throttledScrollHandler">
  <div class="page-main" @scroll="throttledScrollHandler">
    <div id="searchDomBox" style="display: none">
      <div id="searchContent"></div>
    </div>
    <div class="page-content" :style="{
      fontSize: fontSize ? fontSize + 'px' : '16px',
      transform: `scale(${pageZoom ? pageZoom : 1})`,
      fontSize: fontSize + 'px',
      transform: `scale(${pageZoom})`,
      transformOrigin: 'center top',
    }">
      <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader>
@@ -46,10 +46,11 @@
  },
  computed: {
    fontSize() {
      return this.$store.state.qiankun.fontSize;
      this.transformDom(this.$store.state.qiankun.fontSize)
      return this.$store.state.qiankun.fontSize ? this.$store.state.qiankun.fontSize : 18;
    },
    pageZoom() {
      return this.$store.state.qiankun.scale / 100;
      return this.$store.state.qiankun.scale ? this.$store.state.qiankun.scale / 100 : 1;
    },
  },
  watch: {
@@ -74,6 +75,7 @@
    loadPageList: {
      handler(newVal, oldVal) {
        setTimeout(() => {
          this.transformDom(this.$store.state.qiankun.fontSize)
          this.initSwiper();
          this.initViewer();
          this.closeAudio();
@@ -199,8 +201,6 @@
    scrollFun(event) {
      this.handleVideoPicture()
      // 判断向上滚动还是向下滚动
      console.log(11);
      if (event.target.scrollTop > this.previousScrollTop) {
        this.getAduio();
        // 向下
@@ -211,7 +211,7 @@
          event.target.scrollHeight - this.loadThreshold
        ) {
          console.log(1);
          debugger
          // 到达阈值
          if (
@@ -911,6 +911,19 @@
          playVudio.requestPictureInPicture();
        }
      }
    },
    //其他类名下字体大小变化
    transformDom(fs) {
      console.log('字体大小',fs);
      if(!fs) return
      let doms = (
        this.container ? this.container : document
      ).querySelectorAll('.block')
      if(!doms.length) return
      for (let index = 0; index < doms.length; index++) {
        const dom = doms[index];
        dom.style.fontSize = fs + 'px'
      }
    }
  },
  components: {