|
@@ -7,7 +7,7 @@ import { useSocket } from '/@/hooks/userSocket';
|
|
import { useRoom, SceneItemType } from '/@/hooks/useRoom';
|
|
import { useRoom, SceneItemType } from '/@/hooks/useRoom';
|
|
import { useI18n } from '/@/hooks/useI18n';
|
|
import { useI18n } from '/@/hooks/useI18n';
|
|
import browser from '/@/utils/browser';
|
|
import browser from '/@/utils/browser';
|
|
-import { unref } from 'vue';
|
|
|
|
|
|
+import { computed, unref } from 'vue';
|
|
import { useAppStore } from '/@/store/modules/app';
|
|
import { useAppStore } from '/@/store/modules/app';
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
import duration from 'dayjs/plugin/duration';
|
|
import duration from 'dayjs/plugin/duration';
|
|
@@ -16,6 +16,10 @@ import { useMiniApp } from '/@/hooks/useMiniApp';
|
|
import { useSceneStore } from '/@/store/modules/scene';
|
|
import { useSceneStore } from '/@/store/modules/scene';
|
|
dayjs.extend(duration);
|
|
dayjs.extend(duration);
|
|
const { isUsingMiniApp } = useMiniApp();
|
|
const { isUsingMiniApp } = useMiniApp();
|
|
|
|
+
|
|
|
|
+const isOtherPlatform = computed(
|
|
|
|
+ () => browser.getURLParam('platform') && browser.getURLParam('platform').length > 0,
|
|
|
|
+);
|
|
// import { useRtcSdk } from '/@/hooks/useTRTC';
|
|
// import { useRtcSdk } from '/@/hooks/useTRTC';
|
|
interface ActionDataType {
|
|
interface ActionDataType {
|
|
type: string;
|
|
type: string;
|
|
@@ -405,27 +409,32 @@ const handleLeaderDismiss = () => {
|
|
if (isUsingMiniApp.value) {
|
|
if (isUsingMiniApp.value) {
|
|
closeRoomForWechat();
|
|
closeRoomForWechat();
|
|
} else {
|
|
} else {
|
|
- window.parent &&
|
|
|
|
- window.parent.postMessage(
|
|
|
|
- {
|
|
|
|
- type: 'exit',
|
|
|
|
- },
|
|
|
|
- '*',
|
|
|
|
- );
|
|
|
|
closeSocket();
|
|
closeSocket();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
);
|
|
);
|
|
- setTimeout(() => {
|
|
|
|
- if (isUsingMiniApp.value) {
|
|
|
|
- //@ts-ignore
|
|
|
|
- wx.miniProgram.switchTab({
|
|
|
|
- url: '/pages/index/index',
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- closeSocket();
|
|
|
|
- }
|
|
|
|
- }, 5000);
|
|
|
|
|
|
+ if (!isOtherPlatform.value) {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if (isUsingMiniApp.value) {
|
|
|
|
+ //@ts-ignore
|
|
|
|
+ wx.miniProgram.switchTab({
|
|
|
|
+ url: '/pages/index/index',
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ closeSocket();
|
|
|
|
+ }
|
|
|
|
+ }, 5000);
|
|
|
|
+ } else {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ window.parent &&
|
|
|
|
+ window.parent.postMessage(
|
|
|
|
+ {
|
|
|
|
+ type: 'redirect',
|
|
|
|
+ },
|
|
|
|
+ '*',
|
|
|
|
+ );
|
|
|
|
+ }, 2000);
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
//
|
|
//
|