Browse Source

生成视频失败的处理

master
congzc 1 year ago
parent
commit
23d95ce164
3 changed files with 20 additions and 6 deletions
  1. +6
    -2
      src/mixins/leaveDialog.js
  2. +2
    -1
      src/views/model/editModel.vue
  3. +12
    -3
      src/views/model/videoFail.vue

+ 6
- 2
src/mixins/leaveDialog.js View File

@@ -29,12 +29,16 @@ export default {
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
console.log(to.path);
let that=this
if (this.videoStatus==3) {
next()
return
}
if (to.path=='/videoCreate') { if (to.path=='/videoCreate') {
next() next()
return return
} }
let that=this
setTimeout(() => { setTimeout(() => {
Dialog.confirm({ Dialog.confirm({
message: '需要保存草稿吗?', message: '需要保存草稿吗?',


+ 2
- 1
src/views/model/editModel.vue View File

@@ -361,6 +361,7 @@ export default {
scLoading1: true, scLoading1: true,
scLoading2: true, scLoading2: true,


videoStatus: null, //生成状态
soundTips: '', soundTips: '',


timer: null, timer: null,
@@ -752,7 +753,7 @@ export default {
try { try {
this.contentLoading = true; this.contentLoading = true;
const res = await getModelDetailById(id); const res = await getModelDetailById(id);
this.videoStatus = res.data.videoStatus;
// console.log(JSON.parse(res.data.personMouldSm)) // console.log(JSON.parse(res.data.personMouldSm))
this.materialList.BGI = JSON.parse(res.data.backgroundSm) || {}; this.materialList.BGI = JSON.parse(res.data.backgroundSm) || {};
// this.materialList.BGI.id = JSON.parse(res.data.backgroundSm).id + ''; // this.materialList.BGI.id = JSON.parse(res.data.backgroundSm).id + '';


+ 12
- 3
src/views/model/videoFail.vue View File

@@ -4,7 +4,8 @@
<HeadTop /> <HeadTop />
<div style="padding: 0 20px"> <div style="padding: 0 20px">
<h1 style="margin-top: 30px">视频生成失败</h1> <h1 style="margin-top: 30px">视频生成失败</h1>
<h1 style="margin-top: 30px">失败原因是:</h1>
<h1 style="margin-top: 30px; margin-bottom: 10px">失败原因是:</h1>
<div style="text-indent: 2em; font-size: 14px">{{ message }}</div>
<h1 style="margin-top: 20px"> <h1 style="margin-top: 20px">
<i <i
@click=" @click="
@@ -37,6 +38,8 @@ import { mapState, mapActions } from 'vuex';
// 工具 // 工具
import { scrollToID } from '../../utils'; import { scrollToID } from '../../utils';
import HeadTop from '../../components/common/head.vue'; import HeadTop from '../../components/common/head.vue';

import { doFindVideoById } from '@/api/generateVideo';
Vue.use(Toast); Vue.use(Toast);
export default { export default {
components: { components: {
@@ -44,7 +47,8 @@ export default {
}, },
data() { data() {
return { return {
inPage: false
inPage: false,
message: null
}; };
}, },
computed: { computed: {
@@ -56,7 +60,12 @@ export default {
methods: { methods: {
...mapActions(['setCharacters']) ...mapActions(['setCharacters'])
}, },
created() {},
async created() {
console.log(this.$route.query.id);
const res = await doFindVideoById(this.$route.query.id);
console.log(res);
this.message = res.data.videoMsg;
},
mounted() { mounted() {
this.inPage = true; this.inPage = true;
scrollToID('top'); scrollToID('top');


Loading…
Cancel
Save