闫增涛
2024-06-27 447fad1797cc37d2a9e2d5129ce74af728fa8836
题目公共请求方法添加收藏获取
11个文件已修改
99 ■■■■ 已修改文件
.env.product 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/methods/examination.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/artAndDance/assets/main.less 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/artAndDance/view/components/chapter001.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/artAndDance/view/components/chapter002.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/artAndDance/view/components/chapter003.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/artAndDance/view/components/chapter004.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/artAndDance/view/components/chapter005.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/artAndDance/view/components/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/view/content/index.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.product
@@ -1,6 +1,6 @@
VUE_APP_ENV = 'product'
VUE_APP_API_URL = "https://jsek.bnuic.com"
VUE_APP_RESOURCE_CTX = 'https://jsek.bnuic.com/books/resource/'
VUE_APP_PUBLIC_PATH = 'https://jsek.bnuic.com/books/book/artAndDrama'
VUE_APP_PUBLIC_PATH = 'https://jsek.bnuic.com/books/book/english'
VUE_APP_BOOK_LIST = "childHealth/lifeCare/sportsAndHealth/embedded/english/artAndDance/artAndDrama/mathBook"
VUE_APP_BOOK_ID = 'artAndDrama'
VUE_APP_BOOK_ID = 'english'
src/App.vue
@@ -65,7 +65,7 @@
        process.env.VUE_APP_RESOURCE_CTX +
          (process.env.VUE_APP_ENV == "product"
            ? process.env.VUE_APP_BOOK_ID
            : "english")
            : "childHealth")
      );
      // 测试试读30页
      // this.activeBook.tryPageCount = 10;
src/assets/methods/examination.js
@@ -1,7 +1,9 @@
import MG from "@/assets/js/middleGround/WebMiddleGroundApi";
import getPublicImage from "@/assets/js/middleGround/tool";
// 获取题目列表
const getQuestionList = async (page, questionList, activeBook) => {
  console.log("page", page);
const collectList = await getCollectList(activeBook)
console.log('收藏列表',collectList);
  const oldAnswerData = localStorage.getItem(activeBook.name + "oldAnswerData");
  let oldData = null;
  let oldList = [];
@@ -97,7 +99,7 @@
        isSubmit: false, // 查看解析
        isRight: null, // 是否正确
        isComplete: false,
        isCollect: true,
        isCollect: collectList.indexOf(qitem) > -1 ? true : false,
        isUnfold: "",
      };
      // 多选和填空答案肯为数组,要转换JSON格式
@@ -222,7 +224,43 @@
  }
  return cardList.filter((item) => item.infoList.length > 0);
};
// 获取收藏列表
const getCollectList = async(activeBook) => {
  const allCollect = [
    {
      type:'bits',
      collectList:[]
    },
    {
      type:'json',
      collectList:[]
    },
  ]
  await MG.identity
  .getUserKey({
    domain: 'collectData',
    keys: [activeBook.bookId]
  })
  .then((res) => {
    try {
      const collect = JSON.parse(res[0].value)
      if (collect.length) {
        allCollect[0].collectList = collect.find(
          (citem) => citem.type == 'bits'
        ).collectList
        allCollect[1].collectList = collect.find(
          (citem) => citem.type == 'json'
        ).collectList
      }
    } catch (error) {
      console.log('暂无数据')
    }
  })
  .catch(() => {
    console.log('获取收藏报错');
  })
  return allCollect.find(item => item.type == 'bits').collectList
}
const getQuestionData = async (chapter, chapterData, activeBook) => {
  const data = { ...chapterData };
  const oldAnswerData = localStorage.getItem("oldAnswerData");
src/books/artAndDance/assets/main.less
@@ -454,6 +454,13 @@
    }
  }
}
@media (max-width:820px) {
  .ans-dance {
    .page-box {
      min-height: 500px;
    }
  }
}
@media (min-width: 660px) {
  .ans-dance {
    .page-padding {
src/books/artAndDance/view/components/chapter001.vue
@@ -79,7 +79,7 @@
            x5-playsinline=""
            controls
            controlslist="nodownload"
            class="w100"
            class="w100 video"
            style="margin-top: 40px;"
          ></video>
        </div>
src/books/artAndDance/view/components/chapter002.vue
@@ -119,7 +119,7 @@
            x5-playsinline=""
            controls
            controlslist="nodownload"
            class="w100"
            class="w100 video"
            style="margin-top: 40px;"
          ></video>
          <h2 class="lefth2 mt-40" id="b007">
src/books/artAndDance/view/components/chapter003.vue
@@ -79,7 +79,7 @@
            x5-playsinline=""
            controls
            controlslist="nodownload"
            class="w100"
            class="w100 video"
            style="margin-top: 40px;"
          ></video>
        </div>
src/books/artAndDance/view/components/chapter004.vue
@@ -83,7 +83,7 @@
            x5-playsinline=""
            controls
            controlslist="nodownload"
            class="w100"
            class="w100 video"
            style="margin-top: 40px;"
          ></video>
        </div>
src/books/artAndDance/view/components/chapter005.vue
@@ -111,7 +111,7 @@
            x5-playsinline=""
            controls
            controlslist="nodownload"
            class="w100"
            class="w100 video"
            style="margin:38px 0"
          ></video>
          <h2 class="lefth2" id="b003">
src/books/artAndDance/view/components/index.vue
@@ -119,6 +119,7 @@
          this.initSwiper();
          this.initViewer();
          this.closeAudio()
          this.closeVideo()
        }, 200);
      },
    },
@@ -895,7 +896,6 @@
    closeMiniAudio() {
      this.audioPath = "";
    },
    // 点击音频播放,关闭其他音频
    closeAudio() {
      let allAudio = (
@@ -915,6 +915,25 @@
          this.closeMiniAudio()
        })
      }
    },
    // 点击视频关闭其他
    closeVideo() {
      let allVideo = (
        this.container ? this.container : document
      ).querySelectorAll(".video");
      for (let index = 0; index < allVideo.length; index++) {
        const item = allVideo[index];
        item.addEventListener('playing',(item) => {
          const path  = item.srcElement.src
          const videoList = Array.from(allVideo);
          for (let cindex = 0; cindex < videoList.length; cindex++) {
            const citem = videoList[cindex];
            if(citem.currentSrc != path && path) {
              citem.pause()
            }
          }
        })
      }
    }
  },
  components: {
src/books/childHealth/view/content/index.vue
@@ -898,6 +898,7 @@
      // 跳转
      this.gotoPage(data.catalog, data.page, () => {});
    },
    // 点击视频关闭其他
    closeVideo() {
      let allVideo = (
        this.container ? this.container : document
@@ -907,7 +908,6 @@
        item.addEventListener('playing',(item) => {
          const path  = item.srcElement.src
          const videoList = Array.from(allVideo);
          console.log('播放',item);
          for (let cindex = 0; cindex < videoList.length; cindex++) {
            const citem = videoList[cindex];
            if(citem.currentSrc != path && path) {
@@ -917,15 +917,6 @@
        })
      }
    }
    //   allVideo = Array.from(allVideo);
    //   if(allVideo.length) {
    //     for (let index = 0; index < allVideo.length; index++) {
    //       const item = allVideo[index];
    //       if(item.currentSrc != path) {
    //         item.pause()
    //       }
    //     }
    //   }
  },
  components: {
    pageHeader,