zhongshujie
11 小时以前 e33672cf85da88d515d5fe6ccc0a139c3cfaa5db
src/books/preventiveDentistry/view/components/index.vue
@@ -9,8 +9,8 @@
      transformOrigin: 'center top',
    }">
      <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader>
      <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
      <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :getResourceInfo="resourceListFun"
        :interfaceQuestion="bookQuestionsList">
      </chapterOne>
      <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList"
        :getResourceInfo="resourceListFun">
@@ -69,6 +69,9 @@
import chapterTwelve from "./chapter012.vue"
import chapterThirteen from "./chapter013.vue"
import NoteIcon from "@/assets/images/biji.png";
import getQuestionList from "@/assets/methods/examination";
import testData from "../../assets/examinationList";
import MG from "@/assets/js/middleGround/WebMiddleGroundApi";
import _ from "lodash";
import Swiper from "swiper/bundle";
import "swiper/swiper-bundle.css";
@@ -94,6 +97,7 @@
      currentTime: null,
      videoList: [],
      resourceList: [],
      bookQuestionsList: [],
    };
  },
  computed: {
@@ -152,10 +156,13 @@
        this.resourceList = newVal;
      },
    },
    bookQuestionsList: {
      handler(newVal, oldVal) {
        this.bookQuestionsList = newVal;
      },
    }
  },
  mounted() {
    console.log("666");
    // 默认加载章节
    this.showCatalogList = [1];
    // 滚动监听节流
@@ -208,6 +215,9 @@
    this.getBookResourceList();
    // 获取整本书题目
    this.getBookQuestionList();
    // 启动页码观察
    setTimeout(() => {
      this.initObservation();
@@ -215,7 +225,7 @@
    // 测试页面跳转
    setTimeout(() => {
      this.gotoPage(2, 14);
      this.gotoPage(2, 18);
    }, 500);
    // const pageDom = (this.container ? this.container : document)
@@ -234,30 +244,64 @@
  },
  methods: {
    // setZoom1() {
    //   let scale = this.$store.state.qiankun.scale + 10;
    //   const scrollBox = (
    //     this.container ? this.container : document
    //   ).querySelector(".page-main");
    //   this.$store.commit("setZoom", scale);
    // },
    // setZoom2() {
    //   let scale = this.$store.state.qiankun.scale - 10;
    //   const scrollBox = (
    //     this.container ? this.container : document
    //   ).querySelector(".page-main");
    //   this.$store.commit("setZoom", scale);
    // },
    // 请求资源Json
    async getBookResourceList() {
      this.resourceList = await this.config.getBookResources(
        process.env.VUE_APP_RESOURCE_CTX + (process.env.VUE_APP_ENV == "product"
    getBookResourceList() {
      this.config.getBookResources(
        process.env.VUE_APP_RESOURCE_CTX + (process.env.VUE_APP_ENV === "product"
          ? process.env.VUE_APP_BOOK_ID
          : "preventiveDentistry")
      );
      console.log(this.resourceList, "resourceList");
      )
        .then(data => {
          this.resourceList = data;
        })
        .catch(error => {
          console.error("获取图书资源列表失败:", error);
        });
    },
    // 获取图书问题列表
    getBookQuestionList() {
      let query = {
        storeInfo: this.config.activeBook.storeRefcode,
        path: "*",
        cmsPath: this.config.activeBook.rootCmsItemId,
        cmsType: "*",
        productId: this.config.activeBook.bookId,
        queryType: "*",
        itemFields: {
          Embedded_QuestionBank_Stem: [],
          Embedded_QuestionBank_AnalysisCon: [],
          Embedded_QuestionBank_Answer: [],
          Embedded_QuestionBank_Option: [],
          Embedded_QuestionBank_QuestionType: [],
          Embedded_QuestionBank_StemStyle: [],
          Embedded_QuestionBank_OptionStyle: [],
          Embedded_QuestionBank_KnowledgePoint: [],
          Embedded_QuestionBank_Difficulty: [],
        },
      }
      MG.store.getProductDetail(query)
        .then(res => {
          console.log(res.datas.cmsDatas[0].datas, "获取bookQuestionList成功");
          let bookQuestionList = [];
          if (res.datas.cmsDatas[0].datas.length > 0) {
            res.datas.cmsDatas[0].datas.forEach(item => {
              if (item.datas.Type === "questionBankItem") {
                bookQuestionList.push(item);
              }
              if (item.id == 21987) {
                console.log(item, "21987");
              }
            });
          }
          console.log(bookQuestionList, "bookQuestionList");
          this.bookQuestionsList = bookQuestionList;
        })
        .catch(error => {
          console.error("获取图书问题列表失败:", error);
        });
    },
    resourceListFun(id, key) {
      let data = this.resourceList.find(item => item.key == id)
      return key ? data[key] : data
@@ -609,7 +653,8 @@
            //         this.questionDataMap[page] = await getQuestionList(
            //           page,
            //           testData[catalog][page],
            //           this.config.activeBook
            //           this.config.activeBook,
            //           this.bookQuestionsList,
            //         );
            //       } else {
            //         const obj = {};
@@ -617,7 +662,8 @@
            //           obj[key] = await getQuestionList(
            //             [],
            //             testData[catalog][page][key],
            //             this.config.activeBook
            //             this.config.activeBook,
            //             this.bookQuestionsList,
            //           );
            //         }
            //         this.questionDataMap[page] = obj;