bug
闫增涛
2024-09-07 c6c73b7d709322052b9cd6777b3d6657e0d43d30
packageBookService/pages/bookServices/examination/questionList/index.js
@@ -1,4 +1,7 @@
// pages/bookServices/examination/questionList/index.js
const innerAudioContext = wx.createInnerAudioContext({
  useWebAudioImplement: false
})
Component({
  /**
   * 组件的属性列表
@@ -31,13 +34,13 @@
      type: Boolean,
    }
  },
  observers: {
    'questionList': function (newValue) {
      console.log(newValue);
  observers: {},
  detached() {
    if (innerAudioContext) {
      innerAudioContext.stop();
      innerAudioContext.destroy();
    }
  },
  created() {
    // console.log('组件传参', this.properties);
  },
  /**
   * 组件的初始数据
@@ -55,12 +58,25 @@
      type: 'fraction'
    },
    showIndex: 0,
    isPlay: false
  },
  /**
   * 组件的方法列表
   */
  methods: {
    audioPlay(e) {
      const src = e.currentTarget.dataset.src
      innerAudioContext.src = src
      if (!this.data.isPlay) {
        innerAudioContext.play()
      } else {
        innerAudioContext.pause()
      }
      this.setData({
        isPlay: !this.data.isPlay
      })
    },
    // 切换题目
    changeSwiper(e) {
      this.setData({