|
|
@@ -79,6 +79,7 @@
|
|
|
},
|
|
|
dialog(showDilog) {
|
|
|
if (!showDilog) {
|
|
|
+ this.tick(true)
|
|
|
this.doPause()
|
|
|
this.isReady = false
|
|
|
}
|
|
|
@@ -347,8 +348,7 @@
|
|
|
console.log("curTimes")
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- let isFinish = force ? 1 : 0
|
|
|
+ let isFinish = media.isFinish||0;
|
|
|
if (curTimes >= media.duration-15) isFinish = 1;
|
|
|
// 拉到后面
|
|
|
if (!isFinish) {
|
|
|
@@ -364,35 +364,36 @@
|
|
|
let param = {
|
|
|
id: media.id,
|
|
|
position: curTimes,
|
|
|
- isFinish
|
|
|
+ isFinish,
|
|
|
+ force
|
|
|
};
|
|
|
httpServer("course.tick", param, true).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- let {
|
|
|
- skip,
|
|
|
- position,
|
|
|
- pause,
|
|
|
- closed
|
|
|
- } = res.data
|
|
|
- if (pause || closed) {
|
|
|
- this.doPause();
|
|
|
- this.$emit("close")
|
|
|
- if (closed) {
|
|
|
- this.$message.errorMsg("禁止多处同时学习", 5);
|
|
|
- } else if (pause) {
|
|
|
- this.$message.errorMsg("禁止多处同时学习", 5);
|
|
|
- }
|
|
|
- return
|
|
|
+ if (res.code != 200) return;
|
|
|
+ let {
|
|
|
+ skip,
|
|
|
+ position,
|
|
|
+ pause,
|
|
|
+ closed
|
|
|
+ } = res.data
|
|
|
+ if (pause || closed) {
|
|
|
+ this.doPause();
|
|
|
+ this.$emit("close")
|
|
|
+ if (closed) {
|
|
|
+ this.$message.errorMsg("禁止多处同时学习", 5);
|
|
|
+ } else if (pause) {
|
|
|
+ this.$message.errorMsg("禁止多处同时学习", 5);
|
|
|
}
|
|
|
- if (!skip) {
|
|
|
- let diff = Math.abs(position - curTimes);
|
|
|
- if (diff > 3) {
|
|
|
- this.setposition(position);
|
|
|
- }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!skip) {
|
|
|
+ let diff = Math.abs(position - curTimes);
|
|
|
+ if (diff > 5) {
|
|
|
+ this.setposition(position);
|
|
|
}
|
|
|
- Object.assign(param, res.data)
|
|
|
- this.$emit("update", param)
|
|
|
}
|
|
|
+ Object.assign(param, res.data)
|
|
|
+ this.$emit("update", param)
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
}
|