闫增涛
2024-04-26 c2cd778fd3f40a75df483758bb2f1fe1dedc7eef
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -34,13 +34,13 @@
    style: 'height: 248rpx',
    submitType: "new", //  新建 or 编辑
    noteId: '',
    videoChange: true,
    startTime: "", //进入页面当前时间
    pauseTime: 0, //暂停时间
    formPath: '',
    loading: true,
    hidden: true
    hidden: true,
    videoError: false
  },
  // 格式化笔记时间
  convertTimestamp(timestamp) {
@@ -59,6 +59,9 @@
   */
  onLoad(options) {
    wx.setNavigationBarTitle({
      title: '资源详情-视频'
    });
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
@@ -70,12 +73,16 @@
      bookId: options.bookId,
      bookName: options.bookName,
      cmsId: options.cmsId,
      parentName: options.parentName,
      parentProductLinkPath: options.parentProductLinkPath,
      productLinkPath: options.productLinkPath,
      formPath: options.formPath,
      flag: false
    })
    if (options.parentName !== "教学资源" && options.parentName !== "云学习") {
      this.setData({
        parentName: options.parentName,
      })
    }
    console.log(options, 'options');
    this.resourceDetailsData()
    this.getNoteList()
@@ -239,7 +246,7 @@
                })
              } else {
                this.setData({
                  showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file,
                  showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
                  titleName: items.name
                })
              }
@@ -289,7 +296,7 @@
        })
      } else {
        this.setData({
          showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file
          showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
        })
      }
@@ -555,5 +562,11 @@
  },
  videoErrorCallback(e) {
    console.log(e);
  },
  videoError: function (e) {
    console.log('视频加载失败', e);
    this.setData({
      videoError: true
    });
  }
})