Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-psp-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-psp-show-h5
Commits
f4f61766
提交
f4f61766
authored
9月 10, 2024
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
第二版迭代
上级
4604ca2a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
54 行增加
和
31 行删除
+54
-31
CourseCatalog.vue
src/modules/course/components/CourseCatalog.vue
+1
-0
Chapter.vue
src/modules/course/views/Chapter.vue
+33
-8
Detail.vue
src/modules/course/views/Detail.vue
+17
-23
Index.vue
src/modules/exam/views/Index.vue
+3
-0
没有找到文件。
src/modules/course/components/CourseCatalog.vue
浏览文件 @
f4f61766
...
@@ -23,6 +23,7 @@ const secondsToHms = function (d: any) {
...
@@ -23,6 +23,7 @@ const secondsToHms = function (d: any) {
}
}
const
handleChapter
=
function
(
item
:
any
,
cItem
:
any
)
{
const
handleChapter
=
function
(
item
:
any
,
cItem
:
any
)
{
if
(
props
.
isFree
===
'已过期'
)
return
if
(
route
.
path
===
'/course/detail'
)
{
if
(
route
.
path
===
'/course/detail'
)
{
router
.
push
(
`/course/chapter?id=
${
route
.
query
?.
id
}
&
chapterId
=
$
{
item
.
id
}
`)
router
.
push
(
`/course/chapter?id=
${
route
.
query
?.
id
}
&
chapterId
=
$
{
item
.
id
}
`)
} else {
} else {
...
...
src/modules/course/views/Chapter.vue
浏览文件 @
f4f61766
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
AppContainer
from
'@/components/base/AppContainer.vue'
import
AppContainer
from
'@/components/base/AppContainer.vue'
import
{
getCourseDetail
}
from
'../api'
import
{
getCourseDetail
}
from
'../api'
import
CourseCatalog
from
'../components/CourseCatalog.vue'
import
CourseCatalog
from
'../components/CourseCatalog.vue'
import
{
Dialog
}
from
'vant'
const
route
=
useRoute
()
const
route
=
useRoute
()
const
router
=
useRouter
()
const
router
=
useRouter
()
...
@@ -25,8 +26,37 @@ getCourseDetail({ id: route.query?.id as string }).then((res: any) => {
...
@@ -25,8 +26,37 @@ getCourseDetail({ id: route.query?.id as string }).then((res: any) => {
})
})
const
goExam
=
function
()
{
const
goExam
=
function
()
{
router
.
push
(
`/exam?type=course&id=
${
route
.
query
?.
id
}
&
eId
=
$
{
data
.
course
?.
exams
[
0
].
examination_id
}
`)
// 考试有成绩
if
(
isExam
?.
status
!==
0
)
{
Dialog
.
alert
({
title
:
data
.
course
.
category_name
,
message
:
`您的考试成绩:
${
data
.
course
?.
exams
?.[
0
]?.
score
||
0
}
分
`,
confirmButtonText: `
$
{(
data
.
course
?.
exams
?.[
0
]?.
score
||
0
)
>=
60
?
'查看证书'
:
'重新考试'
}
`
}).then(() => {
if ((data.course?.exams?.[0]?.score || 0) >= 60) {
router.push('/my')
} else {
router.push(`
/
exam
?
is_new
=
1
&
type
=
course
&
id
=
$
{
route
.
query
?.
id
}
&
eId
=
$
{
data
.
course
?.
exams
[
0
].
examination_id
}
`)
}
})
} else {
// 没提交考试
if (data.course.progress >= 80) {
router.push(`
/
exam
?
type
=
course
&
id
=
$
{
route
.
query
?.
id
}
&
eId
=
$
{
data
.
course
?.
exams
[
0
].
examination_id
}
`)
} else {
Dialog.alert({
title: '提示',
message: '课程学习进度未达到80%以上,不能进行考试'
}).then(() => {
// on close
})
}
}
}
}
const isExam = $computed(() => {
return data.course?.exams?.[0] || {}
})
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -41,18 +71,13 @@ const goExam = function () {
...
@@ -41,18 +71,13 @@ const goExam = function () {
></CourseCatalog>
></CourseCatalog>
</div>
</div>
<van-button
<van-button
v-if=
"
v-if=
"data.course?.exams && data.course?.exams.length && data.course.is_free_name !== '收费'"
data.course?.exams &&
data.course?.exams.length &&
data.course?.exams[0].status !== 1 &&
data.course.is_free_name !== '收费'
"
@
click=
"goExam"
@
click=
"goExam"
type=
"primary"
type=
"primary"
size=
"large"
size=
"large"
color=
"#aa1941"
color=
"#aa1941"
style=
"margin-bottom: 1rem"
style=
"margin-bottom: 1rem"
>
课程考试
</van-button
>
{{
isExam
?.
status
!==
0
?
'查看考试成绩'
:
'课程考试'
}}
</van-button
>
>
</
template
>
</
template
>
...
...
src/modules/course/views/Detail.vue
浏览文件 @
f4f61766
...
@@ -25,26 +25,9 @@ getCourseDetail({ id: route.query?.id as string }).then((res: any) => {
...
@@ -25,26 +25,9 @@ getCourseDetail({ id: route.query?.id as string }).then((res: any) => {
})
})
const
handleStudy
=
function
()
{
const
handleStudy
=
function
()
{
router
.
push
(
`/course/chapter?id=
${
route
.
query
?.
id
}
&
chapterId
=
$
{
data
.
course
?.
id
}
`)
if
(
data
.
course
?.
is_free_name
!==
'已过期'
)
{
// const videoId = data.course.last_play_video
router
.
push
(
`/course/chapter?id=
${
route
.
query
?.
id
}
&
chapterId
=
$
{
data
.
course
?.
id
}
`)
// let query = {
}
// cId: '',
// rId: '',
// zId: ''
// }
// data.course.chapters.forEach((item: any) => {
// const findItem = item.children.find((cItem: any) => cItem.resource_id === videoId)
// query = {
// cId: findItem?.id || '',
// rId: findItem?.resource_id || '',
// zId: item.id
// }
// })
// if (videoId === '' || query.cId === '' || query.rId === '') {
// router.push(`
/
course
/
chapter
?
id
=
$
{
route
.
query
?.
id
}
&
chapterId
=
$
{
data
.
course
?.
id
}
`)
// } else {
// router.push(`
/
course
/
player
?
id
=
$
{
route
.
query
?.
id
}
&
chapterId
=
$
{
query
.
cId
}
&
rId
=
$
{
query
.
rId
}
&&
zId
=
$
{
query
.
zId
}
`)
// }
}
}
const isExam = function () {
const isExam = function () {
...
@@ -61,9 +44,14 @@ const isExam = function () {
...
@@ -61,9 +44,14 @@ const isExam = function () {
const viewResult = function () {
const viewResult = function () {
Dialog.alert({
Dialog.alert({
title: data.course.category_name,
title: data.course.category_name,
message: `
您的考试成绩:
$
{
data
.
course
?.
exams
[
0
].
score
}
分
`
message: `
您的考试成绩:
$
{
data
.
course
?.
exams
?.[
0
]?.
score
||
0
}
分
`,
confirmButtonText: `
$
{(
data
.
course
?.
exams
?.[
0
]?.
score
||
0
)
>=
60
?
'查看证书'
:
'重新考试'
}
`
}).then(() => {
}).then(() => {
// on close
if ((data.course?.exams?.[0]?.score || 0) >= 60) {
router.push('/my')
} else {
router.push(`
/
exam
?
is_new
=
1
&
type
=
course
&
id
=
$
{
route
.
query
?.
id
}
&
eId
=
$
{
data
.
course
?.
exams
[
0
].
examination_id
}
`)
}
})
})
}
}
</
script
>
</
script
>
...
@@ -107,7 +95,9 @@ const viewResult = function () {
...
@@ -107,7 +95,9 @@ const viewResult = function () {
<div
class=
"btn"
>
立即购买
</div>
<div
class=
"btn"
>
立即购买
</div>
</div>
</div>
<!-- 已购买没考试 -->
<!-- 已购买没考试 -->
<div
class=
"btn-s2"
v-else
@
click=
"handleStudy"
>
立即学习
</div>
<div
:class=
"data.course?.is_free_name === '已过期' ? 'btn-s2 free' : 'btn-s2'"
v-else
@
click=
"handleStudy"
>
立即学习
</div>
</
template
>
</
template
>
</div>
</div>
</div>
</div>
...
@@ -257,6 +247,10 @@ const viewResult = function () {
...
@@ -257,6 +247,10 @@ const viewResult = function () {
color
:
#ffffff
;
color
:
#ffffff
;
text-align
:
center
;
text-align
:
center
;
box-shadow
:
0
0
5px
1px
rgba
(
170
,
25
,
65
,
0
.5
);
box-shadow
:
0
0
5px
1px
rgba
(
170
,
25
,
65
,
0
.5
);
&
.free
{
background
:
#ccc
;
box-shadow
:
none
;
}
}
}
}
}
</
style
>
</
style
>
src/modules/exam/views/Index.vue
浏览文件 @
f4f61766
...
@@ -21,6 +21,9 @@ if (route.query.type) {
...
@@ -21,6 +21,9 @@ if (route.query.type) {
}
else
{
}
else
{
initParams
.
chapter_id
=
route
.
query
?.
cId
initParams
.
chapter_id
=
route
.
query
?.
cId
}
}
if
(
route
.
query
.
is_new
)
{
initParams
.
is_new
=
true
}
getExam
(
initParams
).
then
((
res
:
any
)
=>
{
getExam
(
initParams
).
then
((
res
:
any
)
=>
{
data
=
res
.
data
data
=
res
.
data
if
(
res
.
data
?.
questions
||
res
.
data
?.
questions
!==
''
)
{
if
(
res
.
data
?.
questions
||
res
.
data
?.
questions
!==
''
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论