@@ -3,10 +3,18 @@ | |||||
<head> | <head> | ||||
<meta charset="utf-8"> | <meta charset="utf-8"> | ||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||||
<!-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> --> | |||||
<!-- <meta http-equiv="pragram" content="no-cache"> | |||||
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"> --> | |||||
<meta http-equiv="pragram" content="no-cache"> | <meta http-equiv="pragram" content="no-cache"> | ||||
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"> | <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"> | ||||
<meta http-equiv="expires" content="0"> | |||||
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> --> | <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> --> | ||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | ||||
@@ -66,7 +66,9 @@ export default { | |||||
// this.$router.push('/login'); | // this.$router.push('/login'); | ||||
this.$router.push('/myPage'); | this.$router.push('/myPage'); | ||||
if (this.$route.name == 'myPage') { | if (this.$route.name == 'myPage') { | ||||
window.location.reload(); | |||||
await this.$router.go(0); | |||||
// window.location.reload(); | |||||
// this.$forceUpdate(); | |||||
} | } | ||||
localStorage.removeItem('AccessToken'); | localStorage.removeItem('AccessToken'); | ||||
} catch (error) { | } catch (error) { | ||||
@@ -0,0 +1,49 @@ | |||||
import { Dialog } from 'vant'; | |||||
export default { | |||||
data() { | |||||
return { | |||||
currentUrl: "" | |||||
} | |||||
}, | |||||
create() { | |||||
console.log('初始化了'); | |||||
}, | |||||
mounted() { | |||||
// this.currentUrl = window.location.href | |||||
// 监听浏览器返回 | |||||
window.addEventListener("popstate", this.beforeUnloadHandler, false) | |||||
}, | |||||
destroyed() { | |||||
window.removeEventListener("popstate", this.beforeUnloadHandler, false) | |||||
}, | |||||
methods: { | |||||
beforeUnloadHandler(event) { | |||||
event.returnValue = "离开此页面?" // 此处返回任意字符串,不返回null即可,不能修改默认提示内容 | |||||
// console.log('beforeUnloadHandler'); | |||||
event.preventDefault(); | |||||
event.returnValue = ''; | |||||
const message = '确定离开页面吗?' | |||||
event.returnValue = message | |||||
return message | |||||
}, | |||||
}, | |||||
beforeRouteLeave(to, from, next) { | |||||
let that=this | |||||
setTimeout(() => { | |||||
Dialog.confirm({ | |||||
message: '需要保存草稿吗?', | |||||
cancelButtonText: '狠心离去', | |||||
confirmButtonText:'保存' | |||||
}) | |||||
.then(async () => { | |||||
await that.submit(2); // 保存草稿 | |||||
next() | |||||
}) | |||||
.catch(() => { | |||||
next() | |||||
}) | |||||
},200) | |||||
} | |||||
} |
@@ -45,7 +45,7 @@ request.interceptors.response.use( | |||||
} else if (code != 200) { | } else if (code != 200) { | ||||
if (code == 1053) { | if (code == 1053) { | ||||
router.push("/login"); | router.push("/login"); | ||||
Toast.fail("请您先登录!"); | |||||
// Toast.fail("请您先登录!"); | |||||
return | return | ||||
} else if (code == 500) { | } else if (code == 500) { | ||||
@@ -458,6 +458,10 @@ export default { | |||||
}, | }, | ||||
// 提交邀请码 | // 提交邀请码 | ||||
submitInviteCode() { | submitInviteCode() { | ||||
if (!this.form.inviteCode) { | |||||
Toast.fail('邀请码不能为空'); | |||||
return; | |||||
} | |||||
const data = { | const data = { | ||||
inviteCode: this.form.inviteCode | inviteCode: this.form.inviteCode | ||||
}; | }; | ||||
@@ -322,7 +322,7 @@ import { mapState, mapActions } from 'vuex'; | |||||
import HeadTop from './../../components/common/head.vue'; | import HeadTop from './../../components/common/head.vue'; | ||||
import CutImg from '../../components/CutImg.vue'; | import CutImg from '../../components/CutImg.vue'; | ||||
import EditPosition from '../../components/editPosition.vue'; | import EditPosition from '../../components/editPosition.vue'; | ||||
import leaveDialog from '../../mixins/leaveDialog'; | |||||
// 工具 | // 工具 | ||||
import { scrollToID } from '../../utils'; | import { scrollToID } from '../../utils'; | ||||
// 语言检测插件 | // 语言检测插件 | ||||
@@ -342,6 +342,7 @@ import { getModelDetailById } from '../../api/getPaper.js'; | |||||
Vue.use(-Toast); | Vue.use(-Toast); | ||||
export default { | export default { | ||||
mixins: [leaveDialog], | |||||
components: { | components: { | ||||
HeadTop, | HeadTop, | ||||
CutImg, | CutImg, | ||||
@@ -1038,6 +1039,7 @@ export default { | |||||
// await this.submit(2); // 保存草稿 | // await this.submit(2); // 保存草稿 | ||||
// console.log('保存了'); | // console.log('保存了'); | ||||
} | } | ||||
// 使用路由守卫判断是否离开当前页面 | |||||
}; | }; | ||||
</script> | </script> | ||||
@@ -2,6 +2,9 @@ | |||||
<div :class="inPage ? 'page active' : 'page'"> | <div :class="inPage ? 'page active' : 'page'"> | ||||
<div id="top"></div> | <div id="top"></div> | ||||
<HeadTop /> | <HeadTop /> | ||||
<div style="display: flex; justify-content: space-around"> | |||||
<img style="width: 60%; margin-top: 20px" src="../../assets/img/logoh.png" alt="" /> | |||||
</div> | |||||
<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">请耐心等待</h1> | ||||
@@ -34,7 +37,7 @@ export default { | |||||
data() { | data() { | ||||
return { | return { | ||||
inPage: false, | inPage: false, | ||||
countdown: 10, | |||||
countdown: 10000, | |||||
timer: null | timer: null | ||||
}; | }; | ||||
}, | }, | ||||
@@ -16,7 +16,7 @@ | |||||
<span v-show="listActive == 1" class="floatRight" :class="videoType == 1 ? 'wordColor' : ''" @click="getNewList(1)">只看竖屏</span> | <span v-show="listActive == 1" class="floatRight" :class="videoType == 1 ? 'wordColor' : ''" @click="getNewList(1)">只看竖屏</span> | ||||
<span v-show="listActive == 1" class="floatRight" :class="videoType == 2 ? 'wordColor' : ''" @click="getNewList(2)">只看横屏</span> | <span v-show="listActive == 1" class="floatRight" :class="videoType == 2 ? 'wordColor' : ''" @click="getNewList(2)">只看横屏</span> | ||||
<span v-show="listActive == 1" class="floatRight" @click="draftChange(2)">草稿箱</span> | <span v-show="listActive == 1" class="floatRight" @click="draftChange(2)">草稿箱</span> | ||||
<span @click="draftChange(1)" v-show="listActive == 2" class="floatRight">已完成</span> | |||||
<span @click="draftChange(1)" v-show="listActive == 2" class="floatRight">返回视频列表</span> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -317,7 +317,7 @@ export default { | |||||
async loadVideoList(pageNum, pageSize, videoType) { | async loadVideoList(pageNum, pageSize, videoType) { | ||||
if (!this.hasToken) { | if (!this.hasToken) { | ||||
// this.$router.push('/login'); | // this.$router.push('/login'); | ||||
Toast.fail('请您先登录!'); | |||||
// Toast.fail('请您先登录!'); | |||||
return; | return; | ||||
} | } | ||||
try { | try { | ||||