From ce70bc450a2401997bb850f89f3c4dc0a23e0a72 Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期五, 05 九月 2025 18:38:13 +0800 Subject: [PATCH] 31 数字化口腔修复技术 整本 --- src/books/preventiveDentistry/view/components/index.vue | 113 +++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 71 insertions(+), 42 deletions(-) diff --git a/src/books/preventiveDentistry/view/components/index.vue b/src/books/preventiveDentistry/view/components/index.vue index 832614f..2685bac 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,53 +225,70 @@ // 娴嬭瘯椤甸潰璺宠浆 setTimeout(() => { - this.gotoPage(2, 14); + this.gotoPage(2, 18); }, 500); - - // const pageDom = (this.container ? this.container : document) - // .querySelector("#app") - // .querySelectorAll(".page-box"); - // 妫�绱� - // console.log(this.searchTextByPage("淇濇姢鍐呰剰鍣ㄥ畼"), "searchTextByPage"); - // 妫�绱㈣烦杞� - // this.searchItemLocation({ - // catalog: 2, - // page: 10, - // txt: " 杩愬姩绯荤粺鏄敱楠ㄣ�侀杩炵粨鍜岄楠艰倢涓夐儴鍒嗙粍鎴愮殑銆傚叏韬殑楠ㄩ�氳繃楠ㄨ繛缁撶粍鎴愪汉浣撻楠硷紙瑙佸浘1-1锛夈�傞楠兼槸浜轰綋鐨勬敮鏋讹紝鍏锋湁淇濇姢鍐呰剰鍣ㄥ畼銆佷緵鑲岃倝闄勭潃鍜屼綔涓鸿倢鑲夎繍鍔ㄧ殑鏉犳潌绛変綔鐢ㄣ�傚湪绁炵粡绯荤粺鐨勬敮閰嶄笅锛岃倢鑲夋敹缂╃壍鍔ㄦ墍闄勭潃鐨勯缁曠潃鍏宠妭杞姩锛屼娇韬綋浜х敓鍚勭鍔ㄤ綔銆傛墍浠ワ紝杩愬姩绯荤粺鍏锋湁杩愬姩銆佹敮鎸佸拰淇濇姢绛夊姛鑳斤紝骞煎勾鏃舵湡鐨勯楠艰繕鍏锋湁閫犺鍔熻兘銆� ", - // txtIndex: 57 - // }); - // }, 500); }, 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 => { + 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); + } + }); + } + 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 + console.log(data,"data"); }, + + // 婊氬姩鐩戝惉 scrollFun(event) { this.handleVideoPicture(); @@ -609,7 +636,8 @@ // this.questionDataMap[page] = await getQuestionList( // page, // testData[catalog][page], - // this.config.activeBook + // this.config.activeBook, + // this.bookQuestionsList, // ); // } else { // const obj = {}; @@ -617,7 +645,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