Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-resource
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-resource
Commits
9ed68367
提交
9ed68367
authored
2月 01, 2023
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
课程章节修改
上级
8c281aa2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
68 行增加
和
5 行删除
+68
-5
ViewCourseChapter.vue
src/modules/course/my/components/ViewCourseChapter.vue
+42
-3
ViewDetailsVideo.vue
src/modules/course/my/components/ViewDetailsVideo.vue
+13
-1
View.vue
src/modules/course/my/views/View.vue
+13
-1
没有找到文件。
src/modules/course/my/components/ViewCourseChapter.vue
浏览文件 @
9ed68367
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
CaretBottom
,
CaretRight
}
from
'@element-plus/icons-vue'
defineProps
<
{
data
:
any
[];
isBlack
?:
boolean
}
>
()
defineProps
<
{
data
:
any
[];
isBlack
?:
boolean
}
>
()
const
route
=
useRoute
()
const
route
=
useRoute
()
const
id
=
route
.
query
.
id
?
route
.
query
.
id
:
(
route
.
params
.
courseId
as
string
)
const
id
=
route
.
query
.
id
?
route
.
query
.
id
:
(
route
.
params
.
courseId
as
string
)
const
handleRes
=
function
(
item
:
any
)
{
if
(
item
===
undefined
)
{
item
.
show
=
true
}
else
{
item
.
show
=
!
item
.
show
}
}
</
script
>
</
script
>
<
template
>
<
template
>
<div
:class=
"isBlack ? 'chapter-box active-black' : 'chapter-box'"
>
<div
:class=
"isBlack ? 'chapter-box active-black' : 'chapter-box'"
>
...
@@ -17,9 +27,27 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
...
@@ -17,9 +27,27 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
<div
class=
"chapter-text"
>
<div
class=
"chapter-text"
>
<div
class=
"chapter"
>
{{
item
.
name
}}
</div>
<div
class=
"chapter"
>
{{
item
.
name
}}
</div>
<div
class=
"sections"
v-for=
"child in item.children"
:key=
"child.id"
>
<div
class=
"sections"
v-for=
"child in item.children"
:key=
"child.id"
>
<router-link
:to=
"`/course/my/view/$
{child.id}/${id}`">
<div
style=
"display: flex"
@
click=
"handleRes(child)"
>
{{
child
.
name
}}
<template
v-if=
"child.children.length"
>
</router-link>
<template
v-if=
"child.children.length"
>
<el-icon
v-if=
"child.show"
style=
"margin-right: 5px; margin-top: 2px"
color=
"#fff"
><CaretBottom
/></el-icon>
<el-icon
v-else
style=
"margin-right: 5px; margin-top: 2px"
color=
"#fff"
><CaretRight
/></el-icon>
</
template
>
<span>
{{ child.name }}
</span>
</template>
<router-link
v-else
:to=
"`/course/my/view/${child.id}/${id}`"
>
{{ child.name }}
</router-link>
</div>
<
template
v-for=
"(res, cI) in child.children"
>
<div
v-if=
"child.show"
class=
"resources"
:key=
"res.id"
>
<router-link
:to=
"`/course/my/view/$
{child.id}/${id}?index=${cI}`">
{{
res
.
name
}}
</router-link>
</div>
</
template
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -110,6 +138,17 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
...
@@ -110,6 +138,17 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
word-break
:
break-all
;
word-break
:
break-all
;
text-align
:
left
;
text-align
:
left
;
}
}
.resources
{
font-size
:
14px
;
line-height
:
1
.5
;
color
:
#ffffff
;
margin-top
:
10px
;
cursor
:
pointer
;
margin-left
:
30px
;
cursor
:
pointer
;
word-break
:
break-all
;
text-align
:
left
;
}
}
}
}
}
}
}
...
...
src/modules/course/my/components/ViewDetailsVideo.vue
浏览文件 @
9ed68367
...
@@ -3,6 +3,8 @@ import { getVideoDetails } from '../api'
...
@@ -3,6 +3,8 @@ import { getVideoDetails } from '../api'
import
AppVideoPlayer
from
'@/components/base/AppVideoPlayer.vue'
import
AppVideoPlayer
from
'@/components/base/AppVideoPlayer.vue'
import
ViewCourseChapter
from
'./ViewCourseChapter.vue'
import
ViewCourseChapter
from
'./ViewCourseChapter.vue'
const
route
=
useRoute
()
const
props
:
any
=
defineProps
({
const
props
:
any
=
defineProps
({
data
:
{
data
:
{
type
:
Array
type
:
Array
...
@@ -23,6 +25,13 @@ const getResourceData = (id: string) => {
...
@@ -23,6 +25,13 @@ const getResourceData = (id: string) => {
// 切换视频
// 切换视频
let
videoIndex
=
$ref
(
0
)
let
videoIndex
=
$ref
(
0
)
onMounted
(()
=>
{
if
(
route
.
query
.
index
!==
undefined
)
{
videoIndex
=
parseInt
(
route
.
query
.
index
as
''
)
}
})
const
videoOptions
=
computed
(()
=>
{
const
videoOptions
=
computed
(()
=>
{
return
{
return
{
sources
:
[
sources
:
[
...
@@ -38,8 +47,11 @@ const video = $computed<{ id: string }>(() => {
...
@@ -38,8 +47,11 @@ const video = $computed<{ id: string }>(() => {
return
props
.
data
[
videoIndex
]
return
props
.
data
[
videoIndex
]
})
})
watch
(
watch
(
()
=>
videoIndex
,
()
=>
[
videoIndex
,
route
.
query
.
index
]
,
()
=>
{
()
=>
{
if
(
route
.
query
.
index
!==
undefined
)
{
videoIndex
=
parseInt
(
route
.
query
.
index
as
''
)
}
getResourceData
(
video
.
id
)
getResourceData
(
video
.
id
)
},
},
{
immediate
:
true
}
{
immediate
:
true
}
...
...
src/modules/course/my/views/View.vue
浏览文件 @
9ed68367
...
@@ -12,6 +12,8 @@ const route = useRoute()
...
@@ -12,6 +12,8 @@ const route = useRoute()
const
id
=
route
.
query
.
id
as
string
const
id
=
route
.
query
.
id
as
string
const
courseDetails
:
any
=
ref
({})
const
courseDetails
:
any
=
ref
({})
let
chapters
=
$ref
([])
onMounted
(()
=>
{
onMounted
(()
=>
{
// 课程详情
// 课程详情
handleGetViewCourseDetails
()
handleGetViewCourseDetails
()
...
@@ -19,6 +21,16 @@ onMounted(() => {
...
@@ -19,6 +21,16 @@ onMounted(() => {
const
handleGetViewCourseDetails
=
()
=>
{
const
handleGetViewCourseDetails
=
()
=>
{
getViewCourseDetails
({
id
:
id
}).
then
((
res
:
any
)
=>
{
getViewCourseDetails
({
id
:
id
}).
then
((
res
:
any
)
=>
{
courseDetails
.
value
=
res
.
data
courseDetails
.
value
=
res
.
data
if
(
courseDetails
.
value
.
chapters
[
0
]?.
children
)
{
chapters
=
courseDetails
.
value
.
chapters
[
0
].
children
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
b
.
children
.
map
((
item
:
any
,
index
:
number
)
=>
{
index
===
0
?
(
item
.
show
=
true
)
:
(
item
.
show
=
false
)
return
item
})
a
.
push
(
b
)
return
a
},
[])
}
})
})
}
}
...
@@ -36,7 +48,7 @@ const handleFresh = () => {
...
@@ -36,7 +48,7 @@ const handleFresh = () => {
<ViewCourseInfo
:data=
"courseDetails"
class=
"info_bottom"
:id=
"id"
></ViewCourseInfo>
<ViewCourseInfo
:data=
"courseDetails"
class=
"info_bottom"
:id=
"id"
></ViewCourseInfo>
<ViewCourseChapter
<ViewCourseChapter
v-if=
"Object.keys(courseDetails).length"
v-if=
"Object.keys(courseDetails).length"
:data=
"c
ourseDetails.chapters[0]?.children || []
"
:data=
"c
hapters
"
class=
"info_chapter"
class=
"info_chapter"
></ViewCourseChapter>
></ViewCourseChapter>
</div>
</div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论