闫增涛
2024-06-07 3b2e6425d6fc732a221c9ef9ec9e8dc849e11148
src/books/childHealth/view/content/index.vue
@@ -258,9 +258,9 @@
    // const pageDom = (this.container ? this.container : document)
    //   .querySelector("#app")
    //   .querySelectorAll(".page-box");
    // 检索
    // // 检索
    // console.log(this.searchTextByPage("保护内脏器官"), "searchTextByPage");
    // 检索跳转
    // // 检索跳转
    // this.searchItemLocation({
    //   catalog: 2,
    //   page: 10,
@@ -616,22 +616,27 @@
            );
            const catalog = catalogDom.getAttribute("num");
            if (!this.questionDataMap[page]) {
              const token = localStorage.getItem(this.config.tokenKey)
              if (testData && testData[catalog]) {
                if (testData[catalog][page]) {
                  if (Array.isArray(testData[catalog][page])) {
                    this.questionDataMap[page] = await getQuestionList(
                      page,
                      testData[catalog][page],
                      this.config.activeBook
                    );
                    if(token) {
                      this.questionDataMap[page] = await getQuestionList(
                        page,
                        testData[catalog][page],
                        this.config.activeBook
                      );
                    }
                  } else {
                    const obj = {};
                    for (let key in testData[catalog][page]) {
                      obj[key] = await getQuestionList(
                        [],
                        testData[catalog][page][key],
                        this.config.activeBook
                      );
                      if(token) {
                          obj[key] = await getQuestionList(
                          [],
                          testData[catalog][page][key],
                          this.config.activeBook
                        );
                      }
                    }
                    this.questionDataMap[page] = obj;
                  }