|
|
@ -1,38 +1,59 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<!-- 课程预览 --> |
|
|
|
<!-- 课程预览 --> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="m-b-20"> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="flex-between"> |
|
|
|
<el-page-header @back="goBack" :content="'课程预览'"></el-page-header> |
|
|
|
<el-page-header @back="goBack" |
|
|
|
|
|
|
|
:content="'课程预览'"></el-page-header> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="m-b-20" style="background: none;"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="m-b-20" |
|
|
|
|
|
|
|
style="background: none;"> |
|
|
|
<div class="flex"> |
|
|
|
<div class="flex"> |
|
|
|
<div class="cover" :class="{'is-word': showMask1}"> |
|
|
|
<div class="cover" |
|
|
|
<img v-if="coverUrl" :src="coverUrl" alt="" width="100%" height="100%"> |
|
|
|
:class="{'is-word': showMask1}"> |
|
|
|
|
|
|
|
<img v-if="coverUrl" |
|
|
|
|
|
|
|
:src="coverUrl" |
|
|
|
|
|
|
|
alt="" |
|
|
|
|
|
|
|
width="100%" |
|
|
|
|
|
|
|
height="100%"> |
|
|
|
<template v-else-if="iframeSrc"> |
|
|
|
<template v-else-if="iframeSrc"> |
|
|
|
<iframe class="inner fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> |
|
|
|
<iframe class="inner fileIframe" |
|
|
|
|
|
|
|
id="fileIframe" |
|
|
|
|
|
|
|
:src="iframeSrc" |
|
|
|
|
|
|
|
frameborder="0"></iframe> |
|
|
|
<template v-if="showMask"> |
|
|
|
<template v-if="showMask"> |
|
|
|
<div class="mask" style="width: 500px;height: 30px;top: 53px;right: 320px"></div> |
|
|
|
<div class="mask" |
|
|
|
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div> |
|
|
|
style="width: 500px;height: 30px;top: 53px;right: 320px"></div> |
|
|
|
|
|
|
|
<div class="mask" |
|
|
|
|
|
|
|
style="width: 175px;height: 30px;top: 53px;right: 5px"></div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-if="showMask1"> |
|
|
|
<template v-if="showMask1"> |
|
|
|
<div class="word-mask" style="height: 40px;"></div> |
|
|
|
<div class="word-mask" |
|
|
|
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div> |
|
|
|
style="height: 40px;"></div> |
|
|
|
|
|
|
|
<div class="word-mask2" |
|
|
|
|
|
|
|
style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-if="showMask2"> |
|
|
|
<template v-if="showMask2"> |
|
|
|
<div class="excel-mask1" style="height: 48px;"></div> |
|
|
|
<div class="excel-mask1" |
|
|
|
|
|
|
|
style="height: 48px;"></div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<div class="pdf inner" v-else-if="pdfSrc"> |
|
|
|
<div class="pdf inner" |
|
|
|
|
|
|
|
v-else-if="pdfSrc"> |
|
|
|
<p class="arrow"> |
|
|
|
<p class="arrow"> |
|
|
|
<span @click="changePdfPage(0)" class="turn el-icon-arrow-left" :class="{grey: currentPage==1}"></span> |
|
|
|
<span @click="changePdfPage(0)" |
|
|
|
|
|
|
|
class="turn el-icon-arrow-left" |
|
|
|
|
|
|
|
:class="{grey: currentPage==1}"></span> |
|
|
|
{{ currentPage }} / {{ pageCount }} |
|
|
|
{{ currentPage }} / {{ pageCount }} |
|
|
|
<span @click="changePdfPage(1)" class="turn el-icon-arrow-right" :class="{grey: currentPage==pageCount}"></span> |
|
|
|
<span @click="changePdfPage(1)" |
|
|
|
|
|
|
|
class="turn el-icon-arrow-right" |
|
|
|
|
|
|
|
:class="{grey: currentPage==pageCount}"></span> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<pdf |
|
|
|
<pdf class="pdf-wrap" |
|
|
|
class="pdf-wrap" |
|
|
|
|
|
|
|
:src="pdfSrc" |
|
|
|
:src="pdfSrc" |
|
|
|
:page="currentPage" |
|
|
|
:page="currentPage" |
|
|
|
@num-pages="pageCount=$event" |
|
|
|
@num-pages="pageCount=$event" |
|
|
@ -40,27 +61,41 @@ |
|
|
|
@loaded="loadPdfHandler"> |
|
|
|
@loaded="loadPdfHandler"> |
|
|
|
</pdf> |
|
|
|
</pdf> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="inner" v-else-if="playAuth"> |
|
|
|
<div class="inner" |
|
|
|
<div class="video_wid" id="player"></div> |
|
|
|
v-else-if="playAuth"> |
|
|
|
|
|
|
|
<div class="video_wid" |
|
|
|
|
|
|
|
id="player"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="catalog flex-1"> |
|
|
|
<div class="catalog flex-1"> |
|
|
|
<div class="list"> |
|
|
|
<div class="list"> |
|
|
|
<h4 class="title">{{ courseName }}</h4> |
|
|
|
<h4 class="title">{{ courseName }}</h4> |
|
|
|
<div class="desc-wrap"> |
|
|
|
<div class="desc-wrap"> |
|
|
|
<div class="desc" :class="{active: desShrink}" v-html="description"></div> |
|
|
|
<div class="desc" |
|
|
|
<i class="arrow" :class="{active: desShrink}" v-if="description.length > 40"> |
|
|
|
:class="{active: desShrink}" |
|
|
|
|
|
|
|
v-html="description"></div> |
|
|
|
|
|
|
|
<i class="arrow" |
|
|
|
|
|
|
|
:class="{active: desShrink}" |
|
|
|
|
|
|
|
v-if="description.length > 40"> |
|
|
|
<span>...</span> |
|
|
|
<span>...</span> |
|
|
|
<img src="@/assets/img/arrow-down.png" alt="" @click="desShrink = !desShrink"> |
|
|
|
<img src="@/assets/img/arrow-down.png" |
|
|
|
|
|
|
|
alt="" |
|
|
|
|
|
|
|
@click="desShrink = !desShrink"> |
|
|
|
</i> |
|
|
|
</i> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="chapters"> |
|
|
|
<div class="chapters"> |
|
|
|
<template v-if="videoList.length"> |
|
|
|
<template v-if="videoList.length"> |
|
|
|
<div class="chapter" v-for="(item,index) in videoList" :key="index"> |
|
|
|
<div class="chapter" |
|
|
|
|
|
|
|
v-for="(item,index) in videoList" |
|
|
|
|
|
|
|
:key="index"> |
|
|
|
<div class="chapterName">{{ item.name }}</div> |
|
|
|
<div class="chapterName">{{ item.name }}</div> |
|
|
|
<div class="section" v-if="item.subsectionList.length"> |
|
|
|
<div class="section" |
|
|
|
<div v-for="(section,i) in item.subsectionList" :key="i" @click="preview(section, item.name)"> |
|
|
|
v-if="item.subsectionList.length"> |
|
|
|
<p class="sectionName" :class="{active: curLink === `${item.name}${section.name}`}">{{ section.name }}</p> |
|
|
|
<div v-for="(section,i) in item.subsectionList" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
@click="preview(section, item.name)"> |
|
|
|
|
|
|
|
<p class="sectionName" |
|
|
|
|
|
|
|
:class="{active: curLink === `${item.name}${section.name}`}">{{ section.name }}</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -83,7 +118,7 @@ import "quill/dist/quill.bubble.css"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "coursePreview", |
|
|
|
name: "coursePreview", |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
id: this.$route.query.id, |
|
|
|
id: this.$route.query.id, |
|
|
|
video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4", |
|
|
|
video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4", |
|
|
@ -115,26 +150,26 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { pdf }, |
|
|
|
components: { pdf }, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
this.insertScript(); |
|
|
|
this.insertScript(); |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
this.getChapter(); |
|
|
|
this.getChapter(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
goBack() { |
|
|
|
goBack () { |
|
|
|
this.$router.back(); |
|
|
|
this.$router.back(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
async getData() { |
|
|
|
async getData () { |
|
|
|
let res = await this.$post(`${this.api.findTheoreticalCourse}?id=${this.id}`); |
|
|
|
let res = await this.$post(`${this.api.findTheoreticalCourse}?id=${this.id}`); |
|
|
|
this.courseName = res.data.courseName; |
|
|
|
this.courseName = res.data.courseName; |
|
|
|
this.description = res.data.courseIntroduction; |
|
|
|
this.description = res.data.courseIntroduction; |
|
|
|
this.coverUrl = res.data.coverUrl; |
|
|
|
this.coverUrl = res.data.coverUrl; |
|
|
|
}, |
|
|
|
}, |
|
|
|
async getChapter() { |
|
|
|
async getChapter () { |
|
|
|
let res = await this.$get(`${this.api.queryChapters}?courseId=${this.id}`); |
|
|
|
let res = await this.$get(`${this.api.queryChaptersTheoretical}?courseId=${this.id}`); |
|
|
|
this.videoList = res.chapterList; |
|
|
|
this.videoList = res.chapterList; |
|
|
|
}, |
|
|
|
}, |
|
|
|
insertScript() { |
|
|
|
insertScript () { |
|
|
|
const linkTag = document.createElement("link"); |
|
|
|
const linkTag = document.createElement("link"); |
|
|
|
linkTag.rel = "stylesheet"; |
|
|
|
linkTag.rel = "stylesheet"; |
|
|
|
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; |
|
|
|
linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css"; |
|
|
@ -145,12 +180,12 @@ export default { |
|
|
|
scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"; |
|
|
|
scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"; |
|
|
|
document.body.appendChild(scriptTag); |
|
|
|
document.body.appendChild(scriptTag); |
|
|
|
}, |
|
|
|
}, |
|
|
|
transferType(ext) { |
|
|
|
transferType (ext) { |
|
|
|
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片"; |
|
|
|
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片"; |
|
|
|
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; |
|
|
|
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频"; |
|
|
|
return ext; |
|
|
|
return ext; |
|
|
|
}, |
|
|
|
}, |
|
|
|
preview(row, chapterName) { |
|
|
|
preview (row, chapterName) { |
|
|
|
this.curLink = `${chapterName}${row.name}`; |
|
|
|
this.curLink = `${chapterName}${row.name}`; |
|
|
|
this.player = null; |
|
|
|
this.player = null; |
|
|
|
this.playauth = ""; |
|
|
|
this.playauth = ""; |
|
|
@ -222,20 +257,20 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
closePlayer() { |
|
|
|
closePlayer () { |
|
|
|
this.playAuth = ""; |
|
|
|
this.playAuth = ""; |
|
|
|
this.player.pause(); |
|
|
|
this.player.pause(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeIframe() { |
|
|
|
closeIframe () { |
|
|
|
this.iframeSrc = ""; |
|
|
|
this.iframeSrc = ""; |
|
|
|
this.showMask = false; |
|
|
|
this.showMask = false; |
|
|
|
this.showMask1 = false; |
|
|
|
this.showMask1 = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
closePdf() { |
|
|
|
closePdf () { |
|
|
|
this.pdfSrc = ""; |
|
|
|
this.pdfSrc = ""; |
|
|
|
this.currentPage = 1; |
|
|
|
this.currentPage = 1; |
|
|
|
}, |
|
|
|
}, |
|
|
|
changePdfPage(val) { |
|
|
|
changePdfPage (val) { |
|
|
|
if (val === 0 && this.currentPage > 1) { |
|
|
|
if (val === 0 && this.currentPage > 1) { |
|
|
|
this.currentPage--; |
|
|
|
this.currentPage--; |
|
|
|
} |
|
|
|
} |
|
|
@ -243,7 +278,7 @@ export default { |
|
|
|
this.currentPage++; |
|
|
|
this.currentPage++; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
loadPdfHandler(e) { |
|
|
|
loadPdfHandler (e) { |
|
|
|
this.currentPage = 1; |
|
|
|
this.currentPage = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -252,7 +287,8 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
$height: 700px; |
|
|
|
$height: 700px; |
|
|
|
.video_wid, .cover { |
|
|
|
.video_wid, |
|
|
|
|
|
|
|
.cover { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
width: 76%; |
|
|
|
width: 76%; |
|
|
|
max-width: 1400px; |
|
|
|
max-width: 1400px; |
|
|
@ -274,7 +310,8 @@ $height: 700px; |
|
|
|
height: $height !important; |
|
|
|
height: $height !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.video_wid, .inner { |
|
|
|
.video_wid, |
|
|
|
|
|
|
|
.inner { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 100% !important; |
|
|
|
height: 100% !important; |
|
|
|
border: 0; |
|
|
|
border: 0; |
|
|
@ -378,8 +415,8 @@ $height: 700px; |
|
|
|
font-size: 14px; |
|
|
|
font-size: 14px; |
|
|
|
color: rgba(0, 0, 0, 0.65); |
|
|
|
color: rgba(0, 0, 0, 0.65); |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
&.active{ |
|
|
|
&.active { |
|
|
|
color: #9278FF; |
|
|
|
color: #9278ff; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -388,10 +425,10 @@ $height: 700px; |
|
|
|
|
|
|
|
|
|
|
|
.el-image-viewer__wrapper { |
|
|
|
.el-image-viewer__wrapper { |
|
|
|
transform: translateY(-10px); |
|
|
|
transform: translateY(-10px); |
|
|
|
transition: transform .5s; |
|
|
|
transition: transform 0.5s; |
|
|
|
|
|
|
|
|
|
|
|
&.active { |
|
|
|
&.active { |
|
|
|
transform: translateY(0) |
|
|
|
transform: translateY(0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|