yiming
2024-04-15 b650bb198f03f6974708f27de72dc903af596391
packageDomain/pages/resourceDetails/myAudio/index.js
@@ -233,7 +233,6 @@
    wx.navigateBack();
  },
  resourceDetailsData() {
    let datas = ''
    let query = {
      path: '*',
      queryType: '*',
@@ -241,7 +240,6 @@
      cmsPath: this.data.parentProductLinkPath,
      itemFields: {
        SysType: 'CmsFolder',
        // 资源类型,试读文件,是否允许下载等参数
        selectType: [],
        freeFile: [],
        file: [],
@@ -258,48 +256,45 @@
        size: 999
      }
    }
    app.MG.store.getProductDetail(query).then(res => {
      let selectedId = -1; // 初始化选中项索引
      let showDataUrl = '';
      let titleName = '';
      res.datas.cmsDatas[0].datas.forEach((item, index) => {
        if (item.selectType === "audio" || item.learnSelectType === "audio") {
          this.data.threeLeveData.push(item)
          this.setData({
            threeLeveData: this.data.threeLeveData
          })
          this.data.threeLeveData.push(item);
        }
        this.data.threeLeveData.forEach((items, index) => { // 修改此处添加index参数
          if (this.data.productLinkPath == items.productLinkPath) {
            datas = items
            let selectedIndex = index; // 存储选中项的索引
            this.setData({
              selectedId: selectedIndex // 设置选中项的索引
            });
          }
        });
        if (this.data.productLinkPath == item.productLinkPath) {
          selectedId = index;
        }
      });
      if (selectedId !== -1) {
        let datas = this.data.threeLeveData[selectedId];
        if (this.data.formPath == 'jsek_cloudLearning') {
          // 这里处理云学习的
          this.setData({
            showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + datas.protectedFile + '&token=' + wx.getStorageSync(app.config.tokenKey),
            titleName: datas.name
          })
          this.pubulicPlayFun()
          showDataUrl = app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + datas.protectedFile + '&token=' + wx.getStorageSync(app.config.tokenKey);
        } else {
          this.setData({
            showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + datas.file,
            titleName: datas.name
          })
          this.pubulicPlayFun()
          showDataUrl = app.config.requestCtx + '/file/api/ApiDownload?md5=' + datas.file;
        }
        titleName = datas.name;
      }
      })
      this.data.threeLeveData.forEach((item) => {})
      this.setData({
        threeLeveData: this.data.threeLeveData,
        selectedId: selectedId,
        showData: showDataUrl,
        titleName: titleName,
        loading: false,
        hidden: false
      })
    })
      });
      this.pubulicPlayFun();
    });
  },
  onVideo(e) {
    this.setData({
      myAudioCurrent: '00:00',
@@ -452,7 +447,7 @@
      this.setData({
        "pageCount.total": res.totalSize,
        noteList: res.datas,
        loading: false
        // loading: false
      })
      // console.log('笔记列表', res.datas);
    })