丸子 9 months ago
parent
commit
f992df9bec

+ 17 - 8
package-lock.json

@@ -10,10 +10,11 @@
       "dependencies": {
       "dependencies": {
         "@element-plus/icons-vue": "^2.3.1",
         "@element-plus/icons-vue": "^2.3.1",
         "@microsoft/fetch-event-source": "^2.0.1",
         "@microsoft/fetch-event-source": "^2.0.1",
-        "@vitejs/plugin-legacy": "^7.0.0",
+        "@vitejs/plugin-legacy": "^7.0.1",
         "axios": "^1.10.0",
         "axios": "^1.10.0",
         "element-plus": "^2.10.2",
         "element-plus": "^2.10.2",
         "highlight.js": "^11.11.1",
         "highlight.js": "^11.11.1",
+        "hls.js": "^1.6.7",
         "jsencrypt": "^3.3.2",
         "jsencrypt": "^3.3.2",
         "markdown-it": "^14.1.0",
         "markdown-it": "^14.1.0",
         "router": "^2.2.0",
         "router": "^2.2.0",
@@ -2601,16 +2602,18 @@
       "license": "MIT"
       "license": "MIT"
     },
     },
     "node_modules/@vitejs/plugin-legacy": {
     "node_modules/@vitejs/plugin-legacy": {
-      "version": "7.0.0",
-      "resolved": "https://registry.npmmirror.com/@vitejs/plugin-legacy/-/plugin-legacy-7.0.0.tgz",
-      "integrity": "sha512-qevhyYFUeZXBd/bAZGwpBgyn4GGAYije9YPV8Jg07newPCZtFEIlFlzsQowPbm87iKekOIL/90wKn+hvGkjzkg==",
+      "version": "7.0.1",
+      "resolved": "https://registry.npmmirror.com/@vitejs/plugin-legacy/-/plugin-legacy-7.0.1.tgz",
+      "integrity": "sha512-ZpT0cKlFzNPU/kjdKzuI+2aDr2MYs7MxndmV7ekAMO2TD6YdU6GJKtc+/K7gaiJwEyaAZhDsxmBSi7SqM6MBxQ==",
       "license": "MIT",
       "license": "MIT",
       "dependencies": {
       "dependencies": {
-        "@babel/core": "^7.27.4",
-        "@babel/preset-env": "^7.27.2",
-        "browserslist": "^4.25.0",
+        "@babel/core": "^7.28.0",
+        "@babel/preset-env": "^7.28.0",
+        "babel-plugin-polyfill-corejs3": "^0.13.0",
+        "babel-plugin-polyfill-regenerator": "^0.6.5",
+        "browserslist": "^4.25.1",
         "browserslist-to-esbuild": "^2.1.1",
         "browserslist-to-esbuild": "^2.1.1",
-        "core-js": "^3.43.0",
+        "core-js": "^3.44.0",
         "magic-string": "^0.30.17",
         "magic-string": "^0.30.17",
         "regenerator-runtime": "^0.14.1",
         "regenerator-runtime": "^0.14.1",
         "systemjs": "^6.15.1"
         "systemjs": "^6.15.1"
@@ -3511,6 +3514,12 @@
         "node": ">=12.0.0"
         "node": ">=12.0.0"
       }
       }
     },
     },
+    "node_modules/hls.js": {
+      "version": "1.6.7",
+      "resolved": "https://registry.npmmirror.com/hls.js/-/hls.js-1.6.7.tgz",
+      "integrity": "sha512-QW2fnwDGKGc9DwQUGLbmMOz8G48UZK7PVNJPcOUql1b8jubKx4/eMHNP5mGqr6tYlJNDG1g10Lx2U/qPzL6zwQ==",
+      "license": "Apache-2.0"
+    },
     "node_modules/immutable": {
     "node_modules/immutable": {
       "version": "5.1.3",
       "version": "5.1.3",
       "resolved": "https://registry.npmmirror.com/immutable/-/immutable-5.1.3.tgz",
       "resolved": "https://registry.npmmirror.com/immutable/-/immutable-5.1.3.tgz",

+ 2 - 1
package.json

@@ -11,10 +11,11 @@
   "dependencies": {
   "dependencies": {
     "@element-plus/icons-vue": "^2.3.1",
     "@element-plus/icons-vue": "^2.3.1",
     "@microsoft/fetch-event-source": "^2.0.1",
     "@microsoft/fetch-event-source": "^2.0.1",
-    "@vitejs/plugin-legacy": "^7.0.0",
+    "@vitejs/plugin-legacy": "^7.0.1",
     "axios": "^1.10.0",
     "axios": "^1.10.0",
     "element-plus": "^2.10.2",
     "element-plus": "^2.10.2",
     "highlight.js": "^11.11.1",
     "highlight.js": "^11.11.1",
+    "hls.js": "^1.6.7",
     "jsencrypt": "^3.3.2",
     "jsencrypt": "^3.3.2",
     "markdown-it": "^14.1.0",
     "markdown-it": "^14.1.0",
     "router": "^2.2.0",
     "router": "^2.2.0",

+ 23 - 3
src/components/HomePage.vue

@@ -5,7 +5,7 @@
         <span>京华实验学校</span>
         <span>京华实验学校</span>
         <div class="dropdown-box">
         <div class="dropdown-box">
           <!-- 下拉菜单 -->
           <!-- 下拉菜单 -->
-          <el-dropdown v-model="selectedGrade" @command="handleGradeSelect">
+          <el-dropdown v-model="selectedGrade" @command="handleGradeSelect" popper-class="no-arrow-dropdown">
             <el-button type="primary">
             <el-button type="primary">
               {{ selectedGrade }}
               {{ selectedGrade }}
               <el-icon class="el-icon--right"><ArrowDown /></el-icon>
               <el-icon class="el-icon--right"><ArrowDown /></el-icon>
@@ -361,12 +361,13 @@ onMounted(() => {
 .dropdown-box {
 .dropdown-box {
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
-  // display: flex; // 添加 flex 布局;
   margin-left: rpx(-80);
   margin-left: rpx(-80);
   flex: 1;
   flex: 1;
   align-items: center; // 垂直居中;
   align-items: center; // 垂直居中;
   margin-top: rpx(22);
   margin-top: rpx(22);
 }
 }
+
+
 .dropdown-box .el-button {
 .dropdown-box .el-button {
   width: rpx(55); // 设置按钮宽度;
   width: rpx(55); // 设置按钮宽度;
   height: rpx(15); // 设置按钮高度;
   height: rpx(15); // 设置按钮高度;
@@ -391,7 +392,10 @@ onMounted(() => {
   background-color: rgba(161, 161, 161, 0.5);
   background-color: rgba(161, 161, 161, 0.5);
   box-shadow: 0 4px 8px rgba(202, 52, 52, 0.1);
   box-shadow: 0 4px 8px rgba(202, 52, 52, 0.1);
 }
 }
-// .el-dropdown__popper.el-popper
+
+.el-scrollbar__view .el-dropdown__list{
+  background-color: transparent;
+}
 
 
 .dropdown-menu ::v-deep(.el-dropdown-menu__item) {
 .dropdown-menu ::v-deep(.el-dropdown-menu__item) {
   font-size: rpx(8);
   font-size: rpx(8);
@@ -411,5 +415,21 @@ onMounted(() => {
     #fee78a,
     #fee78a,
     #ffce1b
     #ffce1b
   ); /* 设置悬停、聚焦、点击状态下的背景色 */
   ); /* 设置悬停、聚焦、点击状态下的背景色 */
+  color: black;
 }
 }
+
+
+.el-popper__arrow{
+  display: none;
+}
+.el-popper.is-light,
+.el-dropdown__popper.el-popper{
+  background: transparent !important;
+  border: none !important;
+  box-shadow: none !important;
+}
+.el-dropdown__popper{
+  --el-dropdown-menuItem-hover-color: none;
+}
+
 </style>
 </style>

+ 0 - 4
src/components/LeftPanel.vue

@@ -58,8 +58,6 @@ const groupList = ref([
   }
   }
 ])
 ])
 
 
-
-
 // 存储小智数据
 // 存储小智数据
 const personData = ref([])
 const personData = ref([])
 // 跳转智能问答
 // 跳转智能问答
@@ -67,10 +65,8 @@ const navigateToAI = async (group) => {
   if (group.title === '智能问答') {
   if (group.title === '智能问答') {
     try {
     try {
        const grade = route.query.grade || localStorage.getItem('selectedGrade')
        const grade = route.query.grade || localStorage.getItem('selectedGrade')
-       console.log(grade);
       // 获取小学低年级AI数据
       // 获取小学低年级AI数据
       const juniorAIRes = await teacherList({ category: grade + 'AI' })
       const juniorAIRes = await teacherList({ category: grade + 'AI' })
-      console.log(juniorAIRes);
       const aiPerson = juniorAIRes.data.list.find(person => person.name === '小智')
       const aiPerson = juniorAIRes.data.list.find(person => person.name === '小智')
       if (aiPerson) {
       if (aiPerson) {
         personData.value = {
         personData.value = {

+ 15 - 12
src/views/AIDevelop.vue

@@ -242,7 +242,7 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { ref, onMounted, onBeforeUnmount } from 'vue'
+import { ref, onMounted,onUnmounted, onBeforeUnmount } from 'vue'
 import { useRouter } from 'vue-router'
 import { useRouter } from 'vue-router'
 import {
 import {
   Expand,
   Expand,
@@ -266,6 +266,9 @@ import auto from '@/assets/icon/auto_awesome.png'
 import { ClassType } from '@/api/class.js'
 import { ClassType } from '@/api/class.js'
 import { Message } from '@/utils/message/Message.js'
 import { Message } from '@/utils/message/Message.js'
 
 
+// import Hls from 'hls.js'
+// let hls = null
+
 const router = useRouter() // 获取当前路由对象
 const router = useRouter() // 获取当前路由对象
 // 搜索框
 // 搜索框
 const SearchInput = ref('')
 const SearchInput = ref('')
@@ -317,7 +320,7 @@ onMounted(async () => {
       //课程数据
       //课程数据
       courseList.value.forEach((courseTemp,index) => {
       courseList.value.forEach((courseTemp,index) => {
         let menuIndex = courseTemp.courseLabel + '-' + (index+1);
         let menuIndex = courseTemp.courseLabel + '-' + (index+1);
-        //填充大纲小节
+        // 填充大纲小节
         let menu = menuItems.value.find(menu => courseTemp.courseLabel === menu.index);
         let menu = menuItems.value.find(menu => courseTemp.courseLabel === menu.index);
         if (menu){//小节
         if (menu){//小节
           menu.children = menu.children || [];
           menu.children = menu.children || [];
@@ -353,9 +356,9 @@ onMounted(async () => {
     boxIconTitle.value = String(title)
     boxIconTitle.value = String(title)
   }
   }
   // 在视频元素上添加时间更新事件监听
   // 在视频元素上添加时间更新事件监听
-  // if (videoRef.value) {
-  //   // videoRef.value.addEventListener('timeupdate', onTimeUpdate)
-  // }
+  if (videoRef.value) {
+    // videoRef.value.addEventListener('timeupdate', onTimeUpdate)
+  }
 })
 })
 
 
 // 菜单打开和关闭的处理函数
 // 菜单打开和关闭的处理函数
@@ -428,6 +431,7 @@ const playNextVideo = () => {
       })
       })
     }
     }
   }
   }
+
   // 重置
   // 重置
   pausedIndices = ref({time: [], newTime: []})
   pausedIndices = ref({time: [], newTime: []})
   userMessage = ref('')
   userMessage = ref('')
@@ -736,16 +740,16 @@ $text-color: #483d8b; // 文本颜色:靛蓝色
   background-color: transparent;
   background-color: transparent;
 }
 }
 .el-menu ::v-deep(.el-icon svg) {
 .el-menu ::v-deep(.el-icon svg) {
-  font-size: rpx(8);
+  font-size: rpx(9);
 }
 }
 
 
 .mb-2 {
 .mb-2 {
   color: white;
   color: white;
-  font-size: rpx(8);
+  font-size: rpx(9);
 }
 }
 .mb-2 img {
 .mb-2 img {
-  width: rpx(12);
-  height: rpx(12);
+  width: rpx(10);
+  height: rpx(10);
   vertical-align: middle;
   vertical-align: middle;
   margin-top: rpx(-2);
   margin-top: rpx(-2);
 }
 }
@@ -755,21 +759,20 @@ $text-color: #483d8b; // 文本颜色:靛蓝色
   margin-bottom: rpx(5);
   margin-bottom: rpx(5);
   border-radius: rpx(6);
   border-radius: rpx(6);
   color: white;
   color: white;
-  font-size: rpx(7);
+  font-size: rpx(8);
 }
 }
 .el-menu ::v-deep(.el-sub-menu__title) {
 .el-menu ::v-deep(.el-sub-menu__title) {
   color: white;
   color: white;
   width: rpx(100);
   width: rpx(100);
   height: rpx(20);
   height: rpx(20);
   margin-bottom: rpx(5);
   margin-bottom: rpx(5);
-  font-size: rpx(7);
+  font-size: rpx(8);
 }
 }
 .el-menu ::v-deep(.el-sub-menu__title:hover),
 .el-menu ::v-deep(.el-sub-menu__title:hover),
 .el-menu ::v-deep(.el-sub-menu__title:focus),
 .el-menu ::v-deep(.el-sub-menu__title:focus),
 .el-menu ::v-deep(.el-sub-menu__title:active) {
 .el-menu ::v-deep(.el-sub-menu__title:active) {
   background: linear-gradient(to bottom, #fee78a, #ffce1b);
   background: linear-gradient(to bottom, #fee78a, #ffce1b);
   color: black;
   color: black;
-  font-size: rpx(8);
 }
 }
 .el-menu ::v-deep(.el-menu-item:hover),
 .el-menu ::v-deep(.el-menu-item:hover),
 .el-menu ::v-deep(.el-menu-item:focus),
 .el-menu ::v-deep(.el-menu-item:focus),

+ 17 - 31
src/views/AIGeneralCourse.vue

@@ -70,7 +70,6 @@
                     :command="item.ctType"
                     :command="item.ctType"
                     >{{ item.ctType }}</el-dropdown-item
                     >{{ item.ctType }}</el-dropdown-item
                   >
                   >
-                  <!-- <el-dropdown-item>小学高年级</el-dropdown-item> -->
                 </el-dropdown-menu>
                 </el-dropdown-menu>
               </template>
               </template>
             </el-dropdown>
             </el-dropdown>
@@ -106,9 +105,8 @@
             }"
             }"
           ></div>
           ></div>
           <div class="additional-text">
           <div class="additional-text">
-            <!-- 0{{ index + 1 }} {{ getCourseTitle(index + 1) }}-->
-            ({{ outlineData.ctTypeSort }}) {{ outlineData.ctType }}
-          </div>
+            0{{ outlineData.ctTypeSort }} {{ outlineData.ctType }}
+          </div> 
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
@@ -145,8 +143,6 @@ const drawerVisible = ref(true)
 const handleGradeSelect = (command) => {
 const handleGradeSelect = (command) => {
   selectedGrade.value = command
   selectedGrade.value = command
 }
 }
-
-
 // 添加切换抽屉显示状态的函数
 // 添加切换抽屉显示状态的函数
 const toggleDrawer = () => {
 const toggleDrawer = () => {
   drawerVisible.value = !drawerVisible.value
   drawerVisible.value = !drawerVisible.value
@@ -159,12 +155,19 @@ const classOutlineData = ref([])
 const fetchCtTypes = async () => {
 const fetchCtTypes = async () => {
   try {
   try {
     const response = await ClassList() 
     const response = await ClassList() 
-
+    console.log(response);
     if (response.code === 0) {
     if (response.code === 0) {
       classData.value = response.data
       classData.value = response.data
       // 获取到数据,将第一个选项的值作为默认选中值
       // 获取到数据,将第一个选项的值作为默认选中值
       if (classData.value.length > 0) {
       if (classData.value.length > 0) {
         selectedGrade.value = classData.value[0].ctType
         selectedGrade.value = classData.value[0].ctType
+        // 初始化时获取课程大纲数据
+        const selectedItem = classData.value[0]
+        ClassOutline(selectedItem.id).then(res => {
+          if (res.code === 0) {
+            classOutlineData.value = res.data
+          }
+        })
       }
       }
     }
     }
   } catch (error) {
   } catch (error) {
@@ -172,25 +175,6 @@ const fetchCtTypes = async () => {
   }
   }
 }
 }
 
 
-// 添加 watch 监听 selectedGrade 的变化
-watch(selectedGrade, newValue => {
-  // 根据 id 切换高年级或低年级
-  const selectedItem = classData.value.find(item => item.ctType === newValue)
-  if (selectedItem) {
-    if (selectedItem.id === 1) {
-      selectedGrade.value = '小学低年级'
-    } else if (selectedItem.id === 3) {
-      selectedGrade.value = '小学高年级'
-    }
-    // 调用获取教学大纲函数并传入年级id
-    ClassOutline(selectedItem.id).then(res => {
-      if (res.code === 0) {
-        classOutlineData.value = res.data
-      }
-    })
-  }
-})
-
 // 添加获取课程标题
 // 添加获取课程标题
 const getCourseTitle = index => {
 const getCourseTitle = index => {
   if (
   if (
@@ -202,6 +186,7 @@ const getCourseTitle = index => {
   }
   }
   return ''
   return ''
 }
 }
+
 // 课程标题数组,依赖修改后的 getCourseTitle 函数 修改课程标题数组为 computed 属性
 // 课程标题数组,依赖修改后的 getCourseTitle 函数 修改课程标题数组为 computed 属性
 const courseTitles = computed(() => {
 const courseTitles = computed(() => {
   return Array.from({ length: 8 }, (_, i) => getCourseTitle(i + 1))
   return Array.from({ length: 8 }, (_, i) => getCourseTitle(i + 1))
@@ -264,6 +249,7 @@ const goToAIExperience = outlineData => {
 @function rpx($px) {
 @function rpx($px) {
   @return math.div($px, 750) * 100vw;
   @return math.div($px, 750) * 100vw;
 }
 }
+
 /* 添加过渡样式 */
 /* 添加过渡样式 */
 .drawer-slide-enter-active,
 .drawer-slide-enter-active,
 .drawer-slide-leave-active {
 .drawer-slide-leave-active {
@@ -340,14 +326,15 @@ const goToAIExperience = outlineData => {
 
 
 .mb-2 {
 .mb-2 {
   color: white;
   color: white;
-  font-size: rpx(8);
-  margin-left: rpx(13);
+  font-size: rpx(9);
+  margin-left: rpx(10);
 }
 }
 .mb-2 img {
 .mb-2 img {
   width: rpx(15);
   width: rpx(15);
   height: rpx(15);
   height: rpx(15);
   vertical-align: middle;
   vertical-align: middle;
   margin-top: rpx(-2);
   margin-top: rpx(-2);
+  margin-left: rpx(-5);
 }
 }
 .el-menu-item {
 .el-menu-item {
   width: rpx(115);
   width: rpx(115);
@@ -355,7 +342,7 @@ const goToAIExperience = outlineData => {
   margin-bottom: rpx(10);
   margin-bottom: rpx(10);
   border-radius: rpx(6);
   border-radius: rpx(6);
   color: white;
   color: white;
-  font-size: rpx(7);
+  font-size: rpx(8);
 }
 }
 
 
 .el-menu ::v-deep(.el-menu-item:hover),
 .el-menu ::v-deep(.el-menu-item:hover),
@@ -591,7 +578,6 @@ const goToAIExperience = outlineData => {
 .additional-text {
 .additional-text {
   margin-top: auto;
   margin-top: auto;
   margin-bottom: rpx(4);
   margin-bottom: rpx(4);
-  // margin-top: rpx(4);
-  font-size: rpx(7);
+  font-size: rpx(8);
 }
 }
 </style>
 </style>

+ 4 - 4
src/views/AILaboratory.vue

@@ -275,9 +275,9 @@ const groupList = ref([
 }
 }
 .small-box {
 .small-box {
   flex: 0 0 calc(30% - rpx(10)); // 每个小盒子占三分之一宽度,减去间距
   flex: 0 0 calc(30% - rpx(10)); // 每个小盒子占三分之一宽度,减去间距
-  width: rpx(180);
+  // width: rpx(180);
   height: rpx(110);
   height: rpx(110);
-  margin-top: rpx(10);
+  margin-top: rpx(20);
   margin-left: rpx(20);
   margin-left: rpx(20);
   border-radius: rpx(6);
   border-radius: rpx(6);
   border: 1px solid white;
   border: 1px solid white;
@@ -287,10 +287,10 @@ const groupList = ref([
 }
 }
 .people-box {
 .people-box {
   position: absolute;
   position: absolute;
-  top: rpx(-20);
+  top: rpx(-30);
   overflow: hidden;
   overflow: hidden;
   width: rpx(180);
   width: rpx(180);
-  height: rpx(130);
+  height: rpx(140);
   border-radius: rpx(6);
   border-radius: rpx(6);
   margin-bottom: rpx(5);
   margin-bottom: rpx(5);
   // background-color: pink;
   // background-color: pink;

+ 1 - 1
vite.config.js

@@ -16,13 +16,13 @@ export default defineConfig(({ mode }) => {
       }),
       }),
       vue(),
       vue(),
     ],
     ],
+    base: './',
     resolve: {
     resolve: {
       // 路径别名配置
       // 路径别名配置
       alias: {
       alias: {
         '@': path.resolve(__dirname, './src')
         '@': path.resolve(__dirname, './src')
       }
       }
     },
     },
-    base: './',
     server: {
     server: {
       host: '0.0.0.0',
       host: '0.0.0.0',
       proxy: {
       proxy: {