From 924121953fb670fd3c2278fffc26b65b57620110 Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期二, 06 八月 2024 16:50:14 +0800
Subject: [PATCH] 英语书整本Bug修改结束

---
 src/books/artAndDrama/view/components/chapter004.vue |   43 +++++++++++++++++++++++++++++++++----------
 1 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/src/books/artAndDrama/view/components/chapter004.vue b/src/books/artAndDrama/view/components/chapter004.vue
index 8e13d67..f8ccd77 100644
--- a/src/books/artAndDrama/view/components/chapter004.vue
+++ b/src/books/artAndDrama/view/components/chapter004.vue
@@ -133,7 +133,7 @@
                     <h3 class="lefth3" id="c038" style="margin-top: 7%;"><img class="img-gn1" alt=""
                             src="../../assets/images/czysj.jpg" /></h3>
                     <p class="text"><span class="hs1">鈼�</span>閭�璇峰悓浼村叡鍚屽畬鎴愩�婁竴鍧楀ザ閰�嬬殑灞曟紨鍚э紒</p>
-                    <p class="center openImgBox"><img class="img-e" alt="" src="../../assets/images/4-2.gif" /></p>
+                    <p class="center openImgBox"><img class="img-e" alt="" src="../../assets/images/0036-2.jpg" /></p>
                 </div>
                 <!-- 姝ゆ涓洪〉鑴氶儴鍒嗭紙闇�瑕佽缃〉鐮侊級 -->
                 <div class="page-footer">
@@ -212,8 +212,8 @@
                         <span>瑙嗛锛氬洟缁撳氨鏄姏閲� </span>
                         <el-tooltip class="item" effect="dark" :content="chapterData.isCollectVideo ? '鐐瑰嚮鍙栨秷' : '鐐瑰嚮鏀惰棌'"
                             placement="top-start">
-                            <img :src="chapterData.isCollectVideo ? collectCheck : collectImg" alt=""
-                                class="collect-btn" @click="handleCollect('video')" />
+                            <img :src="collectResourceList.findIndex(item => item.id == '691cbd2c13198d04afc7800d0f2cafb0') > -1 ? collectCheck : collectImg"
+                                alt="" class="collect-btn" @click="handleCollect('video')" />
                         </el-tooltip>
                     </p>
                 </div>
@@ -229,6 +229,7 @@
 <script>
 import { getResourcePath } from "@/assets/methods/resources";
 import graffiti from '@/components/graffiti/index.vue'
+import { getCollectResource, setCollectResource } from "@/assets/methods/resources";
 export default {
     name: "chapterFour",
     props: {
@@ -238,12 +239,18 @@
     },
     components: { graffiti },
     //鍦ㄨ繖閲屽璋冪敤鐨勬柟娉曡繘琛屾寕杞�
-    mounted() {
+    async mounted() {
         this.getVidoePath();
         const bookQuestion = localStorage.getItem("artAndDrama-book-question-four");
         if (bookQuestion) {
             this.questionData = JSON.parse(bookQuestion);
         }
+
+        const data = localStorage.getItem("artAndDrama-chapter04-Data");
+        if (data) {
+            this.chapterData = JSON.parse(data);
+        }
+        this.collectResourceList = await getCollectResource(this.config.activeBook.bookId)
     },
     data() {
         return {
@@ -256,6 +263,7 @@
             audioPathFour: "",
             audioPathFive: "",
             isFocused: null, // 鐢ㄤ簬璺熻釜textarea鐨勮仛鐒︾姸鎬�
+            collectResourceList: [],
             chapterData: {
                 isCollectImg: false,
                 isCollectVideo: false,
@@ -319,7 +327,6 @@
             this.isFocused = null; // 褰搕extarea澶卞幓鐒︾偣鏃讹紝璁剧疆涓篺alse  
         },
         setBookQuestion() {
-            console.log("淇濆瓨");
             localStorage.setItem(
                 "artAndDrama-book-question-four",
                 JSON.stringify(this.questionData)
@@ -327,18 +334,34 @@
         },
         handleChapterData() {
             localStorage.setItem(
-                "math-chapterData",
+                "artAndDrama-chapter04-Data",
                 JSON.stringify(this.chapterData)
             );
         },
         handleCollect(type) {
-            if (type == "img") {
-                this.chapterData.isCollectImg = !this.chapterData.isCollectImg;
-            } else if (type == "video") {
-                this.chapterData.isCollectVideo = !this.chapterData.isCollectVideo;
+            if (type == "video") {
+                this.handleCollectResource("09de7704eeaaf3a210b8c6af0a94d545", "09de7704eeaaf3a210b8c6af0a94d545", '', "瑙嗛", "bits", '瑙嗛锛氬洟缁撳氨鏄姏閲�')
             }
             this.handleChapterData();
         },
+        //璧勬簮鏀惰棌浜嬩欢
+        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)
+        }
     },
 };
 </script>

--
Gitblit v1.9.1