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