From 8d1b3ab8d78cdcdd745f931ae6a8cf68173cfe69 Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期五, 27 十二月 2024 11:41:49 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout

---
 src/books/aviationSafety/view/components/chapter007.vue |  283 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 265 insertions(+), 18 deletions(-)

diff --git a/src/books/aviationSafety/view/components/chapter007.vue b/src/books/aviationSafety/view/components/chapter007.vue
index 8c15139..71e1c1e 100644
--- a/src/books/aviationSafety/view/components/chapter007.vue
+++ b/src/books/aviationSafety/view/components/chapter007.vue
@@ -1066,16 +1066,47 @@
                 </div>
             </div>
         </div>
-    </div>
+  </div>
 </template>
 
 <script>
-import preView from '@/components/pdfview/index.vue'
+import preView from "@/components/pdfview/index.vue";
+import { getResourcePath } from "@/assets/methods/resources";
+import {
+  getCollectResource,
+  setCollectResource,
+} from "@/assets/methods/resources";
 export default {
-    name: "chapterSeven",
-    props: {
-        showPageList: {
-            type: Array,
+  name: "chapterSeven",
+  props: {
+    showPageList: {
+      type: Array,
+    },
+  },
+  components: {
+    preView,
+  },
+  data() {
+    return {
+      collectImg: require("../../assets/images/icon/heart.png"),
+      collectCheck: require("../../assets/images/icon/heart-check.png"),
+      collectResourceList: [],
+      videoPathOne: "",
+      videoPathTwo: "",
+      videoPathThree: "",
+      chapterData: {
+        isCollectVideo: false,
+        isCollectVideo2: false,
+        isCollectVideo3: false
+      },
+      pdfDialogRef: "",
+      somePdfTitleValue: "",
+      p_md5: "",
+      dialogVisible: false,
+      questionData: {
+        isComplete: false,
+        checkOne: {
+          value: [],
         },
     },
     components: {
@@ -1281,21 +1312,237 @@
                 JSON.stringify(this.questionData)
             );
         },
-        setBookTableData() {
-            localStorage.setItem(
-                "safety-book-chapter07-tableData",
-                JSON.stringify(this.tableData)
-            );
+        checkThree: {
+          value: [],
         },
-        toUrl(val) {
-            if (val) {
-                this.p_md5 = this.chapter06.pdfMd5[val].md5
-                this.somePdfTitleValue = this.chapter06.pdfMd5[val].name
-                this.$refs.pdfDialogRef.openDialog()
-            }
+        checkFour: {
+          value: [],
         },
+        checkFive: {
+          value: [],
+        },
+        teskOne: {
+          one: "",
+          two: "",
+          three: "",
+          four: "",
+        },
+        teskTwo: {
+          one: "",
+          two: "",
+          three: "",
+        },
+        teskThree: {
+          one: "",
+          two: "",
+        },
+        teskFour: {
+          one: "",
+          two: "",
+        },
+      },
+      tableData: {
+        teskTableOne: {
+          one: "",
+        },
+        teskTableTwo: {
+          one: "",
+          two: "",
+          three: "",
+          four: "",
+          five: "",
+          six: "",
+          seven: "",
+          eight: "",
+          nine: "",
+          ten: "",
+          eleven: "",
+        },
+        teskTableSpecial: {
+          one: "",
+          two: "",
+          three: "",
+          four: "",
+          five: "",
+          six: "",
+          seven: "",
+          eight: "",
+          nine: "",
+          ten: "",
+          eleven: "",
+          twelve: "",
+        },
+        teskTableSpecialOne: {
+          one: "",
+          two: "",
+          three: "",
+          four: "",
+          five: "",
+          six: "",
+          seven: "",
+          eight: "",
+          nine: "",
+          ten: "",
+          eleven: "",
+          twelve: "",
+        },
+        teskTableSpecialTwo: {
+          one: "",
+          two: "",
+          three: "",
+          four: "",
+          five: "",
+          six: "",
+          seven: "",
+          eight: "",
+          nine: "",
+          ten: "",
+          eleven: "",
+          twelve: "",
+        },
+        teskTableSpecialThree: {
+          one: "",
+          two: "",
+          three: "",
+          four: "",
+          five: "",
+          six: "",
+          seven: "",
+          eight: "",
+          nine: "",
+          ten: "",
+          eleven: "",
+          twelve: "",
+        },
+      },
+    };
+  },
+  async mounted() {
+    const bookQuestion = localStorage.getItem("safety-book-chapter07");
+    if (bookQuestion) {
+      this.questionData = JSON.parse(bookQuestion);
+    }
+    const bookTableData = localStorage.getItem(
+      "safety-book-chapter07-tableData"
+    );
+    if (bookTableData) {
+      this.tableData = JSON.parse(bookTableData);
+    }
+
+    const choiceQuestion = localStorage.getItem("safety-book-chapter07-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(
+        "9f2d39d6006dd01b6cc03c7b493a48cb"
+      );
+      this.videoPathTwo = await getResourcePath(
+        "e417b24d23bfcf0fd883a437f14efbee"
+      );
+      this.videoPathThree = await getResourcePath(
+        "defb9b72a2cadcbbbffbc477f30209b1"
+      );
     },
+    handleCollect(e) {
+      if (e == "video-01") {
+        this.handleCollectResource(
+          "9f2d39d6006dd01b6cc03c7b493a48cb",
+          "9f2d39d6006dd01b6cc03c7b493a48cb",
+          "",
+          "瑙嗛",
+          "bits",
+          "瑙嗛锛氳揣閭畨妫�鐨勬櫘閫氳揣鐗╂鏌ユ祦绋�"
+        );
+        this.chapterData.isCollectVideo = !this.chapterData.isCollectVideo;
+      } else if (e == "video-02") {
+        this.handleCollectResource(
+          "e417b24d23bfcf0fd883a437f14efbee",
+          "e417b24d23bfcf0fd883a437f14efbee",
+          "",
+          "瑙嗛",
+          "bits",
+          "瑙嗛锛氳揣閭畨妫�鍙戠幇鐤戜技鐖嗙偢鐗╁搧鐨勫畨鍏ㄦ鏌ユ祦绋�"
+        );
+        this.chapterData.isCollectVideo2 = !this.chapterData.isCollectVideo2;
+      } else if (e == "video-03") {
+        this.handleCollectResource(
+          "defb9b72a2cadcbbbffbc477f30209b1",
+          "defb9b72a2cadcbbbffbc477f30209b1",
+          "",
+          "瑙嗛",
+          "bits",
+          "瑙嗛锛氳揣閭畨妫�璐х墿妫�鏌ュ拰鐖嗘帰妫�娴嬫祦绋�"
+        );
+        this.chapterData.isCollectVideo3 = !this.chapterData.isCollectVideo3;
+      } 
+      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(
+        "safety-book-chapter06-Data",
+        JSON.stringify(this.chapterData)
+      );
+    },
+    setBookQuestion() {
+      localStorage.setItem(
+        "safety-book-chapter07",
+        JSON.stringify(this.questionData)
+      );
+    },
+    setBookTableData() {
+      localStorage.setItem(
+        "safety-book-chapter07-tableData",
+        JSON.stringify(this.tableData)
+      );
+    },
+    toUrl(val) {
+      if (val) {
+        this.p_md5 = this.chapter06.pdfMd5[val].md5;
+        this.somePdfTitleValue = this.chapter06.pdfMd5[val].name;
+        this.$refs.pdfDialogRef.openDialog();
+      }
+    },
+  },
 };
 </script>
 
-<style lang="less" scoped></style>
\ No newline at end of file
+<style lang="less" scoped></style>

--
Gitblit v1.9.1