litian
2025-03-17 450f52d277aef0d7cb5a4993850bc49e1b751829
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -59,7 +59,8 @@
    bookDetail: null,
    learnStartTime: 0,
    learnTimeList: [],
    learnTimeData: 0
    learnTimeData: 0,
    toView: 'activeName',
  },
  // 格式化笔记时间
  convertTimestamp(timestamp) {
@@ -440,6 +441,7 @@
                titleName: items.name
              })
              this.aliVod(file, this.data.showData)
            } else {
              this.setData({
                showData: items.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.freeFile,
@@ -448,6 +450,7 @@
              this.aliVod(items.file, this.data.showData)
            }
            let selectedIndex = index; // 存储选中项的索引
            console.log(selectedIndex, "selectedIndex")
            this.setData({
              selectedId: selectedIndex // 设置选中项的索引
            });
@@ -466,6 +469,7 @@
      this.setData({
        loading: false,
        hidden: false,
        toView: 'activeName' + this.data.selectedId,
      })
    })
  },
@@ -479,9 +483,9 @@
      // showData: '',
      titleName: item.name
    })
    if (item.selectType == "video" || item.learnSelectType === "video") {
      if (this.data.formPath === "jsek_cloudLearning") {
        let file =
          item.protectedFile || item.file ? file = item.protectedFile || item.file : file = item.freeFile
        this.setData({
@@ -498,37 +502,43 @@
  },
  aliVod(md5, currentVideo) {
    let query = {
      md5: md5,
      appRefCode: app.config.appRefCode
    }
    app.MG.file.getAliVod(query).then((res) => {
      if (res) {
        if (res && res.data == '') {
    if (md5) {
      let query = {
        md5: md5,
        appRefCode: app.config.appRefCode
      }
      app.MG.file.getAliVod(query).then((res) => {
        if (res) {
          if (res && res.data == '') {
            this.setData({
              showDataVod: currentVideo,
              videoLoading: false,
            })
          } else {
            this.setData({
              showDataVod: res,
              videoLoading: false,
            })
          }
          this.setData({})
        } else if (currentVideo) {
          this.setData({
            showDataVod: currentVideo,
            videoLoading: false,
          })
        } else {
          this.setData({
            showDataVod: res,
            videoLoading: false,
          return wx.showToast({
            icon: 'error',
            title: '无法获取视频资源',
          })
        }
        this.setData({})
      } else if (currentVideo) {
        this.setData({
          showDataVod: currentVideo,
          videoLoading: false,
        })
      } else {
        return wx.showToast({
          icon: 'error',
          title: '无法获取视频资源',
        })
      }
    })
      })
    } else {
      return wx.showToast({
        icon: 'error',
        title: '暂无视频资源',
      })
    }
  },
  timeUpdate(e) {