|
@@ -1544,6 +1544,11 @@ export default {
|
|
|
|
|
|
this.courseCourseList();
|
|
|
},
|
|
|
+ beforeDestroy() {
|
|
|
+ try {
|
|
|
+ this.$msgbox.close();
|
|
|
+ } catch (err) {}
|
|
|
+ },
|
|
|
methods: {
|
|
|
async takeOk() {
|
|
|
this.loading = this.$loading({
|
|
@@ -2034,8 +2039,8 @@ export default {
|
|
|
let isStop = false;
|
|
|
let newRows = [];
|
|
|
for (let i = 0; i < rows.length; i++) {
|
|
|
- let moduleTrue = rows[i].moduleId == moduleId;
|
|
|
- let chapterTrue = rows[i].chapterId == chapterId;
|
|
|
+ let moduleTrue = rows[i].moduleId == section.moduleId;
|
|
|
+ let chapterTrue = rows[i].chapterId == section.chapterId;
|
|
|
if (moduleTrue && chapterTrue) {
|
|
|
isStop = true;
|
|
|
if (rows[i].sectionType != 2) {
|
|
@@ -2234,10 +2239,12 @@ export default {
|
|
|
let newRows = [];
|
|
|
for (let i = 0; i < rows.length; i++) {
|
|
|
let moduleTrue =
|
|
|
- rows[i].moduleId == option.menuId ||
|
|
|
- rows[i].moduleId == option.moduleId;
|
|
|
- let chapterTrue = rows[i].chapterId == option.chapterId;
|
|
|
- let sectionTrue = rows[i].sectionId == option.sectionId;
|
|
|
+ rows[i].moduleId == option.moduleId || rows[i].moduleId == 0;
|
|
|
+ let chapterTrue =
|
|
|
+ rows[i].chapterId == option.chapterId || rows[i].chapterId == 0;
|
|
|
+ let sectionTrue =
|
|
|
+ rows[i].sectionId == option.sectionId ||
|
|
|
+ rows[i].sectionId == option.menuId;
|
|
|
if (moduleTrue && chapterTrue && sectionTrue) {
|
|
|
break;
|
|
|
} else {
|
|
@@ -2425,6 +2432,24 @@ export default {
|
|
|
teaser_show: 0,
|
|
|
ts: res.data.ts,
|
|
|
sign: res.data.sign,
|
|
|
+ adMatter: [
|
|
|
+ {
|
|
|
+ // 广告参数详细配置
|
|
|
+ location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
|
|
|
+ adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
|
|
|
+ matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
|
|
|
+ timesize: 5, //广告时长,单位:秒
|
|
|
+ skipenabled: false, //是否显示跳过按钮
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 广告参数详细配置
|
|
|
+ location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
|
|
|
+ adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
|
|
|
+ matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
|
|
|
+ timesize: 5, //广告时长,单位:秒
|
|
|
+ skipenabled: false, //是否显示跳过按钮
|
|
|
+ },
|
|
|
+ ],
|
|
|
playsafe: function (vid, next) {
|
|
|
next();
|
|
|
},
|
|
@@ -2522,7 +2547,8 @@ export default {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
if (
|
|
|
- window.navigator.mediaDevices.getUserMedia ||
|
|
|
+ (window.navigator.mediaDevices &&
|
|
|
+ window.navigator.mediaDevices.getUserMedia) ||
|
|
|
window.navigator.getUserMedia ||
|
|
|
window.navigator.webkitGetUserMedia ||
|
|
|
window.navigator.mozGetUserMedia
|
|
@@ -2540,7 +2566,7 @@ export default {
|
|
|
this.photographError
|
|
|
);
|
|
|
} else {
|
|
|
- alert("不支持访问用户媒体");
|
|
|
+ this.photographError();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -2594,7 +2620,7 @@ export default {
|
|
|
this.photoList.push(1);
|
|
|
} else if (photoNum == 3) {
|
|
|
//拍3张
|
|
|
- this.photoList.push(1); //开头拍一张
|
|
|
+ this.photoList.push(0); //开头拍一张
|
|
|
let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
|
|
|
let centerMinTime = centerTime - 300; //前后5分钟
|
|
|
let centerMaxTime = centerTime + 300;
|
|
@@ -3192,38 +3218,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
download(url, fileName) {
|
|
|
- let xhr = new XMLHttpRequest();
|
|
|
- xhr.open("get", url, true);
|
|
|
- xhr.setRequestHeader("Content-Type", `application/pdf`);
|
|
|
- xhr.responseType = "blob";
|
|
|
- let that = this;
|
|
|
- xhr.onload = function () {
|
|
|
- if (this.status == 200) {
|
|
|
- //接受二进制文件流
|
|
|
- var blob = this.response;
|
|
|
- that.downloadExportFile(blob, fileName);
|
|
|
- }
|
|
|
- };
|
|
|
- xhr.send();
|
|
|
- },
|
|
|
- downloadExportFile(blob, tagFileName) {
|
|
|
- let downloadElement = document.createElement("a");
|
|
|
- let href = blob;
|
|
|
- if (typeof blob == "string") {
|
|
|
- downloadElement.target = "_blank";
|
|
|
- } else {
|
|
|
- href = window.URL.createObjectURL(blob); //创建下载的链接
|
|
|
- }
|
|
|
- downloadElement.href = href;
|
|
|
- downloadElement.download = tagFileName;
|
|
|
- //下载后文件名
|
|
|
- document.body.appendChild(downloadElement);
|
|
|
- downloadElement.click(); //点击下载
|
|
|
- document.body.removeChild(downloadElement); //下载完成移除元素
|
|
|
- if (typeof blob != "string") {
|
|
|
- window.URL.revokeObjectURL(href); //释放掉blob对象
|
|
|
- }
|
|
|
+ var a = document.createElement("a");
|
|
|
+ var event = new MouseEvent("click");
|
|
|
+ a.download = fileName;
|
|
|
+ a.href = url;
|
|
|
+ a.dispatchEvent(event);
|
|
|
},
|
|
|
+
|
|
|
previvew(url) {
|
|
|
window.open(url, "_blank");
|
|
|
},
|