|
@@ -165,6 +165,7 @@ const coursewareMenuList = shallowRef<any[]>([]) // 课程类型
|
|
const coursewareList = shallowRef<any[]>([]) // 知识点
|
|
const coursewareList = shallowRef<any[]>([]) // 知识点
|
|
const flattenCoursewareList = ref<any[]>([]) // 扁平化coursewareList
|
|
const flattenCoursewareList = ref<any[]>([]) // 扁平化coursewareList
|
|
const isCurrentCoursewareMenu = shallowRef(true) // 是否为当前选的课程类型
|
|
const isCurrentCoursewareMenu = shallowRef(true) // 是否为当前选的课程类型
|
|
|
|
+const currentId = ref<any>(route.params.id)
|
|
// 选中的知识点
|
|
// 选中的知识点
|
|
const activeCourseware = computed<undefined | Record<string, any>>(() => {
|
|
const activeCourseware = computed<undefined | Record<string, any>>(() => {
|
|
return flattenCoursewareList.value[activeCoursewareIndex.value]
|
|
return flattenCoursewareList.value[activeCoursewareIndex.value]
|
|
@@ -322,14 +323,19 @@ function handleCourseClick(value: any) {
|
|
drawerShow.value = false
|
|
drawerShow.value = false
|
|
}
|
|
}
|
|
async function handleCourseMenuClick(value: any) {
|
|
async function handleCourseMenuClick(value: any) {
|
|
|
|
+ if (currentId.value === value.id) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
LoadingBar.loading(true)
|
|
LoadingBar.loading(true)
|
|
- flattenCoursewareListData = []
|
|
|
|
- activeCoursewareIndex.value = -1
|
|
|
|
|
|
+ currentId.value = value.id
|
|
if (value.id === route.params.id) {
|
|
if (value.id === route.params.id) {
|
|
isCurrentCoursewareMenu.value = true
|
|
isCurrentCoursewareMenu.value = true
|
|
} else {
|
|
} else {
|
|
isCurrentCoursewareMenu.value = false
|
|
isCurrentCoursewareMenu.value = false
|
|
}
|
|
}
|
|
|
|
+ flattenCoursewareListData = []
|
|
|
|
+ activeCoursewareIndex.value = -1
|
|
await getCoursewareList(value.id)
|
|
await getCoursewareList(value.id)
|
|
getCoursewareMenuList(value.id)
|
|
getCoursewareMenuList(value.id)
|
|
drawerMenuShow.value = false
|
|
drawerMenuShow.value = false
|
|
@@ -517,7 +523,7 @@ function handlePracticeClose() {
|
|
|
|
|
|
function onTitleTip(type: "phaseGoals" | "checkItem", text: string) {
|
|
function onTitleTip(type: "phaseGoals" | "checkItem", text: string) {
|
|
useCoursewarePlayTip({
|
|
useCoursewarePlayTip({
|
|
- headImg: require(`@/img/coursewarePlay/${type ? "ts3" : "ts4"}.png`),
|
|
|
|
|
|
+ headImg: require(`@/img/coursewarePlay/${type === "phaseGoals" ? "ts3" : "ts4"}.png`),
|
|
text,
|
|
text,
|
|
btnShow: [false, false]
|
|
btnShow: [false, false]
|
|
})
|
|
})
|