bug
litian
2024-09-14 4c29b79d485d68d506e798f4fd381232ebc55a86
packageDomain/pages/resourceDetails/myAudio/index.js
@@ -1,6 +1,9 @@
// pages/resourceDetails/index.js
const app = getApp()
const myAudio = wx.createInnerAudioContext();
import {
  loginInfo
} from '../../../../assets/js/login';
// innerAudioContext.onPlay(function callback),
// InnerAudioContext.onTimeUpdate(function callback)
Page({
@@ -27,6 +30,7 @@
    parentProductLinkPath: '',
    productLinkPath: '',
    threeLeveData: [],
    source: "",
    showData: '',
    src: '',
    selectedId: null,
@@ -96,7 +100,8 @@
      cmsId: options.cmsId,
      parentProductLinkPath: options.parentProductLinkPath,
      productLinkPath: options.productLinkPath,
      formPath: options.formPath
      formPath: options.formPath,
      source: options.source,
    })
    if (options.parentName !== "教学资源" && options.parentName !== "云学习") {
@@ -104,8 +109,21 @@
        parentName: options.parentName,
      })
    }
    this.resourceDetailsData()
    this.getNoteList()
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (data) {
          this.resourceDetailsData()
          this.getNoteList()
        } else {
          this.resourceDetailsData()
          this.getNoteList()
        }
      })
    } else {
      this.resourceDetailsData()
      this.getNoteList()
    }
  },
  /**
@@ -204,9 +222,8 @@
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  },
  onShareAppMessage() {},
  onShareTimeline() {},
  onTabsChange(event) {},
  onTabsClick(event) {},
@@ -266,9 +283,31 @@
      let titleName = '';
      res.datas.cmsDatas[0].datas.forEach((item, index) => {
        if (item.selectType === "audio" || item.learnSelectType === "audio") {
          this.data.threeLeveData.push(item);
        if (this.data.source == 'qrcode') {
          if (item.id == this.data.activeId) {
            this.data.threeLeveData.push(item);
          }
        } else {
          if (item.selectType === "audio" || item.learnSelectType === "audio") {
            // this.data.threeLeveData.push(item);
            if (this.data.storeInfo == 'jsek_digitalCourses') {
              if (this.data.isBuy) {
                if (item.sysType == 'CmsItem') {
                  this.data.threeLeveData.push(item)
                }
              } else {
                if (item.sysType == 'CmsItem' && item.freeFile) {
                  this.data.threeLeveData.push(item)
                }
              }
            } else {
              if (res.datas.purchasedSaleMethodIdList.includes(item.defaultSaleMethodId) || item.freeFile) {
                this.data.threeLeveData.push(item)
              }
            }
          }
        }
      });
      this.data.threeLeveData.forEach((items, indexs) => {
        if (this.data.productLinkPath == items.productLinkPath) {
@@ -306,7 +345,6 @@
      isplay: false
    })
    const item = e.currentTarget.dataset.item
    console.log(item, 222)
    if (this.data.showData != '') {
      this.setData({
        titleName: item.name,
@@ -574,7 +612,6 @@
  },
  // 播放公共代码
  pubulicPlayFun() {
    // debugger
    this.setData({
      speed: 1.0,
    })
@@ -772,7 +809,7 @@
      myAudio.playbackRate = this.data.speed; //  播放速率
    }, 200);
  },
  //获取视频学习
  //获取音频学习
  getPlayerList() {
    app.MG.identity
      .getUserKey({