Commit bda6380a by hanjixin

修改压缩后视频替换

parent 9cf21866
......@@ -149,7 +149,7 @@ export function getUserInfo() {
return get(`/user/get/info`)
}
export function checkVideoCompress(videoSrc = []) {
return get(`/user/get/info`, videoSrc)
return post(`/common/get/mts/state`, {url: videoSrc})
}
export function upload(file) {
// 上传文件
......
......@@ -31,7 +31,9 @@ const app = {
state.errorData = errorData
},
SET_VIDEO_SRC : (state, videoSrc) => {
state.videoSrc = state.videoSrc.push(videoSrc)
console.log(JSON.parse(JSON.stringify(state)),videoSrc)
state.videoSrc.push(videoSrc)
},
CLEAR_VIDEO_SRC : (state) => {
state.videoSrc = []
......
......@@ -302,7 +302,9 @@ export default {
this.VueCropperOption.fixedNumber = [9, 16];
}
},
created() {},
created() {
// this.$store.commit('SET_VIDEO_SRC', 'https://visual-clouds.bdideal.com/html/156394962402878b178ab4088494e9df36c49ec944add.ttf')
},
computed: {
errorData() {
return this.$store.state.app.errorData;
......@@ -369,9 +371,9 @@ export default {
}
// this.schemaData[this.dataKey].value = res.data.data;
if (this.itemKey) {
this.setSchemaListData(res.data.data);
this.setSchemaListData(res.data.data.replace('-mts', ''));
} else {
this.setSchemaData(res.data.data);
this.setSchemaData(res.data.data.replace('-mts', ''));
}
this.$toast.clear();
})
......@@ -509,7 +511,7 @@ export default {
document.querySelector(".edit-container").style.height = "100vh";
this.VueCropperOption.img = file.content;
} else {
this.uploadFile(file.file), String(file.file.type).indexOf("image") === -1;
this.uploadFile(file.file, String(file.file.type).indexOf("image") === -1);
}
},
checkboxChange(value) {
......
......@@ -302,7 +302,8 @@ import {
updateFilmInfo,
upload,
getTempalteDetail,
createFilm
createFilm,
checkVideoCompress
} from "@/api/api";
import axios from "axios";
import draggable from "vuedraggable";
......@@ -758,15 +759,22 @@ export default {
alert("数据为空");
return;
}
let filmData = JSON.stringify({
templateInfo: this.templateData.templateInfo,
pageList: this.templateData.listData
})
// 过滤替换
let videoSrc = this.$store.state.app.videoSrc
videoSrc.map(item => {
// 全部替换
filmData = filmData.replace(new RegExp(item.replace('-mts', ''),"gm") , item)
})
if (this.mode === "film" || window.sessionStorage.getItem("filmId")) {
const filmId =
this.$route.query.filmId || window.sessionStorage.getItem("filmId");
updateFilmInfo(
filmId,
JSON.stringify({
templateInfo: this.templateData.templateInfo,
pageList: this.templateData.listData
}),
filmData,
this.templateData.filmName,
this.templateData.filmDescribe
)
......@@ -783,10 +791,7 @@ export default {
} else {
createFilm({
templateId: this.$route.query.templateId,
filmData: JSON.stringify({
templateInfo: this.templateData.templateInfo,
pageList: this.templateData.listData
}),
filmData: filmData,
filmName: this.templateData.filmName,
filmDescribe: this.templateData.filmDescribe
})
......@@ -823,16 +828,28 @@ export default {
}
this.$toast.loading({
overlay: true,
message: "加载中...",
message: "保存中, 请等待!",
forbidClick: true,
duration: 0
});
checkVideoCompress(this.$store.state.app.videoSrc).then(() => {
this.publish();
}).catch(() => {
this.$toast.clear()
// this.$toast("请重新发布")
})
// this.$toast.loading({
// overlay: true,
// message: "加载中...",
// forbidClick: true,
// duration: 0
// });
// this.message({
// type: "getList"
// });
setTimeout(() => {
this.publish();
}, 500);
// setTimeout(() => {
// this.publish();
// }, 500);
},
uploadAfter(file) {
// console.log(file, upload);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment