From 6997ee42e0fd3519f8ae418ee02749a85255707b Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 23 十二月 2024 14:35:21 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout --- src/books/aviationBasicSkills/view/components/chapter001.vue | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 100 insertions(+), 1 deletions(-) diff --git a/src/books/aviationBasicSkills/view/components/chapter001.vue b/src/books/aviationBasicSkills/view/components/chapter001.vue index 98b8588..ec145fa 100644 --- a/src/books/aviationBasicSkills/view/components/chapter001.vue +++ b/src/books/aviationBasicSkills/view/components/chapter001.vue @@ -213,6 +213,22 @@ <p class="p-even"> 绗笁锛屾満鍦哄疄琛屽睘鍦扮鐞嗐�傛寜鐓ф斂浼佸垎寮�銆佸睘鍦扮鐞嗙殑鍘熷垯锛屾垜鍥藉90涓満鍦鸿繘琛屼簡灞炲湴鍖栫鐞嗘敼闈┿�傛皯鑸�诲眬鐩存帴绠$悊鐨勬満鍦轰笅鏀炬墍鍦ㄧ渷锛堝尯銆佸競锛夌鐞嗭紝鐩稿叧璧勪骇銆佽礋鍊哄拰浜哄憳涓�骞跺垝杞紱姘戣埅鎬诲眬涓庡湴鏂规斂搴滆仈鍚堢鐞嗙殑姘戠敤鏈哄満鍜屽啗姘戝悎鐢ㄦ満鍦猴紝灞炴皯鑸�诲眬绠$悊鐨勮祫浜с�佽礋鍊哄強鐩稿叧浜哄憳涓�骞跺垝杞墍鍦ㄧ渷锛堝尯銆佸競锛夌鐞嗐�傞閮芥満鍦恒�佽タ钘忚嚜娌诲尯鍐呯殑姘戠敤鏈哄満缁х画鐢辨皯鑸�诲眬绠$悊銆�2004骞�7鏈�8鏃ワ紝闅忕潃鐢樿們鐪佸唴鐨勬皯鐢ㄦ満鍦虹Щ浜ゅ湴鏂癸紝鏈哄満灞炲湴鍖栫鐞嗘敼闈╁叏闈㈠畬鎴愶紝涔熸爣蹇楃潃姘戣埅浣撳埗鏀归潻鍏ㄩ潰瀹屾垚銆� </p> + <div class="video-box"> + <p class="center text"> + <video :src="videoPathOne" webkit-playsinline="true" x-webkit-airplay="true" + playsinline="true" x5-video-orientation="h5" x5-video-player-fullscreen="true" + x5-playsinline="" controls controlslist="nodownload" class="w100 video" + style=" border-radius: 10px; "></video> + </p> + <p class="center videoname"> + <span>瑙嗛锛氶」鐩竴 浠诲姟涓�</span> + <el-tooltip class="item" effect="dark" + :content="chapterData.isCollectVideo ? '鐐瑰嚮鍙栨秷' : '鐐瑰嚮鏀惰棌'" placement="top-start"> + <img :src="collectResourceList.findIndex(item => item.id == '77cad1fcb6a581d2fce136aa6aa9c4f8') > -1 ? collectCheck : collectImg" + alt="" class="collect-btn" @click="handleCollect('video-01')" /> + </el-tooltip> + </p> + </div> <h3 id="c002" class="p-even"> <span class="zt-h4">浜屻��</span><span class="qyls-h4">鎴戝浗姘戠敤鑸┖杩愯緭涓氱殑鐜扮姸</span> </h3> @@ -637,6 +653,22 @@ <p class="p-even"> 姘戣埅鏈嶅姟鐨勯珮鏍囧噯锛岄渶瑕佷粠涓氫汉鍛樺叿澶囬珮绱犺川銆傝嚜浠庢皯鑸涓氬垱寤轰互鏉ワ紝姘戣埅鍛樺伐鐗瑰埆鏄┖涓箻鍔′汉鍛樼殑楂樼礌璐紝宸蹭负骞垮ぇ鏃呭鐣欎笅浜嗗崄鍒嗚壇濂界殑琛屼笟鍗拌薄銆傚湪鐜颁唬姘戣埅鏈嶅姟涓紝鏃呭瀵规皯鑸憳宸ョ殑绱犺川鎻愬嚭浜嗘洿楂樼殑瑕佹眰锛屾皯鑸憳宸ラ渶瑕佸湪鑷韩鐭ヨ瘑銆佽瑷�銆佺ぜ浠�佽涓虹瓑鏂归潰鎻愰珮绱犺川鍜屼慨涓恒�� </p> + <div class="video-box"> + <p class="center text"> + <video :src="videoPathTwo" webkit-playsinline="true" x-webkit-airplay="true" + playsinline="true" x5-video-orientation="h5" x5-video-player-fullscreen="true" + x5-playsinline="" controls controlslist="nodownload" class="w100 video" + style=" border-radius: 10px; "></video> + </p> + <p class="center videoname"> + <span>瑙嗛锛氶」鐩竴 浠诲姟浜�</span> + <el-tooltip class="item" effect="dark" + :content="chapterData.isCollectVideo01 ? '鐐瑰嚮鍙栨秷' : '鐐瑰嚮鏀惰棌'" placement="top-start"> + <img :src="collectResourceList.findIndex(item => item.id == 'b124a569b4c3d11745db152f26b0b9f1') > -1 ? collectCheck : collectImg" + alt="" class="collect-btn" @click="handleCollect('video-02')" /> + </el-tooltip> + </p> + </div> <h3 id="c007" class="p-even"> <span class="zt-h4">浜斻��</span><span class="qyls-h4">姘戣埅鏈嶅姟鐨勫垎绫�</span> </h3> @@ -1561,6 +1593,8 @@ </template> <script> +import { getResourcePath } from "@/assets/methods/resources"; +import { getCollectResource, setCollectResource } from "@/assets/methods/resources"; export default { name: "chapterOne", props: { @@ -1570,6 +1604,15 @@ }, data() { return { + collectImg: require("../../assets/images/icon/heart.png"), + collectCheck: require("../../assets/images/icon/heart-check.png"), + videoPathOne: "", + videoPathTwo: "", + collectResourceList: [], + chapterData: { + isCollectVideo: false, + isCollectVideo01: false, + }, questionData: { teskOne: { one: "", @@ -1649,7 +1692,7 @@ }, }; }, - mounted() { + async mounted() { const bookQuestion = localStorage.getItem("aviation-book-chapter01"); if (bookQuestion) { this.questionData = JSON.parse(bookQuestion); @@ -1659,8 +1702,64 @@ this.tableData = JSON.parse(bookTableData); } + const choiceQuestion = localStorage.getItem("aviation-book-chapter01-Data"); + if (choiceQuestion) { + this.chapterData = JSON.parse(choiceQuestion); + } + + this.getVidoePath(); + this.collectResourceList = await getCollectResource(this.config.activeBook.bookId) }, methods: { + async getVidoePath() { + this.videoPathOne = await getResourcePath( + "77cad1fcb6a581d2fce136aa6aa9c4f8" + ); + this.videoPathTwo = await getResourcePath( + "b124a569b4c3d11745db152f26b0b9f1" + ); + }, + handleCollect(e) { + if (e == 'video-01') { + this.handleCollectResource("77cad1fcb6a581d2fce136aa6aa9c4f8", "77cad1fcb6a581d2fce136aa6aa9c4f8", '', "瑙嗛", "bits", '瑙嗛锛氶」鐩竴 浠诲姟涓�') + this.chapterData.isCollectVideo = !this.chapterData.isCollectVideo + } else if (e == 'video-02') { + this.handleCollectResource("b124a569b4c3d11745db152f26b0b9f1", "b124a569b4c3d11745db152f26b0b9f1", '', "瑙嗛", "bits", '瑙嗛锛氶」鐩竴 浠诲姟浜�') + this.chapterData.isCollectVideo01 = !this.chapterData.isCollectVideo01 + } + this.handleChapterData(); + }, + + //璧勬簮鏀惰棌浜嬩欢 + // resourcePath 鏂囦欢璺緞锛� + // resourceType 鏂囦欢绫诲瀷 + // source 鏂囦欢鏉ユ簮 + handleCollectResource(id, md5, resourcePath, resourceType, source, resourceName) { + 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) + }, + handleChapterData() { + localStorage.setItem( + "aviation-book-chapter01-Data", + JSON.stringify(this.chapterData) + ); + }, + + + setBookQuestion() { localStorage.setItem( "aviation-book-chapter01", -- Gitblit v1.9.1