QYF-GitLab1
4 天以前 b5d1cc7fde9823f39c0c9595f21c7aee2582ac59
src/books/sportsAndHealth/view/components/index.vue
@@ -19,7 +19,7 @@
      <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList"></chapterSix>
      <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList"></chapterSeven>
      <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList"></chapterEight>
      <chapterNine v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList"></chapterNine>
    </div>
  </div>
@@ -37,7 +37,7 @@
import chapterSix from './chapter006.vue'
import chapterSeven from './chapter007.vue'
import chapterEight from './chapter008.vue'
import chapterNine from './chapter009.vue'
import NoteIcon from '@/assets/images/biji.png'
import _ from 'lodash'
@@ -50,7 +50,7 @@
export default {
  data() {
    return {
      catalogLength: 9, // 总章节数
      catalogLength: 10, // 总章节数
      showCatalogList: [], // 显示的章节
      loadThreshold: 300, // 触发加载阈值
      throttleThreshold: 100, // 节流阈值
@@ -96,7 +96,7 @@
        setTimeout(() => {
          this.initSwiper()
          this.initViewer()
          this.readText()
          // this.readText()
        }, 200)
      },
    },
@@ -168,7 +168,7 @@
    // 测试页面跳转
    setTimeout(() => {
      this.gotoPage(1, 1)
      this.gotoPage(10, 268)
      //   setTimeout(() => {
      //     this.renderSign("Highlight", {
      //       id: "2ACA9359",
@@ -297,9 +297,11 @@
          const pageDom = (
            this.container ? this.container : document
          ).querySelector(`[page="${page}"]`)
          if (pageDom) {
            pageDom.scrollIntoView()
          } else {
            console.log('页码错误!')
          }
        }, 500)
@@ -741,7 +743,8 @@
        chapterfive,
        chapterSix,
        chapterSeven,
        chapterEight
        chapterEight,
        chapterNine
        // assemblyOne,
        // assemblyTwo,
      }
@@ -845,30 +848,30 @@
      // 跳转
      this.gotoPage(data.catalog, data.page, () => { })
    },
    readText() {
      const doms = (
        this.container ? this.container : document
      ).querySelectorAll('.read-aloud')
      for (let index = 0; index < doms.length; index++) {
        const dom = doms[index]
        let id = null
        dom.addEventListener('click', (e) => {
          if (e.srcElement.nodeName == 'svg') {
            id = dom.getAttribute('readId')
          } else if (e.srcElement.nodeName == 'g') {
            const svgDom = e.srcElement.parentNode
            id = svgDom.getAttribute('readId')
          } else {
            const svgDom = e.srcElement.parentNode.parentNode
            id = svgDom.getAttribute('readId')
          }
          const item = (
            this.container ? this.container : document
          ).querySelector('#' + id).innerText
          console.log(item, 233)
        })
      }
    },
    // readText() {
    //   const doms = (
    //     this.container ? this.container : document
    //   ).querySelectorAll('.read-aloud')
    //   for (let index = 0; index < doms.length; index++) {
    //     const dom = doms[index]
    //     let id = null
    //     dom.addEventListener('click', (e) => {
    //       if (e.srcElement.nodeName == 'svg') {
    //         id = dom.getAttribute('readId')
    //       } else if (e.srcElement.nodeName == 'g') {
    //         const svgDom = e.srcElement.parentNode
    //         id = svgDom.getAttribute('readId')
    //       } else {
    //         const svgDom = e.srcElement.parentNode.parentNode
    //         id = svgDom.getAttribute('readId')
    //       }
    //       const item = (
    //         this.container ? this.container : document
    //       ).querySelector('#' + id).innerText
    //       console.log(item, 233)
    //     })
    //   }
    // },
  },
  components: {
    pageHeader,
@@ -879,7 +882,8 @@
    chapterfive,
    chapterSix,
    chapterSeven,
    chapterEight
    chapterEight,
    chapterNine
    // assemblyOne,
    // assemblyTwo,
    // ChapterFour,