litian
2024-07-10 df618a997dffc27446f03ce2c599d743e6254859
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -81,7 +81,6 @@
      formPath: options.formPath,
      flag: false
    })
    console.log(this.data.storeInfo, 13)
    if (options.parentName !== "教学资源" && options.parentName !== "云学习") {
      this.setData({
        parentName: options.parentName,
@@ -208,7 +207,7 @@
  },
  resourceDetailsData() {
    this.setData({
      // videoLoaidng: true
      videoLoaidng: true
    })
    let query = {
      storeInfo: this.data.storeInfo,
@@ -236,37 +235,32 @@
      }
    }
    app.MG.store.getProductDetail(query).then(res => {
      console.log(this.data.productLinkPath, 345)
      res.datas.cmsDatas[0].datas.forEach((item) => {
        if (item.selectType === "video" || item.learnSelectType === "video") {
          this.data.threeLeveData.push(item)
          this.setData({
            threeLeveData: this.data.threeLeveData
          })
          this.data.threeLeveData.forEach((items, index) => { // 修改此处添加index参数
            if (this.data.productLinkPath == items.productLinkPath) {
              if (this.data.formPath === "jsek_cloudLearning") {
                let file
                items.protectedFile ? file = items.protectedFile : file = items.freeFile
                this.setData({
                  showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey),
                  titleName: items.name
                })
                console.log(this.data.showData, 11)
              } else {
                this.setData({
                  showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
                  titleName: items.name
                })
              }
              let selectedIndex = index; // 存储选中项的索引
              this.setData({
                selectedId: selectedIndex // 设置选中项的索引
              });
            }
          });
        }
      })
      this.data.threeLeveData.forEach((items, index) => { // 修改此处添加index参数
        if (this.data.productLinkPath == items.productLinkPath) {
          if (this.data.formPath === "jsek_cloudLearning") {
            let file
            items.protectedFile || item.file ? file = items.protectedFile || item.file : file = items.freeFile
            this.setData({
              showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey),
              titleName: items.name
            })
          } else {
            this.setData({
              showData: items.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.freeFile,
              titleName: items.name
            })
          }
          let selectedIndex = index; // 存储选中项的索引
          this.setData({
            selectedId: selectedIndex // 设置选中项的索引
          });
        }
      });
      this.setData({
        loading: false,
        hidden: false