yiming
2024-04-15 2d3276fce97e33f5c7f04a74632e18ebb01c3a4d
音频优化1
2个文件已修改
84 ■■■■ 已修改文件
assets/js/config.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myAudio/index.js 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
assets/js/config.js
@@ -1,7 +1,7 @@
export const requestCtx = "http://182.92.203.7:3001"; // 请求地址
export const appId = 27;
// export const requestCtx = "https://jsek.bnuic.com"; // 请求地址
// export const appId = 3;
// export const requestCtx = "http://182.92.203.7:3001"; // 请求地址
// export const appId = 27;
export const requestCtx = "https://jsek.bnuic.com"; // 请求地址
export const appId = 3;
// export const epubUrl = "http://182.92.203.7:3007/epubReadMobile/";
export const epubUrl = "https://jsek.bnuic.com/epubReadMobile/#/";
export const pdfUrl = "http://182.92.203.7:3007/pdfRead/";
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,52 +256,50 @@
        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.forEach((items, index) => { // 修改此处添加index参数
          if (this.data.productLinkPath == items.productLinkPath) {
            datas = items
            let selectedIndex = index; // 存储选中项的索引
            this.setData({
              selectedId: selectedIndex // 设置选中项的索引
            });
          }
        });
        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()
        } else {
          this.setData({
            showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + datas.file,
            titleName: datas.name
          })
          this.pubulicPlayFun()
          this.data.threeLeveData.push(item);
        }
      });
      console.log(this.data.threeLeveData);
      this.data.threeLeveData.forEach((items, indexs) => {
        if (this.data.productLinkPath == items.productLinkPath) {
          selectedId = indexs;
        }
      })
      this.data.threeLeveData.forEach((item) => {})
      setTimeout(() => {
        this.setData({
          loading: false,
          hidden: false
        })
      }, 3000)
      if (selectedId !== -1) {
        let datas = this.data.threeLeveData[selectedId];
    })
        if (this.data.formPath == 'jsek_cloudLearning') {
          showDataUrl = app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + datas.protectedFile + '&token=' + wx.getStorageSync(app.config.tokenKey);
        } else {
          console.log(datas);
          showDataUrl = app.config.requestCtx + '/file/api/ApiDownload?md5=' + datas.file;
        }
        titleName = datas.name;
      }
      this.setData({
        threeLeveData: this.data.threeLeveData,
        selectedId: selectedId,
        showData: showDataUrl,
        titleName: titleName,
        loading: false,
        hidden: false
      });
      this.pubulicPlayFun();
    });
  },
  onVideo(e) {
    this.setData({