From e33672cf85da88d515d5fe6ccc0a139c3cfaa5db Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期四, 28 八月 2025 22:53:54 +0800
Subject: [PATCH] 8.28更新

---
 src/books/preventiveDentistry/view/components/index.vue |  100 ++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 73 insertions(+), 27 deletions(-)

diff --git a/src/books/preventiveDentistry/view/components/index.vue b/src/books/preventiveDentistry/view/components/index.vue
index 832614f..bdc1a55 100644
--- a/src/books/preventiveDentistry/view/components/index.vue
+++ b/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;

--
Gitblit v1.9.1