Commit 8ce8cbc9 authored by 罗超's avatar 罗超

1

parent e77dc044
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
setup(props, context) { setup(props, context) {
let s = getCurrentInstance(); let s = getCurrentInstance();
let { refs } = getCurrentInstance(); let { refs } = getCurrentInstance();
console.log(163, s.$refs);
let data = reactive({ let data = reactive({
autoplay: false, autoplay: false,
sortIndex: props.sort + 1, //大题序号 sortIndex: props.sort + 1, //大题序号
...@@ -227,8 +227,6 @@ export default { ...@@ -227,8 +227,6 @@ export default {
console.log("停了"); console.log("停了");
data.isPlay = true; data.isPlay = true;
} }
// console.log(189, innerAudioContext.duration);
innerAudioContext.onError((res) => { innerAudioContext.onError((res) => {
console.log(res.errMsg); console.log(res.errMsg);
console.log(res.errCode); console.log(res.errCode);
...@@ -261,7 +259,15 @@ export default { ...@@ -261,7 +259,15 @@ export default {
}, },
onchange(e) { onchange(e) {
innerAudioContext.stop(); innerAudioContext.stop();
innerAudioContext.onCanplay(() => {
// 必须。可以当做是初始化时长
innerAudioContext.duration;
// 必须。不然也获取不到时长
setTimeout(() => {
data.audioTime = 999; data.audioTime = 999;
}, 100);
});
data.isPlay = true; data.isPlay = true;
console.log(369, data.audioTime); console.log(369, data.audioTime);
data.ExamIndex = e.detail.current; data.ExamIndex = e.detail.current;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment