From a31c8c9d7df2883b38871819239ec914c6e5ae0c Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期一, 23 十二月 2024 11:55:58 +0800
Subject: [PATCH] 民航服务基本技能视频资源插入

---
 src/books/aviationBasicSkills/view/components/chapter003.vue |  126 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 123 insertions(+), 3 deletions(-)

diff --git a/src/books/aviationBasicSkills/view/components/chapter003.vue b/src/books/aviationBasicSkills/view/components/chapter003.vue
index 620f80d..592f3d0 100644
--- a/src/books/aviationBasicSkills/view/components/chapter003.vue
+++ b/src/books/aviationBasicSkills/view/components/chapter003.vue
@@ -19,8 +19,22 @@
                         <p class="bj-1-zt">1.鎻愰珮涓汉鍦ㄤ汉闄呮矡閫氳繃绋嬩腑鐨勮瑷�娓╁害銆�</p>
                         <p class="bj-1-zt">2.鎻愬崌姘戣埅瀵瑰鏈嶅姟娌熼�氳繃绋嬩腑鐨勬晥鑳姐��</p>
                         <p><br></p>
-                        <p><br></p>
-                        <p><br></p>
+                        <div class="video-box-cover">
+                            <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 == 'f3397edec7e58dc77e76ce434e66f096') > -1 ? collectCheck : collectImg"
+                                        alt="" class="collect-btn" @click="handleCollect('video-01')" />
+                                </el-tooltip>
+                            </p>
+                        </div>
                         <p><br></p>
                     </div>
                 </div>
@@ -196,6 +210,22 @@
                     <p class="p-even">濡傛灉鎮ㄧ幇鍦ㄦ殏鏃朵笉闇�瑕佺敤椁愶紝鎴戜滑灏嗗湪鎮ㄩ渶瑕佹椂鎻愪緵锛屽埌鏃惰鎮ㄦ寜鍛煎敜閾冿紝鎴戜滑灏嗛殢鏃朵负鎮ㄦ湇鍔°��</p>
                     <p class="p-even">鎴戣繕鑳戒负锛堝府锛夋偍鍋氱偣浠�涔堝悧锛�</p>
                     <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>瑙嗛锛氶」鐩笁 浠诲姟1 </span>
+                            <el-tooltip class="item" effect="dark"
+                                :content="chapterData.isCollectVideo01 ? '鐐瑰嚮鍙栨秷' : '鐐瑰嚮鏀惰棌'" placement="top-start">
+                                <img :src="collectResourceList.findIndex(item => item.id == '9908b7f1a3e2197b0d74ffefc42a3fd9') > -1 ? collectCheck : collectImg"
+                                    alt="" class="collect-btn" @click="handleCollect('video-02')" />
+                            </el-tooltip>
+                        </p>
+                    </div>
                 </div>
             </div>
         </div>
@@ -478,6 +508,22 @@
                     <p class="p-even">
                         闆呰鏄寚灏嗕竴浜涗笉渚跨洿瑷�鐨勪簨鐢ㄤ竴绉嶆瘮杈冨濠夈�佸惈钃勭殑鏂瑰紡琛ㄨ揪銆備緥濡傦紝鍦ㄦ帴寰呭瀹㈡椂锛岀敤鈥滃嚑浣嶁�濅唬鏇库�滃嚑涓汉鈥濓紝鐢ㄢ�滃摢涓�浣嶁�濅唬鏇库�滆皝鈥濓紝鐢ㄢ�滆吹濮撯�濅唬鏇库�滀綘濮撲粈涔堚�濓紝鐢ㄢ�滄垜鍘绘柟渚夸竴涓嬧�濅唬鏇库�滄垜鍘讳笂鍘曟墍鈥濓紝鐢ㄢ�滆繖浠惰。鏈嶄笉澶�傚悎鎮ㄢ�濅唬鏇库�滄偍绌胯繖浠惰。鏈嶅緢闅剧湅鈥濓紝鐢ㄢ�滃彂绂忊�濅唬鏇库�滃彂鑳栤�濓紝绛夌瓑銆傞泤璇殑浣跨敤涓嶆槸鏈烘鐨勩�佸浐瀹氱殑锛岄渶瑕佹牴鎹笉鍚屽満鍚堛�佷笉鍚屼汉鐗┿�佷笉鍚屾椂闂寸伒娲昏繍鐢ㄣ��
                     </p>
+                    <div class="video-box">
+                        <p class="center text">
+                            <video :src="videoPathThree" 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.isCollectVideo02 ? '鐐瑰嚮鍙栨秷' : '鐐瑰嚮鏀惰棌'" placement="top-start">
+                                <img :src="collectResourceList.findIndex(item => item.id == '6669e5cb8d28967e1f03a2f9e1700c19') > -1 ? collectCheck : collectImg"
+                                    alt="" class="collect-btn" @click="handleCollect('video-03')" />
+                            </el-tooltip>
+                        </p>
+                    </div>
                     <h4 id="d088" class="p-even">锛堜簩锛夎瑷�鐨勯瓒f��</h4>
                     <p class="p-even">鍦ㄦ棩甯镐氦寰�涓紝鐢熷姩骞介粯鐨勮瑷�鑳藉璧峰埌娲昏穬姘旀皼銆佽瀺娲芥劅鎯呫�佹秷闄ら殧闃傘�佸杩涙矡閫氱殑浣滅敤銆傚繀瑕佹椂锛岃繕鑳芥秷闄ゅ按灏眬闈€��</p>
                     <p class="p-even">鍦ㄦ皯鑸湇鍔$ぜ浠腑锛屽伐浣滀汉鍛樺湪鎺ュ緟鏃呭鏃讹紝璇█涓嶈兘鍛嗘澘锛屼笉瑕佹満姊板湴鍥炵瓟锛岃繖鏍峰鏄撲娇鏃呭鎰熻宸ヤ綔浜哄憳涓嶇儹鎯呫�佷笟鍔′笉鐔熸倝銆佽矗浠诲績涓嶅己銆�</p>
@@ -724,6 +770,8 @@
 </template>
 
 <script>
+import { getResourcePath } from "@/assets/methods/resources";
+import { getCollectResource, setCollectResource } from "@/assets/methods/resources";
 export default {
     name: "chapterThree",
     props: {
@@ -733,6 +781,17 @@
     },
     data() {
         return {
+            collectImg: require("../../assets/images/icon/heart.png"),
+            collectCheck: require("../../assets/images/icon/heart-check.png"),
+            videoPathOne: "",
+            videoPathTwo: "",
+            videoPathThree: "",
+            collectResourceList: [],
+            chapterData: {
+                isCollectVideo: false,
+                isCollectVideo01: false,
+                isCollectVideo02: false,
+            },
             questionData: {
                 teskOne: {
                     one: "",
@@ -786,7 +845,7 @@
             },
         };
     },
-    mounted() {
+    async mounted() {
         const bookQuestion = localStorage.getItem("aviation-book-chapter03");
         if (bookQuestion) {
             this.questionData = JSON.parse(bookQuestion);
@@ -796,8 +855,69 @@
             this.tableData = JSON.parse(bookTableData);
         }
 
+        const choiceQuestion = localStorage.getItem("aviation-book-chapter03-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(
+                "f3397edec7e58dc77e76ce434e66f096"
+            );
+            this.videoPathTwo = await getResourcePath(
+                "9908b7f1a3e2197b0d74ffefc42a3fd9"
+            );
+            this.videoPathThree = await getResourcePath(
+                "6669e5cb8d28967e1f03a2f9e1700c19"
+            );
+        },
+        handleCollect(e) {
+            if (e == 'video-01') {
+                this.handleCollectResource("f3397edec7e58dc77e76ce434e66f096", "f3397edec7e58dc77e76ce434e66f096", '', "瑙嗛", "bits", '瑙嗛锛氶」鐩笁 瀵煎叆')
+                this.chapterData.isCollectVideo = !this.chapterData.isCollectVideo
+            } else if (e == 'video-02') {
+                this.handleCollectResource("9908b7f1a3e2197b0d74ffefc42a3fd9", "9908b7f1a3e2197b0d74ffefc42a3fd9", '', "瑙嗛", "bits", '瑙嗛锛氶」鐩笁 浠诲姟1')
+                this.chapterData.isCollectVideo01 = !this.chapterData.isCollectVideo01
+            } else if (e == 'video-03') {
+                this.handleCollectResource("6669e5cb8d28967e1f03a2f9e1700c19", "6669e5cb8d28967e1f03a2f9e1700c19", '', "瑙嗛", "bits", '瑙嗛锛氶」鐩笁 浠诲姟浜�')
+                this.chapterData.isCollectVideo02 = !this.chapterData.isCollectVideo02
+            } 
+            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-chapter03-Data",
+                JSON.stringify(this.chapterData)
+            );
+        },
+
+
         setBookQuestion() {
             localStorage.setItem(
                 "aviation-book-chapter03",

--
Gitblit v1.9.1