litian
2024-06-26 82f93b8fa8344e55bf5c946ba73463012f186df0
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -16,6 +16,7 @@
    dialogKey: false,
    style: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;',
    activeId: '',
    storeInfo: '',
    bookId: '',
    bookName: '',
    cmsId: '',
@@ -38,9 +39,10 @@
    startTime: "", //进入页面当前时间
    pauseTime: 0, //暂停时间
    formPath: '',
    loading: true,
    loading: false,
    hidden: true,
    videoError: false
    videoError: false,
    videoLoading: false
  },
  // 格式化笔记时间
  convertTimestamp(timestamp) {
@@ -64,11 +66,11 @@
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
    console.log(options, 'options');
    this.setData({
      navBarHeight: navBarHeight,
      barHeight: systInfo.statusBarHeight,
      activeId: options.activeId,
      storeInfo: options.storeInfo,
      bookId: options.bookId,
      bookName: options.bookName,
      cmsId: options.cmsId,
@@ -82,7 +84,6 @@
        parentName: options.parentName,
      })
    }
    console.log(options, 'options');
    this.resourceDetailsData()
    this.getNoteList()
  },
@@ -202,7 +203,11 @@
    wx.navigateBack();
  },
  resourceDetailsData() {
    this.setData({
      // videoLoaidng: true
    })
    let query = {
      storeInfo: this.data.storeInfo,
      path: '*',
      queryType: '*',
      productId: this.data.bookId,
@@ -227,8 +232,9 @@
      }
    }
    app.MG.store.getProductDetail(query).then(res => {
      console.log(this.data.productLinkPath, 345)
      res.datas.cmsDatas[0].datas.forEach((item) => {
        console.log(item);
        console.log(item, 222)
        if (item.selectType === "video" || item.learnSelectType === "video") {
          this.data.threeLeveData.push(item)
          this.setData({
@@ -236,6 +242,7 @@
          })
          this.data.threeLeveData.forEach((items, index) => { // 修改此处添加index参数
            if (this.data.productLinkPath == items.productLinkPath) {
              console.log(items, 5678)
              if (this.data.formPath === "jsek_cloudLearning") {
                let file
                items.protectedFile ? file = items.protectedFile : file = items.freeFile
@@ -267,8 +274,9 @@
  onVideo(e) {
    const item = e.currentTarget.dataset.item
    this.setData({
      videoLoaidng: true,
      selectedId: e.currentTarget.dataset.index,
      showData: '',
      // showData: '',
      titleName: item.name
    })
    if (item.selectType == "video" || item.learnSelectType === "video") {
@@ -356,8 +364,6 @@
      textvalue: e.detail.value
    })
  },
  // 获取笔记列表
  async getNoteList() {
    // this.setData({
@@ -543,5 +549,10 @@
    this.setData({
      videoError: true
    });
  },
  loadedmetadata(e) {
    this.setData({
      videoLoaidng: false
    })
  }
})