标签提示

This commit is contained in:
670788339
2025-11-12 09:54:50 +08:00
parent 22a21313b5
commit bec3e13154

View File

@@ -1014,35 +1014,35 @@ export default {
// 滚动到可见区域 // 滚动到可见区域
currentElement.scrollIntoView({ behavior: 'smooth', block: 'center' }); currentElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
// 特殊处理录播课标签位置,避免被遮挡 // // 特殊处理录播课标签位置,避免被遮挡
if (this.courseInfo.type === 20 && this.currentStep === 1) { // if (this.courseInfo.type === 20 && this.currentStep === 1) {
this.$nextTick(() => { // this.$nextTick(() => {
const guidanceContent = document.querySelector('.guidance-content'); // const guidanceContent = document.querySelector('.guidance-content');
if (guidanceContent) { // if (guidanceContent) {
// 调整引导框位置,显示在元素上方或旁边 // // 调整引导框位置,显示在元素上方或旁边
const elementTop = rect.top; // const elementTop = rect.top;
const elementHeight = rect.height; // const elementHeight = rect.height;
const guidanceHeight = guidanceContent.offsetHeight || 300; // const guidanceHeight = guidanceContent.offsetHeight || 300;
//
// 如果元素在页面上半部分,引导框显示在下方 // // 如果元素在页面上半部分,引导框显示在下方
if (elementTop < window.innerHeight / 2) { // if (elementTop < window.innerHeight / 2) {
guidanceContent.style.top = `${elementTop + elementHeight + 10}px`; // guidanceContent.style.top = `${elementTop + elementHeight + 10}px`;
} else { // } else {
// 如果元素在页面下半部分,引导框显示在上方 // // 如果元素在页面下半部分,引导框显示在上方
guidanceContent.style.top = `${elementTop - guidanceHeight - 10}px`; // guidanceContent.style.top = `${elementTop - guidanceHeight - 10}px`;
} // }
//
// 确保引导框在视窗内 // // 确保引导框在视窗内
const contentRect = guidanceContent.getBoundingClientRect(); // const contentRect = guidanceContent.getBoundingClientRect();
if (contentRect.bottom > window.innerHeight) { // if (contentRect.bottom > window.innerHeight) {
guidanceContent.style.top = `${window.innerHeight - contentRect.height - 20}px`; // guidanceContent.style.top = `${window.innerHeight - contentRect.height - 20}px`;
} // }
if (contentRect.top < 0) { // if (contentRect.top < 0) {
guidanceContent.style.top = '20px'; // guidanceContent.style.top = '20px';
} // }
} // }
}); // });
} // }
} }
}, },
@@ -1074,9 +1074,9 @@ export default {
onContentTypeFocus() { onContentTypeFocus() {
if (this.showGuidance && this.currentStep === 1) { if (this.showGuidance && this.currentStep === 1) {
this.currentStep = 2; this.currentStep = 2;
this.$nextTick(() => { // this.$nextTick(() => {
this.highlightCurrentStep(); this.highlightCurrentStep();
}); // });
} }
}, },
@@ -1084,9 +1084,9 @@ export default {
onContentTypeChange() { onContentTypeChange() {
if (this.showGuidance && this.currentStep === 1) { if (this.showGuidance && this.currentStep === 1) {
this.currentStep = 2; this.currentStep = 2;
this.$nextTick(() => { // this.$nextTick(() => {
this.highlightCurrentStep(); this.highlightCurrentStep();
}); // });
} }
}, },
@@ -2019,16 +2019,16 @@ export default {
} }
.guidance-content { .guidance-content {
position: fixed; //position: fixed;
background: white; background: white;
border-radius: 8px; border-radius: 8px;
padding: 24px; padding: 24px;
max-width: 500px; max-width: 500px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
z-index: 10000; z-index: 10000;
left: 50%; //left: 50%;
transform: translateX(-50%); //transform: translateX(-50%);
top: 20%; //top: 20%;
} }
.guidance-title { .guidance-title {