|
@@ -38,7 +38,7 @@
|
|
|
@open="handleOpen"
|
|
@open="handleOpen"
|
|
|
@close="handleClose"
|
|
@close="handleClose"
|
|
|
@select="handleSelect"
|
|
@select="handleSelect"
|
|
|
- :default-openeds="['3']"
|
|
|
|
|
|
|
+ :default-openeds="['3','5']"
|
|
|
>
|
|
>
|
|
|
<template v-for="item in menuItems" :key="item.key">
|
|
<template v-for="item in menuItems" :key="item.key">
|
|
|
<el-menu-item v-if="!item.children" :index="item.key">{{
|
|
<el-menu-item v-if="!item.children" :index="item.key">{{
|
|
@@ -358,19 +358,15 @@ onMounted(async () => {
|
|
|
const typeId = router.currentRoute.value.query.typeId
|
|
const typeId = router.currentRoute.value.query.typeId
|
|
|
if (typeId) {
|
|
if (typeId) {
|
|
|
try {
|
|
try {
|
|
|
- // 存储typeId到localStorage
|
|
|
|
|
- localStorage.setItem('typeId', typeId)
|
|
|
|
|
-
|
|
|
|
|
// 取接口课程数据
|
|
// 取接口课程数据
|
|
|
const res = await ClassType(typeId)
|
|
const res = await ClassType(typeId)
|
|
|
|
|
+ console.log(res);
|
|
|
courseList.value = res.data
|
|
courseList.value = res.data
|
|
|
-
|
|
|
|
|
// 初始化已观看课程ID
|
|
// 初始化已观看课程ID
|
|
|
const savedWatchedIds = localStorage.getItem('watchedCourseIds')
|
|
const savedWatchedIds = localStorage.getItem('watchedCourseIds')
|
|
|
if (savedWatchedIds) {
|
|
if (savedWatchedIds) {
|
|
|
watchedCourseIds.value = JSON.parse(savedWatchedIds)
|
|
watchedCourseIds.value = JSON.parse(savedWatchedIds)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
//课程数据
|
|
//课程数据
|
|
|
courseList.value.forEach((courseTemp, index) => {
|
|
courseList.value.forEach((courseTemp, index) => {
|
|
|
let menuIndex = courseTemp.courseLabel + '-' + (index + 1)
|
|
let menuIndex = courseTemp.courseLabel + '-' + (index + 1)
|