gemercheung il y a 2 ans
Parent
commit
854d8a0f65
2 fichiers modifiés avec 18 ajouts et 4 suppressions
  1. 15 2
      src/components/chatRoom/controls/actions.ts
  2. 3 2
      src/components/custom/panel.vue

+ 15 - 2
src/components/chatRoom/controls/actions.ts

@@ -249,9 +249,22 @@ const handleUserLeave = (user?: UserInfoType, members?: UserInfoType[]) => {
 //被动处理用离开 全员解散
 const handleLeaderDismiss = () => {
   const { closeSocket } = useSocket();
+  const rtcStore = useRtcStore();
   const { t } = useI18n();
-  Dialog.toast({ content: t('action.hosterDismissRoom') });
-  closeSocket();
+  // Dialog.toast({ content: t('action.hosterDismissRoom') });
+  rtcStore.showBaseDialog(
+    {
+      title: t('base.tips'),
+      desc: t('action.hosterDismissRoom'),
+      okTxt: t('base.confirm'),
+      closeTxt: t('base.cancel'),
+      isSingle: true,
+    },
+    () => {},
+  );
+  setTimeout(() => {
+    closeSocket();
+  }, 5000);
 };
 
 //

+ 3 - 2
src/components/custom/panel.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="panel" :class="{ show }">
+  <div class="panel" :class="{ show }" v-if="panelShow">
     <span class="icon" @click="handlePlayTours" v-if="hasTours">
       <Icon type="play" />
     </span>
@@ -18,7 +18,7 @@
   //import { useMusicPlayer } from "@/utils/sound";
   // import { changeScene } from "@/store/room";
   import Icon from '/@/components/basic/icon/index.vue';
-  import { onMounted, ref, unref } from 'vue';
+  import { computed, onMounted, ref, unref } from 'vue';
   import { useRoom } from '/@/hooks/useRoom';
   import { useTourPlayer } from '/@/hooks/userTourPlayer';
 
@@ -32,6 +32,7 @@
 
   const showScenes = ref(false);
   const { hasTours } = useTourPlayer();
+  const panelShow = computed(() => unref(hasTours) || unref(sceneList).length > 1);
 
   function handlePlayTours() {
     const { player, playing } = useTourPlayer();