From cb6bb8bda31df75afe5a5bd50fe8e3ff6a3d34e2 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 15 四月 2024 09:31:39 +0800 Subject: [PATCH] 详情页bug修改,资源购买页添加骨架屏 --- packageBookService/pages/bookServices/examination/questionList/index.js | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packageBookService/pages/bookServices/examination/questionList/index.js b/packageBookService/pages/bookServices/examination/questionList/index.js index 1513d20..0a00adc 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({ /** * 缁勪欢鐨勫睘鎬у垪琛� @@ -27,8 +30,8 @@ sliderValue: { type: Number, }, - noData:{ - type:Boolean, + noData: { + type: Boolean, } }, observers: { @@ -38,6 +41,10 @@ }, created() { // console.log('缁勪欢浼犲弬', this.properties); + }, + ready() { + innerAudioContext.stop(); + innerAudioContext.destroy(); }, /** * 缁勪欢鐨勫垵濮嬫暟鎹� @@ -55,12 +62,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