From e9a0bf39b68ba1f12082739667b7ebf7c914301e Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期四, 23 五月 2024 15:22:13 +0800
Subject: [PATCH] 优化

---
 src/books/lifeCare/view/chapter002.vue |   16 ++++++++--------
 src/books/lifeCare/view/chapter001.vue |   14 +++++++-------
 src/assets/methods/examination.js      |   10 ++++------
 src/App.vue                            |    2 ++
 src/books/English/assets/main.less     |    2 ++
 5 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index 58aed61..648b032 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -49,7 +49,9 @@
         // childHealth
         this.config.resourceCtx + "lifeCare"
       );
+      console.log('ac',this.activeBook);
       this.config.activeBook = this.activeBook;
+      debugger
       this.config.goodsStore = this.activeBook.storeRefcode;
     }
   }
diff --git a/src/assets/methods/examination.js b/src/assets/methods/examination.js
index 3e059f9..9701e05 100644
--- a/src/assets/methods/examination.js
+++ b/src/assets/methods/examination.js
@@ -1,7 +1,6 @@
-import { activeBook, goodsStore } from "@/assets/js/config";
 import MG from "@/assets/js/middleGround/WebMiddleGroundApi";
 import getPublicImage from "@/assets/js/middleGround/tool";
-const getQuestionList = async (oldList, questionList) => {
+const getQuestionList = async (oldList, questionList,activeBook) => {
   let cardList = [
     {
       catalogName: "鍗曢�夐",
@@ -29,11 +28,10 @@
   let shortArr = []; // 绠�绛�
   let multipleChoiceArr = []; // 澶氶��
   let completionArr = []; // 濉┖
-  console.log("active", activeBook);
   for (let qindex = 0; qindex < questionList.length; qindex++) {
     const qitem = questionList[qindex];
     let query = {
-      storeInfo: goodsStore,
+      storeInfo: activeBook.storeRefcode,
       path: "*",
       cmsPath: activeBook.rootCmsItemId,
       cmsType: "*",
@@ -212,7 +210,7 @@
   return cardList.filter((item) => item.infoList.length > 0);
 };
 
-const getQuestionData = async (chapter, chapterData) => {
+const getQuestionData = async (chapter, chapterData,activeBook) => {
   const data = { ...chapterData };
   const oldAnswerData = localStorage.getItem("oldAnswerData");
   const oldData = oldAnswerData ? JSON.parse(oldAnswerData) : {};
@@ -225,7 +223,7 @@
     if (oldChapterData) {
       oldList = oldChapterData[key];
     }
-    data[key] = await getQuestionList(oldList, chapterData[key]);
+    data[key] = await getQuestionList(oldList, chapterData[key],activeBook);
   }
   return data;
 };
diff --git a/src/books/English/assets/main.less b/src/books/English/assets/main.less
index 31ba6e0..997d57f 100644
--- a/src/books/English/assets/main.less
+++ b/src/books/English/assets/main.less
@@ -803,6 +803,8 @@
       display: flex;
       align-items: center;
       span:first-child {
+        box-sizing: border-box;
+        height: 30px;
         display: inline-block;
         padding: 5px 10px;
         border-radius: 8px 0 0 8px;
diff --git a/src/books/lifeCare/view/chapter001.vue b/src/books/lifeCare/view/chapter001.vue
index 752c37e..4a64bf7 100644
--- a/src/books/lifeCare/view/chapter001.vue
+++ b/src/books/lifeCare/view/chapter001.vue
@@ -1379,10 +1379,10 @@
 </template>
 
 <script>
-// import getResourcePath from "@/assets/methods/resources.js";
-// import getQuestionData from "@/assets/methods/examination.js";
+import getResourcePath from "@/assets/methods/resources.js";
+import getQuestionData from "@/assets/methods/examination.js";
 import testData from "../js/examinationList.js";
-// import examinations from "@/components/examinations/index.vue";
+import examinations from "@/components/examinations/index.vue";
 
 export default {
   name: "chapter001",
@@ -1406,16 +1406,16 @@
     };
   },
   components: {
-    // examinations,
+    examinations,
   },
-  created() {
+  async created() {
     const localData = JSON.parse(localStorage.getItem("chapter001"));
     if (localData) {
       this.chapter001 = { ...Object.assign(this.chapter001, localData) };
     }
 
-    // this.chapter001.videOneUrl = getResourcePath("68ebd5c05bcb742999a9ebdce4b4bd53");
-    // this.qustionData = await getQuestionData('1',testData[1]);
+    this.chapter001.videOneUrl = getResourcePath("68ebd5c05bcb742999a9ebdce4b4bd53");
+    this.chapter001.qustionData = await getQuestionData('1',testData[1],this.config.activeBook);
   },
   methods: {
     activityOne() {
diff --git a/src/books/lifeCare/view/chapter002.vue b/src/books/lifeCare/view/chapter002.vue
index b7f8afd..3330b47 100644
--- a/src/books/lifeCare/view/chapter002.vue
+++ b/src/books/lifeCare/view/chapter002.vue
@@ -1284,10 +1284,10 @@
   </div>
 </template>
 <script>
-// import getResourcePath from "@/assets/methods/resources.js";
-// import getQuestionData from "@/assets/methods/examination.js";
+import getResourcePath from "@/assets/methods/resources.js";
+import getQuestionData from "@/assets/methods/examination.js";
 import testData from "../js/examinationList.js";
-// import examinations from "@/components/examinations/index.vue";
+import examinations from "@/components/examinations/index.vue";
 
 export default {
   name: "chapter002",
@@ -1573,20 +1573,20 @@
     };
   },
   components: {
-    // examinations,
+    examinations,
   },
-  created() {
+  async created() {
     const localData = JSON.parse(localStorage.getItem("chapter002"));
     if (localData) {
       this.chapter002 = { ...Object.assign(this.chapter002, localData) };
     }
-    // this.chapter002.videOneUrl = getResourcePath("6e471afdbeb95a8891f1551cbb0cd4fd");
-    // this.chapter002.videOneUrl116 = getResourcePath('b727b78f8036a38cbd054816a81da7f8')
+    this.chapter002.videOneUrl = getResourcePath("6e471afdbeb95a8891f1551cbb0cd4fd");
+    this.chapter002.videOneUrl116 = getResourcePath('b727b78f8036a38cbd054816a81da7f8')
     this.chapter002.videOneUrl116 =
       "https:/jsek.bnuic.com/file/api/ApiDownload?md5=b727b78f8036a38cbd054816a81da7f8";
     this.chapter002.videOneUrl =
       "https:/jsek.bnuic.com/file/api/ApiDownload?md5=6e471afdbeb95a8891f1551cbb0cd4fd";
-    // this.qustionData = await getQuestionData("2",testData[2]);
+    this.qustionData = await getQuestionData("2",testData[2],this.config.activeBook);
   },
   methods: {
     activityOne() {

--
Gitblit v1.9.1