Merge remote-tracking branch 'yx/master-0720-lyc' into master-0720-lyc

# Conflicts:
#	src/components/VideoPlayer/progress-bar.vue
#	src/views/study/coursenew.vue
This commit is contained in:
joshen
2025-07-23 11:18:46 +08:00

View File

@@ -73,7 +73,7 @@ export default {
}, },
methods: { methods: {
down(e) { down(e) {
if (!this.isDrag) return; // if(this.isDrag) {
this.$emit("getMouseDownStatus", true); this.$emit("getMouseDownStatus", true);
this.is_mousedown_progress = true; this.is_mousedown_progress = true;
// 获取完整进度条的clientXdom左上角 // 获取完整进度条的clientXdom左上角
@@ -86,13 +86,15 @@ export default {
if(current<0) current = 0; if(current<0) current = 0;
var time = localStorage.getItem('videoProgressData'); var time = localStorage.getItem('videoProgressData');
var arr = time&&JSON.parse(time) || {} var arr = time&&JSON.parse(time) || {}
// 禁止拖动 console.log('down arr:',this.isDrag,this.blobId,arr,arr[this.blobId],current)
if(time && arr[this.blobId] < current) return; // 禁止拖动 true:禁止拖动false:允许拖动
if(!this.isDrag && time && arr[this.blobId] < current) return;
this.$emit("updateProgress", current); this.$emit("updateProgress", current);
// }
}, },
move(e) { move(e) {
if (!this.isDrag || !this.is_mousedown_progress) return; if (this.is_mousedown_progress) {
let init_clientX = this.dom_full.getBoundingClientRect().left; let init_clientX = this.dom_full.getBoundingClientRect().left;
this.current_width_px = e.clientX - init_clientX; this.current_width_px = e.clientX - init_clientX;
let current = (e.clientX - init_clientX) / this.dom_full.clientWidth; let current = (e.clientX - init_clientX) / this.dom_full.clientWidth;
@@ -100,12 +102,14 @@ export default {
if(current<0) current = 0; if(current<0) current = 0;
var time = localStorage.getItem('videoProgressData'); var time = localStorage.getItem('videoProgressData');
var arr = time&&JSON.parse(time) || {} var arr = time&&JSON.parse(time) || {}
console.log('move arr:',this.isDrag,this.blobId,arr,arr[this.blobId],current)
// 禁止拖动 // 禁止拖动
if(time && arr[this.blobId] < current) return; if(!this.isDrag && time && arr[this.blobId] < current) return;
this.$emit("updateProgress", current); this.$emit("updateProgress", current);
}
}, },
up() { up() {
if (!this.isDrag || !this.is_mousedown_progress) return; if (this.is_mousedown_progress) {
// 标记鼠标不处于按下的状态了 // 标记鼠标不处于按下的状态了
this.is_mousedown_progress = false; this.is_mousedown_progress = false;
// 松开鼠标后即调整进度条后此时的进度0-1 // 松开鼠标后即调整进度条后此时的进度0-1
@@ -114,10 +118,13 @@ export default {
if(current<0) current = 0; if(current<0) current = 0;
var time = localStorage.getItem('videoProgressData'); var time = localStorage.getItem('videoProgressData');
var arr = time&&JSON.parse(time) || {} var arr = time&&JSON.parse(time) || {}
console.log('up arr:',this.isDrag,this.blobId,arr,arr[this.blobId],current)
this.$emit("getMouseDownStatus", false); this.$emit("getMouseDownStatus", false);
// 禁止拖动 // 禁止拖动
if(time && arr[this.blobId] < current) return; if(!this.isDrag && time && arr[this.blobId] < current) return;
this.$emit("updateProgress", current); this.$emit("updateProgress", current);
this.$emit("getMouseDownStatus", false);
}
}, },
}, },
}; };