YM
2024-05-15 96c2e24f915e278e855802f158cf792ac5106c4f
题目
2个文件已修改
16 ■■■■ 已修改文件
src/assets/methods/examination.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/view/content/components/chapter001.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/methods/examination.js
@@ -1,7 +1,7 @@
import { activeBook } from "@/assets/js/config";
import MG from "@/assets/js/middleGround/WebMiddleGroundApi";
import getPublicImage from "@/assets/js/middleGround/tool";
const getQuestionList = (questionList) => {
const getQuestionList = async (questionList) => {
  let cardList = [
    {
      catalogName: "单选题",
@@ -50,7 +50,7 @@
        Embedded_QuestionBank_Difficulty: [],
      },
    };
    MG.store.getProductDetail(query).then((res) => {
    const res = await MG.store.getProductDetail(query);
      res.datas.cmsDatas[0].datas.forEach((item, index) => {
        const questionObj = {
          number: index + 1, // 题号
@@ -191,7 +191,6 @@
          shortArr.push(questionObj);
        }
      });
    });
  }
  cardList[0].infoList = singleChoiceArr,
  cardList[1].infoList = judgeArr
@@ -205,13 +204,14 @@
      citem.number = cindex + 1;
    }
  }
  return cardList;
  console.log(cardList.filter(item=>item.infoList.length > 0),"cardList.filter(item=>item.infoList.length > 0)");
  return cardList.filter(item=>item.infoList.length > 0);
};
const getQuestionData = (chapterData) => {
const getQuestionData = async (chapterData) => {
  const data = { ...chapterData };
  for (let key in chapterData) {
    data[key] = getQuestionList(chapterData[key]);
    data[key] = await getQuestionList(chapterData[key]);
  }
  return data;
};
src/books/childHealth/view/content/components/chapter001.vue
@@ -3427,8 +3427,8 @@
      pathTen:''
    };
  },
  mounted() {
    this.$data.questionData = getQuestionData(testData[1])
  async mounted() {
    this.$data.questionData = await getQuestionData(testData[1])
    console.log('题目',this.$data.questionData );
    this.$data.pathOne = getResourcePath('f6f6588a75086576b87bed2fb9ca1ec1')
    this.$data.pathTwo = getResourcePath('e5993b62684fe55d13190cfe52bf00ed')