feat: 邀请加入项目的链接客户端直接打开

This commit is contained in:
weifashi 2023-11-17 15:00:15 +08:00
parent 2737fa4697
commit bbb3cee927
8 changed files with 75 additions and 3 deletions

BIN
public/images/guide.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -21,6 +21,9 @@
<!--Hidden IFrame--> <!--Hidden IFrame-->
<iframe v-for="item in iframes" :key="item.key" v-if="item.url" v-show="false" :src="item.url"></iframe> <iframe v-for="item in iframes" :key="item.key" v-if="item.url" v-show="false" :src="item.url"></iframe>
<!--引导页-->
<GuidePage/>
</div> </div>
</template> </template>
@ -38,12 +41,13 @@ import FloatSpinner from "./components/FloatSpinner";
import RightBottom from "./components/RightBottom"; import RightBottom from "./components/RightBottom";
import PreviewImageState from "./components/PreviewImage/state"; import PreviewImageState from "./components/PreviewImage/state";
import NetworkException from "./components/NetworkException"; import NetworkException from "./components/NetworkException";
import GuidePage from "./components/GuidePage";
import TaskOperation from "./pages/manage/components/TaskOperation"; import TaskOperation from "./pages/manage/components/TaskOperation";
import {mapState} from "vuex"; import {mapState} from "vuex";
import {languageType} from "./language"; import {languageType} from "./language";
export default { export default {
components: {TaskOperation, NetworkException, PreviewImageState, RightBottom, FloatSpinner}, components: {TaskOperation, NetworkException, PreviewImageState, RightBottom, FloatSpinner, GuidePage},
data() { data() {
return { return {
@ -387,6 +391,10 @@ export default {
window.__onNotificationPermissionStatus = (ret) => { window.__onNotificationPermissionStatus = (ret) => {
this.$store.state.appNotificationPermission = $A.runNum(ret) == 1; this.$store.state.appNotificationPermission = $A.runNum(ret) == 1;
} }
//
window.__handleLink = (path) => {
this.goForward({ path: (path || '').indexOf('/') !==0 ? "/" + path : path });
}
}, },
otherEvents() { otherEvents() {

View File

@ -0,0 +1,41 @@
<template>
<div v-if="show" class="common-guide">
<img :src="src" width="100%" />
<div>
<Button type="default" @click="show = false" size="large" long >{{ $L('忍心拒绝') }}</Button>
</div>
</div>
</template>
<script>
export default {
name: 'GuidePage',
data() {
return {
show: false,
src: '',
}
},
mounted() {
this.src = $.apiUrl('../images/guide.png');
},
watch: {
'$route': {
handler(route) {
this.show = false;
if (navigator.userAgent.indexOf("MicroMessenger") === -1) {
return;
}
//
if (route.name == 'manage-project-invite') {
this.show = true;
}
},
immediate: true
},
}
};
</script>

View File

@ -1457,6 +1457,7 @@ export default {
}, },
/********************文件打包下载部分************************/ /********************文件打包下载部分************************/
packPercentageParse(val) { packPercentageParse(val) {
return parseInt(val, 10); return parseInt(val, 10);
}, },
@ -1479,13 +1480,12 @@ export default {
file.percentage = Math.max(1, pack.progress); file.percentage = Math.max(1, pack.progress);
if (file.status != 'finished' && file.percentage >= 100) { if (file.status != 'finished' && file.percentage >= 100) {
file.status = 'finished'; file.status = 'finished';
//
this.downloadPackFile(file.name); this.downloadPackFile(file.name);
} }
}) })
}, },
async downloadPackFile(filePackName) { downloadPackFile(filePackName) {
const downloadUrl = $A.apiUrl(`file/download/confirm?name=${filePackName}&token=${this.userToken}`); const downloadUrl = $A.apiUrl(`file/download/confirm?name=${filePackName}&token=${this.userToken}`);
if (!$A.Electron && !$A.isEEUiApp) { if (!$A.Electron && !$A.isEEUiApp) {
const link = document.createElement('a'); const link = document.createElement('a');

View File

@ -60,6 +60,13 @@ export default {
'$route': { '$route': {
handler(route) { handler(route) {
if(route.name == 'manage-project-invite'){ if(route.name == 'manage-project-invite'){
// app
if (!$A.Electron && !$A.isEEUiApp && navigator.userAgent.indexOf("MicroMessenger") === -1){
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
window.location.href = "dootask://" + route.fullPath
}
}
//
this.code = route.query ? route.query.code : ''; this.code = route.query ? route.query.code : '';
this.getData(); this.getData();
} }

View File

@ -15,3 +15,5 @@
@import "report"; @import "report";
@import "resize-line"; @import "resize-line";
@import "right-bottom"; @import "right-bottom";
@import "guide-page";

View File

@ -0,0 +1,14 @@
.common-guide {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999999;
background-color: #000000de;
padding: 5px 10px;
>div {
text-align: center;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB