yiming
2024-03-22 1e0ffc1deed2044f96bab70e10d5c5544f6a23bf
packageDomain/pages/resourceDetails/myAudio/index.js
@@ -42,6 +42,12 @@
    speed: 1.0,
  },
  // 时间格式化
  format(t) {
    let time = Math.floor(t / 60) >= 10 ? Math.floor(t / 60) : '0' + Math.floor(t / 60);
    t = time + ':' + ((t % 60) / 100).toFixed(2).slice(-2);
    return t;
  },
  audio: null,
  // 格式化笔记时间
  convertTimestamp(timestamp) {
@@ -56,12 +62,7 @@
    return formattedDate
  },
  // 时间格式化
  format(t) {
    let time = Math.floor(t / 60) >= 10 ? Math.floor(t / 60) : '0' + Math.floor(t / 60);
    t = time + ':' + ((t % 60) / 100).toFixed(2).slice(-2);
    return t;
  },
  /**
   * 生命周期函数--监听页面加载
@@ -104,6 +105,7 @@
   */
  onShow() {
    this.pubulicPlayFun()
  },
  /**
@@ -241,7 +243,6 @@
    }
    this.setData({
      selectedId: e.currentTarget.dataset.index,
    })
@@ -373,9 +374,9 @@
    await app.MG.ugc.getTopicMessageList(query).then((res) => {
      // notePage.value.total = res.totalSize
      res.datas.forEach((item) => {
        // item.compliceHover = false
        // item.deleteHover = false
        item.createDate = this.convertTimestamp(item.createDate)
        console.log(item, 'item789');
      })
      this.setData({
        "pageCount.total": res.totalSize,
@@ -523,6 +524,7 @@
      myAudio.duration; //必须写,不然获取不到。。。
      setTimeout(() => {
        console.log(myAudio.duration, 'myAudio.duration');
        // debugger
        this.setData({
          myAudioDuration: this.format(myAudio.duration),
          myAudioCurrent: this.format(myAudio.currentTime)
@@ -570,7 +572,6 @@
    });
  },
  adsfhaewlf() {
    myAudio.pause();
    this.setData({
      isplay: false
@@ -615,7 +616,7 @@
    }
  },
  // 左右切换
  changeItem(item) {
    console.log(item);
@@ -652,6 +653,7 @@
    }
    setTimeout(() => {
      console.log(this.data.speed, 'this.data.speed');
      myAudio.startTime = this.data.myAudioDuration  //开始时间  
      myAudio.playbackRate = this.data.speed; //  播放速率
    }, 200);
@@ -673,29 +675,46 @@
    this.setData({
      showDropdown: !this.data.showDropdown
    });
  },
  smallSpeed() {
    this.setData({
      speed: 0.5,
      showDropdown: !this.data.showDropdown
    })
    setTimeout(() => {
      myAudio.startTime = this.data.myAudioDuration  //开始时间
      myAudio.playbackRate = this.data.speed; //  播放速率
    }, 200);
  },
  centreSpeed() {
    this.setData({
      speed: 1.5,
      showDropdown: !this.data.showDropdown
    })
    setTimeout(() => {
      myAudio.startTime = this.data.myAudioDuration  //开始时间
      myAudio.playbackRate = this.data.speed; //  播放速率
    }, 200);
  },
  bigSpeed() {
    this.setData({
      speed: 2,
      showDropdown: !this.data.showDropdown
    })
    setTimeout(() => {
      myAudio.startTime = this.data.myAudioDuration  //开始时间
      myAudio.playbackRate = this.data.speed; //  播放速率
    }, 200);
  },
  smallSpeeDmultiple() {
    this.setData({
      speed: 1,
      showDropdown: !this.data.showDropdown
    })
    setTimeout(() => {
      myAudio.startTime = this.data.myAudioDuration  //开始时间
      myAudio.playbackRate = this.data.speed; //  播放速率
    }, 200);
  }
})