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 | 143 ++++++++++++++++++++++++++++++++++------------- 1 files changed, 104 insertions(+), 39 deletions(-) diff --git a/src/books/preventiveDentistry/view/components/index.vue b/src/books/preventiveDentistry/view/components/index.vue index c424929..bdc1a55 100644 --- a/src/books/preventiveDentistry/view/components/index.vue +++ b/src/books/preventiveDentistry/view/components/index.vue @@ -9,32 +9,44 @@ transformOrigin: 'center top', }"> <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader> - <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterOne v-if="showCatalogList.indexOf(2) > -1" :showPageList="loadPageList" :getResourceInfo="resourceListFun" + :interfaceQuestion="bookQuestionsList"> </chapterOne> - <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterTwo v-if="showCatalogList.indexOf(3) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterTwo> - <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterThree v-if="showCatalogList.indexOf(4) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterThree> - <chapterFour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterFour v-if="showCatalogList.indexOf(5) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterFour> - <chapterFive v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterFive v-if="showCatalogList.indexOf(6) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterFive> - <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterSix v-if="showCatalogList.indexOf(7) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterSix> - <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterSeven v-if="showCatalogList.indexOf(8) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterSeven> - <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterEight v-if="showCatalogList.indexOf(9) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterEight> - <chapterNine v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterNine v-if="showCatalogList.indexOf(10) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterNine> - <chapterTen v-if="showCatalogList.indexOf(11) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterTen v-if="showCatalogList.indexOf(11) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterTen> - <chapterEleven v-if="showCatalogList.indexOf(12) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterEleven v-if="showCatalogList.indexOf(12) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterEleven> - <chapterTwelve v-if="showCatalogList.indexOf(13) > -1" :showPageList="loadPageList" :resourceList="resourceList"> + <chapterTwelve v-if="showCatalogList.indexOf(13) > -1" :showPageList="loadPageList" + :getResourceInfo="resourceListFun"> </chapterTwelve> <chapterThirteen v-if="showCatalogList.indexOf(14) > -1" :showPageList="loadPageList" - :resourceList="resourceList"> + :getResourceInfo="resourceListFun"> </chapterThirteen> </div> </div> @@ -57,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"; @@ -81,7 +96,8 @@ audioPath: "", currentTime: null, videoList: [], - resourceList: {}, + resourceList: [], + bookQuestionsList: [], }; }, computed: { @@ -112,7 +128,6 @@ // 鍚姩椤电爜瑙傚療 setTimeout(() => { this.initObservation(); - this.initThemeColor(); }, 500); }, }, @@ -124,6 +139,7 @@ this.initViewer(); this.closeAudio(); this.closeVideo(); + this.initThemeColor(); }, 200); }, }, @@ -140,6 +156,11 @@ this.resourceList = newVal; }, }, + bookQuestionsList: { + handler(newVal, oldVal) { + this.bookQuestionsList = newVal; + }, + } }, mounted() { // 榛樿鍔犺浇绔犺妭 @@ -194,16 +215,18 @@ this.getBookResourceList(); + // 鑾峰彇鏁存湰涔﹂鐩� + this.getBookQuestionList(); + // 鍚姩椤电爜瑙傚療 setTimeout(() => { this.initObservation(); - this.initThemeColor(); }, 500); // 娴嬭瘯椤甸潰璺宠浆 - // setTimeout(() => { - // this.gotoPage(14, 196); - // }, 500); + setTimeout(() => { + this.gotoPage(2, 18); + }, 500); // const pageDom = (this.container ? this.container : document) // .querySelector("#app") @@ -221,27 +244,67 @@ }, 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") - ); + ) + .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 }, // 婊氬姩鐩戝惉 scrollFun(event) { @@ -590,7 +653,8 @@ // this.questionDataMap[page] = await getQuestionList( // page, // testData[catalog][page], - // this.config.activeBook + // this.config.activeBook, + // this.bookQuestionsList, // ); // } else { // const obj = {}; @@ -598,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