Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-professional-exam
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Culm
pica-professional-exam
提交
7afc6d56
提交
7afc6d56
编写于
8月 26, 2020
作者:
guofeng.chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改pdf
上级
0536af97
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
10 行删除
+20
-10
course-ware.vue
src/components/course/course-ware.vue
+13
-3
course-detail.vue
src/views/course-detail.vue
+7
-7
未找到文件。
src/components/course/course-ware.vue
浏览文件 @
7afc6d56
<
template
>
<
template
>
<div
class=
"course-ware"
></div>
<div
class=
"course-ware"
>
<div
v-show=
"url"
class=
"canvas-box"
></div>
<p
v-show=
"!url"
class=
"tip"
>
无相关课件
</p>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -29,10 +32,12 @@ export default {
...
@@ -29,10 +32,12 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
parentDom
=
this
.
$el
.
querySelector
(
'.canvas-box'
);
this
.
drawPDF
();
this
.
drawPDF
();
},
},
methods
:
{
methods
:
{
async
drawPDF
()
{
async
drawPDF
()
{
console
.
log
(
'_____url_______'
,
this
.
url
);
if
(
!
this
.
url
)
{
if
(
!
this
.
url
)
{
return
;
return
;
}
}
...
@@ -48,7 +53,7 @@ export default {
...
@@ -48,7 +53,7 @@ export default {
pageAll
.
push
(
pdf
.
getPage
(
i
+
1
).
catch
(
err
=>
''
))
pageAll
.
push
(
pdf
.
getPage
(
i
+
1
).
catch
(
err
=>
''
))
}
}
const
pages
=
await
Promise
.
all
(
pageAll
);
const
pages
=
await
Promise
.
all
(
pageAll
);
this
.
$el
.
innerHTML
=
''
;
this
.
parentDom
.
innerHTML
=
''
;
for
(
let
item
of
pages
)
{
for
(
let
item
of
pages
)
{
this
.
createCanvas
(
item
)
this
.
createCanvas
(
item
)
}
}
...
@@ -91,7 +96,7 @@ export default {
...
@@ -91,7 +96,7 @@ export default {
}
}
box
.
appendChild
(
cover
);
box
.
appendChild
(
cover
);
}
}
this
.
$el
.
appendChild
(
box
);
this
.
parentDom
.
appendChild
(
box
);
}
}
}
}
};
};
...
@@ -101,5 +106,10 @@ export default {
...
@@ -101,5 +106,10 @@ export default {
.course-ware{
.course-ware{
padding-top: 20px;
padding-top: 20px;
overflow: hidden;
overflow: hidden;
.tip{
font-size: 14px;
text-align: center;
margin-top: 50px;
}
}
}
</
style
>
</
style
>
src/views/course-detail.vue
浏览文件 @
7afc6d56
...
@@ -150,11 +150,11 @@ export default {
...
@@ -150,11 +150,11 @@ export default {
if
(
token
&&
!
info
.
id
)
{
if
(
token
&&
!
info
.
id
)
{
this
.
$store
.
dispatch
(
'getUserInfo'
);
this
.
$store
.
dispatch
(
'getUserInfo'
);
}
}
this
.
projectId
=
sessionStorage
.
getItem
(
'projectId'
);
//
this.projectId = sessionStorage.getItem('projectId');
if
(
!
this
.
projectId
)
{
//
if (!this.projectId) {
this
.
$router
.
replace
(
'/not-found'
);
//
this.$router.replace('/not-found');
return
;
//
return;
}
//
}
this
.
getCourseInfo
();
this
.
getCourseInfo
();
this
.
getCourseQas
();
this
.
getCourseQas
();
const
{
height
}
=
this
.
$el
.
querySelector
(
'.video-box'
).
getBoundingClientRect
();
const
{
height
}
=
this
.
$el
.
querySelector
(
'.video-box'
).
getBoundingClientRect
();
...
@@ -202,7 +202,7 @@ export default {
...
@@ -202,7 +202,7 @@ export default {
const
[
chaptersAll
,
curtLecture
]
=
this
.
getAllChapters
(
chapters
,
lectureResourceList
,
lastLecture
,
showFlag
,
trySeeFlag
);
const
[
chaptersAll
,
curtLecture
]
=
this
.
getAllChapters
(
chapters
,
lectureResourceList
,
lastLecture
,
showFlag
,
trySeeFlag
);
this
.
chapters
=
chaptersAll
;
this
.
chapters
=
chaptersAll
;
this
.
curtLectureId
=
curtLecture
.
lectureId
;
this
.
curtLectureId
=
curtLecture
.
lectureId
;
this
.
pdfUrl
=
getPdfFileUrl
(
curtLecture
.
courseware
.
filePath
);
this
.
pdfUrl
=
getPdfFileUrl
(
curtLecture
.
courseware
?
curtLecture
.
courseware
.
filePath
:
''
);
// 付费课程-请去App查看;或可试看且时长为0
// 付费课程-请去App查看;或可试看且时长为0
let
enable
=
true
;
let
enable
=
true
;
if
(
showFlag
===
10
||
(
trySeeFlag
&&
!
trySeeTime
))
{
if
(
showFlag
===
10
||
(
trySeeFlag
&&
!
trySeeTime
))
{
...
@@ -323,7 +323,7 @@ export default {
...
@@ -323,7 +323,7 @@ export default {
this
.
coverType
=
0
;
this
.
coverType
=
0
;
}
}
this
.
curtLectureId
=
lecture
.
lectureId
;
this
.
curtLectureId
=
lecture
.
lectureId
;
this
.
pdfUrl
=
getPdfFileUrl
(
lecture
.
courseware
.
filePath
);
this
.
pdfUrl
=
getPdfFileUrl
(
lecture
.
courseware
?
lecture
.
courseware
.
filePath
:
''
);
let
history
=
0
;
let
history
=
0
;
if
(
lecture
.
progress
<
1
)
{
if
(
lecture
.
progress
<
1
)
{
history
=
lecture
.
lastTime
===
1
?
0
:
lecture
.
lastTime
history
=
lecture
.
lastTime
===
1
?
0
:
lecture
.
lastTime
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录