diff --git a/src/components/auth/LoginModal.vue b/src/components/auth/LoginModal.vue index 728e043..a920ab1 100644 --- a/src/components/auth/LoginModal.vue +++ b/src/components/auth/LoginModal.vue @@ -38,7 +38,7 @@ @@ -48,6 +48,7 @@ export default { diff --git a/src/components/auth/RegisterModal.vue b/src/components/auth/RegisterModal.vue index 2d49995..2d16be0 100644 --- a/src/components/auth/RegisterModal.vue +++ b/src/components/auth/RegisterModal.vue @@ -46,7 +46,7 @@ @@ -56,6 +56,7 @@ export default { diff --git a/src/components/course/DPlayerVideo.vue b/src/components/course/DPlayerVideo.vue index 6e91918..f832b37 100644 --- a/src/components/course/DPlayerVideo.vue +++ b/src/components/course/DPlayerVideo.vue @@ -88,18 +88,51 @@ const loadDPlayer = (): Promise => { return } - // 加载 CSS - const cssLink = document.createElement('link') - cssLink.rel = 'stylesheet' - cssLink.href = 'https://cdn.jsdelivr.net/npm/dplayer@1.27.1/dist/DPlayer.min.css' - document.head.appendChild(cssLink) + // 尝试多个CDN源 + const cdnSources = [ + { + css: 'https://unpkg.com/dplayer@1.27.1/dist/DPlayer.min.css', + js: 'https://unpkg.com/dplayer@1.27.1/dist/DPlayer.min.js' + }, + { + css: 'https://cdn.bootcdn.net/ajax/libs/dplayer/1.27.1/DPlayer.min.css', + js: 'https://cdn.bootcdn.net/ajax/libs/dplayer/1.27.1/DPlayer.min.js' + }, + { + css: 'https://cdn.jsdelivr.net/npm/dplayer@1.27.1/dist/DPlayer.min.css', + js: 'https://cdn.jsdelivr.net/npm/dplayer@1.27.1/dist/DPlayer.min.js' + } + ] - // 加载 JS - const script = document.createElement('script') - script.src = 'https://cdn.jsdelivr.net/npm/dplayer@1.27.1/dist/DPlayer.min.js' - script.onload = () => resolve() - script.onerror = () => reject(new Error('Failed to load DPlayer')) - document.head.appendChild(script) + let currentIndex = 0 + + const tryLoadFromCDN = () => { + if (currentIndex >= cdnSources.length) { + reject(new Error('All CDN sources failed to load DPlayer')) + return + } + + const source = cdnSources[currentIndex] + + // 加载 CSS + const cssLink = document.createElement('link') + cssLink.rel = 'stylesheet' + cssLink.href = source.css + document.head.appendChild(cssLink) + + // 加载 JS + const script = document.createElement('script') + script.src = source.js + script.onload = () => resolve() + script.onerror = () => { + console.warn(`Failed to load DPlayer from ${source.js}, trying next CDN...`) + currentIndex++ + tryLoadFromCDN() + } + document.head.appendChild(script) + } + + tryLoadFromCDN() }) } @@ -278,12 +311,13 @@ onUnmounted(() => { position: relative; width: 100%; height: 578px; - background: #000; + background: transparent; } .dplayer-wrapper { width: 100%; height: 100%; + background: transparent; } .video-placeholder { @@ -298,7 +332,7 @@ onUnmounted(() => { background-size: cover; background-position: center; background-repeat: no-repeat; - background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + background: transparent; color: white; cursor: pointer; } @@ -310,8 +344,9 @@ onUnmounted(() => { left: 0; right: 0; bottom: 0; - background: rgba(0, 0, 0, 0.4); + background: rgba(0, 0, 0, 0.3); z-index: 1; + border-radius: 12px; } .placeholder-content { diff --git a/src/router/index.ts b/src/router/index.ts index df2ac2e..4d14738 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -196,6 +196,14 @@ const routes: RouteRecordRaw[] = [ }, // 首页与课程 + { + path: '/service-agreement', + name: 'ServiceAgreement', + component: () => import('@/views/ServiceAgreement.vue'), + meta: { + title: '服务协议与隐私政策' + } + }, { path: '/', name: 'Home', diff --git a/src/views/Faculty.vue b/src/views/Faculty.vue index e8453cd..c230257 100644 --- a/src/views/Faculty.vue +++ b/src/views/Faculty.vue @@ -38,13 +38,15 @@
-
+
-
+

课程介绍:

主讲课程为《Python语言程序设计》、《动画原理与实现》、《虚拟现实技术与应用》等。

@@ -135,6 +137,16 @@ const toggleCourseInfo = (teacherId: number) => { } } +// 鼠标悬停显示课程信息 +const showCourseInfo = (teacherId: number) => { + expandedTeacherId.value = teacherId +} + +// 鼠标离开隐藏课程信息 +const hideCourseInfo = (teacherId: number) => { + expandedTeacherId.value = null +} + // 筛选标签数据 const filterTabs = ref([ { id: 'all', name: '全部' }, @@ -586,11 +598,13 @@ height: 37px; /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); */ z-index: 10; transform: translateY(100%); - transition: transform 0.3s ease-out; + opacity: 0; + transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); } .course-info-box.active { transform: translateY(0); + opacity: 1; } .course-info-content { @@ -627,10 +641,7 @@ height: 37px; box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.1); } */ -.faculty-card:hover .course-info-box, -.course-info-box:hover { - transform: translateY(0); -} +/* 移除冲突的hover样式,改用JavaScript控制 */ /* 箭头按钮旋转动画 */ /* .card-arrow { diff --git a/src/views/Home.vue b/src/views/Home.vue index 2411ddd..ba62d23 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -6,7 +6,7 @@

中小学教师人工智能素养提升在线学习平台

为教师量身定制,帮助教师快速掌握AI技术、教学应用与伦理规范,赋能智慧课堂

- +
@@ -540,6 +540,11 @@ const courseStore = useCourseStore() const userStore = useUserStore() const { loginModalVisible, registerModalVisible, handleAuthSuccess } = useAuth() +// 跳转到课程页面 +const goToCoursesPage = () => { + router.push('/courses') +} + // 跳转到课程详情页面 const goToCourseDetail = async (courseId: string) => { try { diff --git a/src/views/ServiceAgreement.vue b/src/views/ServiceAgreement.vue new file mode 100644 index 0000000..309632b --- /dev/null +++ b/src/views/ServiceAgreement.vue @@ -0,0 +1,185 @@ + + + + +