Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-learn
Commits
593bf03d
提交
593bf03d
authored
8月 04, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
6f789762
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
32 行增加
和
9 行删除
+32
-9
CourseListItem.vue
src/modules/course/components/CourseListItem.vue
+14
-7
CoursePlayerChapter.vue
src/modules/course/components/CoursePlayerChapter.vue
+5
-1
CourseViewChapter.vue
src/modules/course/components/CourseViewChapter.vue
+7
-0
CoursePlayer.vue
src/modules/course/views/CoursePlayer.vue
+6
-1
没有找到文件。
src/modules/course/components/CourseListItem.vue
浏览文件 @
593bf03d
...
@@ -27,6 +27,18 @@ const electiveTypeText = computed(() => {
...
@@ -27,6 +27,18 @@ const electiveTypeText = computed(() => {
// 是否选中
// 是否选中
const
isActive
=
computed
(()
=>
props
.
data
.
course_id
===
courseId
)
const
isActive
=
computed
(()
=>
props
.
data
.
course_id
===
courseId
)
// 跳转链接
const
targetUrlQuery
=
computed
(()
=>
{
let
queryString
=
`course_id=
${
props
.
data
.
course_id
}
&semester_id=
${
props
.
data
.
semester_id
}
`
if
(
props
.
data
.
section
&&
props
.
data
.
section
?.
watch_video_length
)
{
queryString
+=
`&chapter_id=
${
props
.
data
.
section
?.
chapter_id
??
''
}
&
section_id
=
$
{
props
.
data
.
section
?.
section_id
??
''
}
&
resource_id
=
$
{
props
.
data
.
section
?.
resource_id
??
''
}
`
}
return queryString
})
// 置顶
// 置顶
function handleTop(data: CourseListItemType) {
function handleTop(data: CourseListItemType) {
topCourse({ id: data.id, status: data.is_top ? 0 : 1 }).then(() => {
topCourse({ id: data.id, status: data.is_top ? 0 : 1 }).then(() => {
...
@@ -41,9 +53,7 @@ function handleTop(data: CourseListItemType) {
...
@@ -41,9 +53,7 @@ function handleTop(data: CourseListItemType) {
<el-tooltip
:content=
"!!data.is_top ? '取消置顶' : '置顶'"
>
<el-tooltip
:content=
"!!data.is_top ? '取消置顶' : '置顶'"
>
<div
class=
"course-item__top"
:class=
"
{ 'is-active': !!data.is_top }" @click="handleTop(data)">
</div>
<div
class=
"course-item__top"
:class=
"
{ 'is-active': !!data.is_top }" @click="handleTop(data)">
</div>
</el-tooltip>
</el-tooltip>
<router-link
<router-link
:to=
"`/course/view?$
{targetUrlQuery}`">
:to=
"`/course/view?course_id=$
{data.course_id}
&
semester_id=${data.semester_id}
&
chapter_id=${data.section?.chapter_id}
&
section_id=${data.section?.section_id}
&
resource_id=${data.section?.resource_id}`"
>
<div
class=
"course-item-bd"
>
<div
class=
"course-item-bd"
>
<div
class=
"course-item-pic"
>
<div
class=
"course-item-pic"
>
<img
:src=
"data.cover"
/><span
class=
"course-item__type"
>
{{
electiveTypeText
}}
</span>
<img
:src=
"data.cover"
/><span
class=
"course-item__type"
>
{{
electiveTypeText
}}
</span>
...
@@ -58,10 +68,7 @@ function handleTop(data: CourseListItemType) {
...
@@ -58,10 +68,7 @@ function handleTop(data: CourseListItemType) {
<div
class=
"course-item-playlist"
v-if=
"data.section?.watch_video_length"
>
<div
class=
"course-item-playlist"
v-if=
"data.section?.watch_video_length"
>
<p
class=
"t1"
>
{{
data
.
section
.
name
}}
</p>
<p
class=
"t1"
>
{{
data
.
section
.
name
}}
</p>
<p
class=
"t2"
>
已观看
{{
data
.
section
.
schedule
}}
%
</p>
<p
class=
"t2"
>
已观看
{{
data
.
section
.
schedule
}}
%
</p>
<router-link
<router-link
:to=
"`/course/player?$
{targetUrlQuery}`" target="_blank">
:to=
"`/course/player?course_id=$
{data.course_id}
&
chapter_id=${data.section.chapter_id}
&
section_id=${data.section.section_id}
&
resource_id=${data.section.resource_id}
&
semester_id=${data.semester_id}`"
target="_blank"
>
<el-button
type=
"primary"
round
>
点击观看
</el-button>
<el-button
type=
"primary"
round
>
点击观看
</el-button>
</router-link>
</router-link>
</div>
</div>
...
...
src/modules/course/components/CoursePlayerChapter.vue
浏览文件 @
593bf03d
...
@@ -10,6 +10,10 @@ interface Props {
...
@@ -10,6 +10,10 @@ interface Props {
}
}
const
props
=
defineProps
<
Props
>
()
const
props
=
defineProps
<
Props
>
()
defineEmits
<
{
(
e
:
'clickPPT'
,
ppt
:
PptType
):
void
}
>
()
const
route
=
useRoute
()
const
route
=
useRoute
()
let
courseId
=
$ref
<
string
>
(
''
)
let
courseId
=
$ref
<
string
>
(
''
)
let
sectionId
=
$ref
<
string
>
(
''
)
let
sectionId
=
$ref
<
string
>
(
''
)
...
@@ -54,7 +58,7 @@ function formatDuration(duration: number | undefined) {
...
@@ -54,7 +58,7 @@ function formatDuration(duration: number | undefined) {
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"讲义"
name=
"ppt"
v-if=
"pptList && pptList.length"
>
<el-tab-pane
label=
"讲义"
name=
"ppt"
v-if=
"pptList && pptList.length"
>
<ul
class=
"lecture-list"
>
<ul
class=
"lecture-list"
>
<li
v-for=
"item in pptList"
:key=
"item.url"
>
<li
v-for=
"item in pptList"
:key=
"item.url"
@
click=
"$emit('clickPPT', item)"
>
<img
:src=
"`$
{item.url}?x-oss-process=image/resize,m_fill,h_128,w_218`" loading="lazy" />
<img
:src=
"`$
{item.url}?x-oss-process=image/resize,m_fill,h_128,w_218`" loading="lazy" />
<span>
{{
formatDuration
(
item
.
point
)
}}
</span>
<span>
{{
formatDuration
(
item
.
point
)
}}
</span>
</li>
</li>
...
...
src/modules/course/components/CourseViewChapter.vue
浏览文件 @
593bf03d
...
@@ -34,6 +34,13 @@ function fetchList() {
...
@@ -34,6 +34,13 @@ function fetchList() {
}
}
getChapterTreeList
({
course_id
:
courseId
,
semester_id
:
semesterId
}).
then
(
res
=>
{
getChapterTreeList
({
course_id
:
courseId
,
semester_id
:
semesterId
}).
then
(
res
=>
{
chapterList
=
res
.
data
.
items
chapterList
=
res
.
data
.
items
// 设置展开第一项
const
[
first
]
=
chapterList
if
(
!
chapterId
&&
first
)
{
chapterIds
.
push
(
first
.
id
)
const
[
section
]
=
first
.
sections
section
&&
sectionIds
.
push
(
section
.
id
)
}
})
})
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
...
...
src/modules/course/views/CoursePlayer.vue
浏览文件 @
593bf03d
...
@@ -4,6 +4,7 @@ import { getCourseSection, getChapterTreeList } from '../api'
...
@@ -4,6 +4,7 @@ import { getCourseSection, getChapterTreeList } from '../api'
import
CoursePlayerResourceList
from
'../components/CoursePlayerResourceList.vue'
import
CoursePlayerResourceList
from
'../components/CoursePlayerResourceList.vue'
import
{
ArrowLeftBold
,
ArrowRightBold
}
from
'@element-plus/icons-vue'
import
{
ArrowLeftBold
,
ArrowRightBold
}
from
'@element-plus/icons-vue'
import
type
{
VideoJsPlayer
}
from
'video.js'
import
type
{
VideoJsPlayer
}
from
'video.js'
import
type
{
PptType
}
from
'@/types'
const
CoursePlayerVideo
=
defineAsyncComponent
(()
=>
import
(
'../components/CoursePlayerVideo.vue'
))
const
CoursePlayerVideo
=
defineAsyncComponent
(()
=>
import
(
'../components/CoursePlayerVideo.vue'
))
const
CoursePlayerChapter
=
defineAsyncComponent
(()
=>
import
(
'../components/CoursePlayerChapter.vue'
))
const
CoursePlayerChapter
=
defineAsyncComponent
(()
=>
import
(
'../components/CoursePlayerChapter.vue'
))
...
@@ -61,6 +62,10 @@ const pptList = $computed(() => {
...
@@ -61,6 +62,10 @@ const pptList = $computed(() => {
function
onUpdateResource
(
resource
:
CourseResourceType
|
undefined
)
{
function
onUpdateResource
(
resource
:
CourseResourceType
|
undefined
)
{
currentVideoResource
=
resource
currentVideoResource
=
resource
}
}
// ppt点击
function
onClickPPT
(
ppt
:
PptType
)
{
videoJsPlayer
?.
currentTime
(
ppt
.
point
)
}
let
sidebarVisible
=
$ref
<
boolean
>
(
true
)
let
sidebarVisible
=
$ref
<
boolean
>
(
true
)
function
toggleSidebar
()
{
function
toggleSidebar
()
{
...
@@ -99,7 +104,7 @@ function toggleSidebar() {
...
@@ -99,7 +104,7 @@ function toggleSidebar() {
</div>
</div>
<div
class=
"course-player-aside"
:class=
"
{ 'is-hidden': !sidebarVisible }">
<div
class=
"course-player-aside"
:class=
"
{ 'is-hidden': !sidebarVisible }">
<div
class=
"course-player-aside__inner"
>
<div
class=
"course-player-aside__inner"
>
<CoursePlayerChapter
:chapterList=
"chapterList"
:pptList=
"pptList"
/>
<CoursePlayerChapter
:chapterList=
"chapterList"
:pptList=
"pptList"
@
clickPPT=
"onClickPPT"
/>
</div>
</div>
<div
class=
"toggle-button"
:class=
"
{ 'is-hidden': !sidebarVisible }" @click="toggleSidebar">
<div
class=
"toggle-button"
:class=
"
{ 'is-hidden': !sidebarVisible }" @click="toggleSidebar">
<el-icon>
<el-icon>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论