From 6c377a85f76fc4e15e1c86cecea4bf8fd2513532 Mon Sep 17 00:00:00 2001 From: unknown <qq1940665526@163.com> Date: 星期二, 25 六月 2024 10:42:19 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout --- src/books/mathBook/view/components/chapter001.vue | 348 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 284 insertions(+), 64 deletions(-) diff --git a/src/books/mathBook/view/components/chapter001.vue b/src/books/mathBook/view/components/chapter001.vue index 1bdc734..adbe2e5 100644 --- a/src/books/mathBook/view/components/chapter001.vue +++ b/src/books/mathBook/view/components/chapter001.vue @@ -156,7 +156,7 @@ placement="top-start" > <img - :src="chapterData.isCollectImg ? collectCheck : collectImg" + :src="collectResourceList.findIndex(item => item.id == '722FE833') > -1 ? collectCheck : collectImg" alt="" class="collect-btn" @click="handleCollect('img')" @@ -184,7 +184,7 @@ placement="top-start" > <img - :src="chapterData.isCollectVideo ? collectCheck : collectImg" + :src="collectResourceList.findIndex(item => item.id == 'a28cd862d61b5df2201406b76e9f01b0') > -1 ? collectCheck : collectImg" alt="" class="collect-btn" @click="handleCollect('video')" @@ -239,10 +239,9 @@ <div class="padding-116"> <p class="fl"> <span> - <span class="zt-ls"><b>渚�2</b></span - >銆�宸茬煡<i>f</i>锛�<i>x</i>锛�=|<i>x</i>|+1鍥惧儚鍦�<i>y</i>杞村彸杈圭殑閮ㄥ垎濡傚浘3-17鎵�绀�.璇曠敾鍑鸿繖涓嚱鏁板浘鍍忓湪<i>y</i>杞村乏杈圭殑閮ㄥ垎. + <span class="zt-ls"><b>渚�2</b></span> + 銆�宸茬煡<i>f</i>锛�<i>x</i>锛�=|<i>x</i>|+1鍥惧儚鍦�<i>y</i>杞村彸杈圭殑閮ㄥ垎濡傚浘3-17鎵�绀�.璇曠敾鍑鸿繖涓嚱鏁板浘鍍忓湪<i>y</i>杞村乏杈圭殑閮ㄥ垎. </span> - <span class="btn-box" @click="isShowExampleTwo = !isShowExampleTwo"> <svg xmlns="http://www.w3.org/2000/svg" @@ -537,7 +536,7 @@ /> </p> </div> - <p class="block"> + <p class="block tl"> 濡傛灉<i>f</i>锛�<i>x</i>锛夛紝<i>g</i>锛�<i>x</i>锛夐兘鏄畾涔夊煙涓�<i>D</i>鐨勫伓鍑芥暟锛岄偅涔�<i>f</i>锛�<i>x</i>锛�+<i>g</i>锛�<i>x</i>锛夊拰<i>f</i>锛�<i>x</i>锛�<i>g</i>锛�<i>x</i>锛変粛鏄伓鍑芥暟鍚楋紵 <textarea cols="30" @@ -565,7 +564,10 @@ </p> <div class="bj"> <examinations - :cardList="questionData" + :cardList="questionData[9]" + :hideCollect="true" + sourceType="json" + inputBc="#d3edfa" v-if="questionData" :isReal="false" ></examinations> @@ -573,14 +575,43 @@ </div> </div> </div> - + <div class="page-box padding-116" page="10"> + <!-- <drag :question="dragQuestion" :page="10"/> --> + <graffiti style="width:100%" /> + </div> <!-- 鍑芥暟鎺т欢寮圭獥 --> <el-dialog - title="" :visible.sync="dialogVisible" width="60%" :append-to-body="true" + :show-close="false" > + <div slot="title" style="padding: 0 0 15px 0;position: relative;"> + <svg + style="position: absolute; right:10px;cursor: pointer;" + @click="dialogVisible = false" + t="1718596022986" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="4252" + width="20" + height="20" + xmlns:xlink="http://www.w3.org/1999/xlink" + > + <path + d="M176.661601 817.172881C168.472798 825.644055 168.701706 839.149636 177.172881 847.338438 185.644056 855.527241 199.149636 855.298332 207.338438 846.827157L826.005105 206.827157C834.193907 198.355983 833.964998 184.850403 825.493824 176.661601 817.02265 168.472798 803.517069 168.701706 795.328267 177.172881L176.661601 817.172881Z" + fill="#979797" + p-id="4253" + ></path> + <path + d="M795.328267 846.827157C803.517069 855.298332 817.02265 855.527241 825.493824 847.338438 833.964998 839.149636 834.193907 825.644055 826.005105 817.172881L207.338438 177.172881C199.149636 168.701706 185.644056 168.472798 177.172881 176.661601 168.701706 184.850403 168.472798 198.355983 176.661601 206.827157L795.328267 846.827157Z" + fill="#979797" + p-id="4254" + ></path> + </svg> + </div> <iframe src="https://www.geogebra.org/calculator" frameborder="0" @@ -589,16 +620,46 @@ </el-dialog> <!-- 瑙i鎬濊矾寮圭獥 --> <el-dialog - title="瑙i鎬濊矾" :visible.sync="thinkingDialog" width="40%" :append-to-body="true" + :show-close="false" > + <div slot="title" style="padding: 0; text-align: center; color: #333;display:flex;justify-content: center;"> + <span style=""> 瑙i鎬濊矾 </span> + <svg + style="position: absolute; right:10px;cursor: pointer;" + @click="thinkingDialog = false" + t="1718596022986" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="4252" + width="20" + height="20" + xmlns:xlink="http://www.w3.org/1999/xlink" + > + <path + d="M176.661601 817.172881C168.472798 825.644055 168.701706 839.149636 177.172881 847.338438 185.644056 855.527241 199.149636 855.298332 207.338438 846.827157L826.005105 206.827157C834.193907 198.355983 833.964998 184.850403 825.493824 176.661601 817.02265 168.472798 803.517069 168.701706 795.328267 177.172881L176.661601 817.172881Z" + fill="#979797" + p-id="4253" + ></path> + <path + d="M795.328267 846.827157C803.517069 855.298332 817.02265 855.527241 825.493824 847.338438 833.964998 839.149636 834.193907 825.644055 826.005105 817.172881L207.338438 177.172881C199.149636 168.701706 185.644056 168.472798 177.172881 176.661601 168.701706 184.850403 168.472798 198.355983 176.661601 206.827157L795.328267 846.827157Z" + fill="#979797" + p-id="4254" + ></path> + </svg> + </div> <ul> <li v-for="(item, index) in thinkOne" :key="index"> <div v-if="item.isShow" style="display: flex"> - <span class="step-num"> - <span class="step-num-box">{{ index + 1 }}</span> + <span style="position: relative"> + <span + style="position: absolute; top: 16px; left: 13px; color: #fff" + >{{ index + 1 }}</span + > <img src="../../assets/images/icon/blue-group.png" alt="" @@ -616,8 +677,20 @@ </div> </li> </ul> - <div class="bottom-btn" @click="showNext(thinkIndex)"> - <img src="../../assets/images/icon/mouse.png" alt="" v-if="thinkIndex != 3" /> + <div + @click="showNext(thinkIndex)" + style=" + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + " + > + <img + src="../../assets/images/icon/mouse.png" + alt="" + v-if="thinkIndex != 3" + /> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" @@ -644,16 +717,50 @@ </el-dialog> <!-- 瑙i姝ラ寮圭獥 --> <el-dialog + class="stepDialog" title="瑙i姝ラ" :visible.sync="stepDialog" width="40%" :append-to-body="true" + :show-close="false" > + <div slot="title" style="padding: 0; text-align: center; color: #333;display:flex;justify-content: center;"> + <span> + 瑙i姝ラ + </span> + <svg + style="position: absolute; right:10px;cursor: pointer;" + @click="stepDialog = false" + t="1718596022986" + class="icon" + viewBox="0 0 1024 1024" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + p-id="4252" + width="20" + height="20" + xmlns:xlink="http://www.w3.org/1999/xlink" + > + <path + d="M176.661601 817.172881C168.472798 825.644055 168.701706 839.149636 177.172881 847.338438 185.644056 855.527241 199.149636 855.298332 207.338438 846.827157L826.005105 206.827157C834.193907 198.355983 833.964998 184.850403 825.493824 176.661601 817.02265 168.472798 803.517069 168.701706 795.328267 177.172881L176.661601 817.172881Z" + fill="#979797" + p-id="4253" + ></path> + <path + d="M795.328267 846.827157C803.517069 855.298332 817.02265 855.527241 825.493824 847.338438 833.964998 839.149636 834.193907 825.644055 826.005105 817.172881L207.338438 177.172881C199.149636 168.701706 185.644056 168.472798 177.172881 176.661601 168.701706 184.850403 168.472798 198.355983 176.661601 206.827157L795.328267 846.827157Z" + fill="#979797" + p-id="4254" + ></path> + </svg> + </div> <ul> <li v-for="(item, index) in stepOne" :key="index"> <div v-if="item.isShow" style="display: flex"> - <span class="step-num"> - <span class="step-num-box">{{ index + 1 }}</span> + <span style="position: relative"> + <span + style="position: absolute; top: 16px; left: 13px; color: #fff" + >{{ index + 1 }}</span + > <img src="../../assets/images/icon/blue-group.png" alt="" @@ -671,8 +778,20 @@ </div> </li> </ul> - <div class="bottom-btn" @click="showNextChange(stepIndex)"> - <img src="../../assets/images/icon/mouse.png" alt="" v-if="stepIndex != 2" /> + <div + @click="showNextChange(stepIndex)" + style=" + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + " + > + <img + src="../../assets/images/icon/mouse.png" + alt="" + v-if="stepIndex != 2" + /> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" @@ -703,23 +822,28 @@ <script> import examinations from "@/components/examinations/index.vue"; import { getResourcePath } from "@/assets/methods/resources"; -import axios from "axios"; +import { getCollectResource,setCollectResource } from "@/assets/methods/resources"; +import drag from '@/components/dragQuestion/index.vue' +import graffiti from "@/components/graffiti/index.vue" export default { name: "chapter-one", - components: { examinations }, + components: { examinations,drag,graffiti }, props: { showPageList: { type: Array, default: [], }, + questionData:{ + type:Object + } }, - mounted() { + async mounted() { const data = localStorage.getItem("math-chapterData"); if (data) { this.chapterData = JSON.parse(data); } this.getPath(); - this.getQuestionData(); + this.collectResourceList = await getCollectResource(this.config.activeBook.bookId) }, data() { return { @@ -734,9 +858,9 @@ thinkingDialog: false, stepDialog: false, videoPath: "", - questionData: [], stepIndex: 1, - thinkIndex:1, + thinkIndex: 1, + collectResourceList:[], chapterData: { isCollectImg: false, isCollectVideo: false, @@ -767,6 +891,80 @@ isShow: false, }, ], + dragQuestion:[ + { + analysisCon: null, + answer: ['A','B','C'], + difficulty: 0, + id: "7BC7B760", + isCollect: false, + isComplete: false, + isRight: null, + isUnfold: "", + isUserAnswer: false, + number: 1, + option: [ + { + img: "", + index: "010311", + txt: "鑳嗗皬鐨�", + value: "A", + isShow:true + }, + { + img: "", + index: "010312", + txt: "鍠勮壇鐨�", + value: "B", + isShow:true + }, + { + img: "", + index: "010313", + txt: "娌夌ǔ鐨�", + value: "C", + isShow:true + }, + ], + optionStyle: "Txt", + questionType: "drag", + score: 2, + stem: { + 0: "铓傝殎闃熼暱璧拌矾鏄傞鎸鸿兏銆佹浼愬潥瀹氾紝瀹冩槸涓�鍙�(", + 1:{ + data: "span", + num: 0 + }, + 2: ")铓傝殎;灏忚殏铓佽蛋璧疯矾鏉ュ皬蹇冪考缈硷紝鐪肩椋樺拷涓嶅畾锛屽畠鏄竴鍙�(", + 3:{ + data:"span", + num:1 + }, + 4:")铓傝殎;铓傝殎灏忓闈㈠甫寰瑧锛屾椂鍒绘効鎰忓府鍔╁ぇ瀹讹紝瀹冩槸涓�鍙�(", + 5:{ + data:"span", + num:2, + }, + 6:" )铓傝殎" + }, + stemStyle: "RichTxt", + type: "鎷栨嫿棰�", + userAnswer:[ + { + vlaue:'', + txt:'' + }, + { + vlaue:'', + txt:'' + }, + { + vlaue:'', + txt:'' + }, + ] + }, + ] }; }, methods: { @@ -781,45 +979,46 @@ "a28cd862d61b5df2201406b76e9f01b0" ); }, - getQuestionData() { - axios - .get(this.config.activeBook.resourceUrl + "/question.json") - .then((res) => { - let oldAnswer = localStorage.getItem( - this.config.activeBook.name + "oldAnswerData" - ); - if (oldAnswer) { - oldAnswer = JSON.parse(oldAnswer); - console.log("鏃ф暟鎹�", oldAnswer); - if (oldAnswer[9]) { - for (let index = 0; index < res.data.data.length; index++) { - const item = res.data.data[index]; - if (item.infoList.length) { - for ( - let cindex = 0; - cindex < item.infoList.length; - cindex++ - ) { - const citem = item.infoList[cindex]; - const question = oldAnswer[9].find( - (ditem) => ditem.id == citem.id - ); - if (question) { - citem.userAnswer = question.userAnswer; - } - } - } - } - } - } - this.questionData = res.data.data; - }); - }, + // getQuestionData() { + // axios + // .get(this.config.activeBook.resourceUrl + "/question.json") + // .then((res) => { + // let oldAnswer = localStorage.getItem( + // this.config.activeBook.name + "oldAnswerData" + // ); + // if (oldAnswer) { + // oldAnswer = JSON.parse(oldAnswer); + // console.log("鏃ф暟鎹�", oldAnswer); + // if (oldAnswer[9]) { + // for (let index = 0; index < res.data.data.length; index++) { + // const item = res.data.data[index]; + // if (item.infoList.length) { + // for ( + // let cindex = 0; + // cindex < item.infoList.length; + // cindex++ + // ) { + // const citem = item.infoList[cindex]; + // const question = oldAnswer[9].find( + // (ditem) => ditem.id == citem.id + // ); + // if (question) { + // citem.userAnswer = question.userAnswer; + // } + // } + // } + // } + // } + // } + // this.questionData = res.data.data; + // }); + // }, handleCollect(type) { if (type == "img") { - this.chapterData.isCollectImg = !this.chapterData.isCollectImg; + this.handleCollectResource("722FE833","",'images/0101-1.jpg',"鍥剧墖","json",'鍥�3-15') } else if (type == "video") { - this.chapterData.isCollectVideo = !this.chapterData.isCollectVideo; + this.handleCollectResource("a28cd862d61b5df2201406b76e9f01b0","a28cd862d61b5df2201406b76e9f01b0",'',"瑙嗛","bits",'瑙嗛锛氬垽鏁板嚱鏁板鍋舵�х殑鏂规硶鍜屾楠�') + // setCollectResource(this.config.activeBook.bookId,[]) } this.handleChapterData(); }, @@ -833,17 +1032,36 @@ const number = this.thinkOne.findIndex((item, index) => index == num); console.log(number); this.thinkOne[number].isShow = true; - if(this.thinkIndex <= 2) { - this.thinkIndex ++ + if (this.thinkIndex <= 2) { + this.thinkIndex++; } }, showNextChange(num) { const number = this.stepOne.findIndex((item, index) => index == num); this.stepOne[number].isShow = true; - if(this.stepIndex < 2) { - this.stepIndex ++ + if (this.stepIndex < 2) { + this.stepIndex++; } }, + //璧勬簮鏀惰棌浜嬩欢 + handleCollectResource(id,md5,resourcePath,resourceType,source,resourceName){ + console.log(this.collectResourceList); + let list = this.collectResourceList + if(list.findIndex(item => item.id == id) > -1) { + list = list.filter(item => item.id != id) + } else { + list.push({ + id, + md5, + resourcePath, + resourceType, + source, + resourceName, + }) + } + this.collectResourceList = list + setCollectResource(this.config.activeBook.bookId,this.collectResourceList) + } }, }; </script> @@ -881,4 +1099,6 @@ color: #fff; } } +.stepDialog { +} </style> -- Gitblit v1.9.1