fix: 移动打开分享链接时先关闭聊天窗口

This commit is contained in:
weifashi 2023-11-17 15:24:53 +08:00
parent bbb3cee927
commit b8ed8566ee

View File

@ -46,6 +46,7 @@
} }
</style> </style>
<script> <script>
import {mapState} from "vuex";
export default { export default {
data() { data() {
return { return {
@ -56,6 +57,9 @@ export default {
project: {}, project: {},
} }
}, },
computed: {
...mapState(['dialogId','windowPortrait']),
},
watch: { watch: {
'$route': { '$route': {
handler(route) { handler(route) {
@ -63,9 +67,15 @@ export default {
// app // app
if (!$A.Electron && !$A.isEEUiApp && navigator.userAgent.indexOf("MicroMessenger") === -1){ if (!$A.Electron && !$A.isEEUiApp && navigator.userAgent.indexOf("MicroMessenger") === -1){
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
window.location.href = "dootask://" + route.fullPath try {
window.location.href = "dootask://" + route.fullPath
} catch (error) {}
} }
} }
//
if (this.windowPortrait && this.dialogId > 0){
this.$store.dispatch("openDialog", 0)
}
// //
this.code = route.query ? route.query.code : ''; this.code = route.query ? route.query.code : '';
this.getData(); this.getData();