|
|
|
@ -768,6 +768,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async previousPage() { |
|
|
|
// 如果正在加载音频,禁止翻页 |
|
|
|
if (this.isAudioLoading) { |
|
|
|
@ -787,27 +788,27 @@ export default { |
|
|
|
// 清空当前音频状态 |
|
|
|
this.resetAudioState(); |
|
|
|
} |
|
|
|
}, |
|
|
|
async nextPage() { |
|
|
|
// 如果正在加载音频,禁止翻页 |
|
|
|
if (this.isAudioLoading) { |
|
|
|
return; |
|
|
|
} |
|
|
|
}, |
|
|
|
async nextPage() { |
|
|
|
// 如果正在加载音频,禁止翻页 |
|
|
|
if (this.isAudioLoading) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.currentPage < this.bookPages.length) { |
|
|
|
// 停止当前音频播放 |
|
|
|
this.pauseAudio(); |
|
|
|
|
|
|
|
if (this.currentPage < this.bookPages.length) { |
|
|
|
// 停止当前音频播放 |
|
|
|
this.pauseAudio(); |
|
|
|
|
|
|
|
this.currentPage++; |
|
|
|
// 获取对应页面的数据(如果还没有获取过) |
|
|
|
if (this.courseIdList[this.currentPage - 1] && this.bookPages[this.currentPage - 1].length === 0) { |
|
|
|
await this.getBookPages(this.courseIdList[this.currentPage - 1]); |
|
|
|
} |
|
|
|
|
|
|
|
// 清空当前音频状态 |
|
|
|
this.resetAudioState(); |
|
|
|
this.currentPage++; |
|
|
|
// 获取对应页面的数据(如果还没有获取过) |
|
|
|
if (this.courseIdList[this.currentPage - 1] && this.bookPages[this.currentPage - 1].length === 0) { |
|
|
|
await this.getBookPages(this.courseIdList[this.currentPage - 1]); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 清空当前音频状态 |
|
|
|
this.resetAudioState(); |
|
|
|
} |
|
|
|
}, |
|
|
|
formatTime(seconds) { |
|
|
|
const mins = Math.floor(seconds / 60); |
|
|
|
const secs = Math.floor(seconds % 60); |
|
|
|
@ -816,7 +817,7 @@ export default { |
|
|
|
toggleSound() { |
|
|
|
console.log('音色切换') |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/subPages/home/music' |
|
|
|
url: '/subPages/home/music?voiceId=' + this.voiceId |
|
|
|
}) |
|
|
|
}, |
|
|
|
unlockBook() { |
|
|
|
@ -931,9 +932,9 @@ export default { |
|
|
|
}, |
|
|
|
async onLoad(args) { |
|
|
|
uni.$on('selectVoice', (voiceId) => { |
|
|
|
console.log('收到音色选择:', voiceId); |
|
|
|
// console.log('收到音色选择:', voiceId); |
|
|
|
|
|
|
|
this.selectedVoiceId = voiceId |
|
|
|
this.voiceId = voiceId |
|
|
|
}) |
|
|
|
this.courseId = args.courseId |
|
|
|
// 重置音频状态 |
|
|
|
|