From db7fdd2cd77a20876d534ae020477b39b5f74faa Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期三, 17 四月 2024 18:33:28 +0800 Subject: [PATCH] 字 --- packageBookService/pages/bookServices/examination/questionList/index.js | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packageBookService/pages/bookServices/examination/questionList/index.js b/packageBookService/pages/bookServices/examination/questionList/index.js index 2b484c8..c881818 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.js +++ b/packageBookService/pages/bookServices/examination/questionList/index.js @@ -1,4 +1,7 @@ // pages/bookServices/examination/questionList/index.js +const innerAudioContext = wx.createInnerAudioContext({ + useWebAudioImplement: false +}) Component({ /** * 缁勪欢鐨勫睘鎬у垪琛� @@ -26,15 +29,15 @@ }, sliderValue: { type: Number, + }, + noData: { + type: Boolean, } }, - observers: { - 'questionList': function (newValue) { - console.log(newValue); - } - }, - created() { - // console.log('缁勪欢浼犲弬', this.properties); + observers: {}, + detached() { + innerAudioContext.stop(); + innerAudioContext.destroy(); }, /** * 缁勪欢鐨勫垵濮嬫暟鎹� @@ -52,12 +55,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({ -- Gitblit v1.9.1