From dd5b3579ec78bc331e733ed0548912cf3db0f6c3 Mon Sep 17 00:00:00 2001 From: 18571350067 Date: Sat, 25 Dec 2021 10:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E4=BB=B6=E9=A2=84=E8=A7=88=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=9D=9E=E8=A7=86=E9=A2=91=E8=AF=BE=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/course/CoursewareAddOrUpdate.vue | 132 ++++++++++++++++----- src/views/course/CoursewareList.vue | 18 +-- src/views/course/CoursewarePreview.vue | 81 +++++++++++-- src/views/course/question/QuestionAdd.vue | 2 - 4 files changed, 185 insertions(+), 48 deletions(-) diff --git a/src/views/course/CoursewareAddOrUpdate.vue b/src/views/course/CoursewareAddOrUpdate.vue index 9b9105b..4397100 100644 --- a/src/views/course/CoursewareAddOrUpdate.vue +++ b/src/views/course/CoursewareAddOrUpdate.vue @@ -8,7 +8,7 @@ - +
@@ -64,7 +64,7 @@
- +
@@ -106,7 +106,7 @@ -->
课件大小:  -     MB +     MB

@@ -122,7 +122,7 @@ - +
@@ -174,7 +174,7 @@
- +
@@ -216,7 +216,7 @@ -->
课件大小:  - +
连接地址:  @@ -232,7 +232,7 @@ \ No newline at end of file diff --git a/src/views/course/CoursewarePreview.vue b/src/views/course/CoursewarePreview.vue index 41e5637..b078feb 100644 --- a/src/views/course/CoursewarePreview.vue +++ b/src/views/course/CoursewarePreview.vue @@ -5,13 +5,25 @@ 返回 -
+
-
+
+ +

课件名称:《{{coursewareName}}》

+
+ +
+ + 课件下载 + +
+
+
+
@@ -19,7 +31,8 @@
-

{{item.name}}

+

+ {{item.name}}

@@ -84,12 +97,14 @@ export default { queryParam: { coursewareId: this.$route.query.coursewareId }, courseware: [], //课件详情 question: [], //课中检测 + coursewareName: '', + path: '', //课件下载路径 value: 'a', playerOptions: { // width: 800, height: '650', fluid: false, - autoplay: false,//进入时是否开始自动播放 + autoplay: false, //进入时是否开始自动播放 muted: true, language: 'en', playbackRates: [0.7, 1.0, 1.5, 2.0], //设置倍速 @@ -109,13 +124,20 @@ export default { coursewareDeatil(Object.assign(parameter, this.queryParam)).then((res) => { //课件内容 this.courseware = res.data - if (this.courseware.videoList.length > 0) this.play(this.courseware.videoList[0].path, 0) - console.log("------------",this.courseware); + if (this.courseware.videoList.length > 0) { + //课件视频展现 + if (this.courseware.type == '1') this.play(this.courseware.videoList[0].path, 0) + + //文本下载 + if (this.courseware.type == '2') { + this.coursewareName = this.courseware.videoList[0].name + this.path = this.courseware.videoList[0].path + } + } //课中检测必选题 testing(Object.assign(parameter, this.queryParam)).then((res1) => { this.question = res1.data - console.log('question-------', this.question) }) }) }, @@ -125,13 +147,23 @@ export default { this.$router.push({ path: '/course/CoursewareList', query: { id: this.$route.query.courseId } }) }, - //选择播放的文件 - play(path, index) { + //选择播放的文件/下载的文件 + play(path, index, name) { this.isactive = index - // 加载视频 - this.playerOptions.sources = [] - this.playerOptions.sources.push({ type: 'video/mp4', src: path }) + if (this.courseware.type == '2') { + this.coursewareName = name + this.path = path + } else { + // 加载视频 + this.playerOptions.sources = [] + this.playerOptions.sources.push({ type: 'video/mp4', src: path }) + } + }, + + //下载课件 + download() { + window.location.href = this.path //文件下载 }, //控制显示视频还是课中检测 @@ -194,4 +226,29 @@ export default { margin-left: 70px; margin-top: -20px; } +.text { + font-size: 15px; + white-space: pre-wrap; + word-break: normal; + word-wrap: break-word; + text-align: center; + margin-left: 20px; +} +.card { + width: 300px; + height: 200px; + position: relative; + width: 350px; + height: 160px; +} +.down { + position: absolute; + top: 50%; + left: 50%; + z-index: 2; + padding: 6px 10px; + border-radius: 3px; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} diff --git a/src/views/course/question/QuestionAdd.vue b/src/views/course/question/QuestionAdd.vue index d9e1128..b01c725 100644 --- a/src/views/course/question/QuestionAdd.vue +++ b/src/views/course/question/QuestionAdd.vue @@ -194,9 +194,7 @@ export default { this.radio.disabled = false } else if (this.tabKey == '2') { this.multiselect = res.data - console.log('c---------------s------------', this.multiselect) if (this.multiselect.rightAnswers) this.checkedValues = this.multiselect.rightAnswers.split('') - console.log('arr', this.checkedValues) this.multiselect.disabled = false } else if (this.tabKey == '3') { this.estimate = res.data