fix(courseDetail): 修复视频播放逻辑和调整代码格式
调整视频播放逻辑,将事件监听移除和播放位置设置移到setTimeout外部 统一缩进格式,修复模板中的多余空格
This commit is contained in:
parent
608bcd0753
commit
bd6ee74eaa
@ -80,7 +80,7 @@
|
|||||||
<div class="lianxiTiMu" v-for="(item, index) in current_question_data.content" :key="index"
|
<div class="lianxiTiMu" v-for="(item, index) in current_question_data.content" :key="index"
|
||||||
@click="responseQ(item)">
|
@click="responseQ(item)">
|
||||||
<span class="lianxiXueZe" v-bind:class="{ active: current_question_data.response == item }">{{ xuhao[index]
|
<span class="lianxiXueZe" v-bind:class="{ active: current_question_data.response == item }">{{ xuhao[index]
|
||||||
}}</span>
|
}}</span>
|
||||||
<span class="lianxiXueZe1">{{ item }}</span>
|
<span class="lianxiXueZe1">{{ item }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="lianxiTiMu cuoti" v-if="current_question_data.is_wrong == 1">
|
<div class="lianxiTiMu cuoti" v-if="current_question_data.is_wrong == 1">
|
||||||
@ -97,7 +97,7 @@
|
|||||||
<div class="lianxiTiMu" v-for="(item, index) in current_question_data.content" :key="index"
|
<div class="lianxiTiMu" v-for="(item, index) in current_question_data.content" :key="index"
|
||||||
@click="responseQ(item)">
|
@click="responseQ(item)">
|
||||||
<span class="lianxiXueZe" v-bind:class="{ active: current_question_data.response == item }">{{ xuhao[index]
|
<span class="lianxiXueZe" v-bind:class="{ active: current_question_data.response == item }">{{ xuhao[index]
|
||||||
}}</span>
|
}}</span>
|
||||||
<span class="lianxiXueZe1">{{ item }}</span>
|
<span class="lianxiXueZe1">{{ item }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="lianxiTiMu cuoti" v-if="current_question_data.is_wrong == 1">
|
<div class="lianxiTiMu cuoti" v-if="current_question_data.is_wrong == 1">
|
||||||
@ -151,7 +151,7 @@
|
|||||||
<div class="lianxiBottomR" @click="popupVisible = true">
|
<div class="lianxiBottomR" @click="popupVisible = true">
|
||||||
<img src="../../../static/img/gengduo.png" alt="" /><span>{{
|
<img src="../../../static/img/gengduo.png" alt="" /><span>{{
|
||||||
current_question + 1
|
current_question + 1
|
||||||
}}</span>/{{ questions.length }}
|
}}</span>/{{ questions.length }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -426,11 +426,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function plays() {
|
function plays() {
|
||||||
|
document.getElementById("video").removeEventListener("play", plays, false);
|
||||||
|
document.getElementById("video").currentTime = _this.record;
|
||||||
|
_this.current_sign = _this.record;
|
||||||
|
Toast("从上次记录的地方开始播放");
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
document.getElementById("video").removeEventListener("play", plays, false);
|
|
||||||
document.getElementById("video").currentTime = _this.record;
|
|
||||||
_this.current_sign = _this.record;
|
|
||||||
Toast("从上次记录的地方开始播放");
|
|
||||||
_this.video_timer = setInterval(timer, 100);
|
_this.video_timer = setInterval(timer, 100);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user