diff --git a/package.json b/package.json index fc1a606f7..852892b6b 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "vue-i18n": "^8.12.0", "vue-quill-editor": "^3.0.6", "vue-router": "^3.1.6", + "vue-video-player": "^5.0.1", "vuedraggable": "^2.24.3", "vuex": "^3.1.0", "wangeditor": "^4.6.17", diff --git a/src/api/contest.js b/src/api/contest.js index 78424957e..e70ff7fcd 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -332,6 +332,31 @@ export function publishContextSence(data) { }); } +/** 场景视频保存 + * @param {Object} data + * @param {String} data.name 场景名称 + * @param {String} data.type Video=视频 + * @param {Object} data.scene 大赛场景 + * @param {String} data.scene.url 地址 + * @param {String} data.scene.fileName 文件名 + */ +export function saveSceneVideo(data) { + return request({ + url: `/api/exercise/race/scene/custom/edit`, + method: 'post', + data + }); +} + +/** 场景视频编辑 */ +export function editSceneVideo(sceneId, data) { + return request({ + url: `/api/exercise/race/scene/custom/${sceneId}/edit`, + method: 'post', + data + }); +} + /** 竞赛试卷测试模块任务集合 * @param {String} paperId 试卷id * @param {String} moduleId 模块id diff --git a/src/main.js b/src/main.js index e7ada36b6..873798e43 100644 --- a/src/main.js +++ b/src/main.js @@ -28,6 +28,11 @@ import '@/directive/verticalDrag/index.js'; import '@/directive/waves/index.js'; import messages from '@/i18n/index'; +import VideoPlayer from 'vue-video-player/src'; +import 'vue-video-player/src/custom-theme.css'; +import 'video.js/dist/video-js.css'; + +Vue.use(VideoPlayer); Vue.use(ElementUI); Vue.use(VueI18n); Vue.config.devtools = true; // 开发环境显示vue控制台 diff --git a/src/views/contest/PlayVideo.vue b/src/views/contest/PlayVideo.vue new file mode 100644 index 000000000..0909cb60a --- /dev/null +++ b/src/views/contest/PlayVideo.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/src/views/contest/contestDetail.vue b/src/views/contest/contestDetail.vue index 5e3474b98..b353db0cf 100644 --- a/src/views/contest/contestDetail.vue +++ b/src/views/contest/contestDetail.vue @@ -44,12 +44,14 @@
评分表 - 开始任务 + 开始任务 + 播放视频 下一任务
+ @@ -58,10 +60,12 @@ import { getTaskTree, getContextSenceDetail} from '@/api/contest'; import { createSimulationNoFunction } from '@/api/simulation'; import { getPublishMapInfo } from '@/api/jmap/map'; import ScoreRule from './scoreRule'; +import PlayVideo from './PlayVideo'; export default { name: 'ContestDetail', components: { - ScoreRule + ScoreRule, + PlayVideo }, data() { return { @@ -145,6 +149,9 @@ export default { this.nowKey++; this.nowData = this.taskList[this.nowKey]; }, + playSceneVideo() { + this.$refs.playVideo.doShow(this.nowData.sceneId); + }, startTask() { this.loading = true; try { diff --git a/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue b/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue index 61e26e7d3..ae4e2ba21 100644 --- a/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue +++ b/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue @@ -1,13 +1,18 @@ + +