gemercheung hace 2 años
padre
commit
58743e8f78

+ 1 - 0
.env

@@ -19,3 +19,4 @@ VITE_APP_APIS_URL=https://testeur.4dkankan.com/
 VITE_USE_HTTPS=1
 VITE_PUBLIC_DIR='/livestream/'
 VITE_ROOM_MEMBER=3
+VITE_SHOW_CONSOLE=1

+ 1 - 0
.env.development

@@ -17,4 +17,5 @@ VITE_APP_APIS_URL=https://test.4dkankan.com/
 
 VITE_USE_HTTPS=1
 VITE_PUBLIC_DIR='/'
+VITE_SHOW_CONSOLE=1
 

+ 3 - 0
.env.eur

@@ -6,6 +6,8 @@ VITE_APP_CDN_URL=https://4dkk.4dage.com/v4/www/
 VITE_APP_SDK_DIR=https://testeurs3.4dkankan.com/v4/www/sdk
 # socket地址
 VITE_APP_SOCKET_URL=wss://ws.4dkankan.com
+# VITE_APP_SOCKET_URL=wss://testeurws.4dkankan.com
+# VITE_APP_SOCKET_URL=ws://127.0.01:6666
 # 静态资源目录
 VITE_APP_STATIC_DIR=viewer
 
@@ -19,3 +21,4 @@ VITE_APP_APIS_URL=https://testeur.4dkankan.com/
 VITE_USE_HTTPS=1
 VITE_PUBLIC_DIR='/livestream/'
 VITE_ROOM_MEMBER=3
+VITE_SHOW_CONSOLE=1

+ 1 - 0
.env.production

@@ -19,3 +19,4 @@ VITE_APP_APIS_URL=https://testeur.4dkankan.com/
 VITE_USE_HTTPS=1
 VITE_PUBLIC_DIR='/livestream/'
 VITE_ROOM_MEMBER=3
+VITE_SHOW_CONSOLE=1

+ 2 - 2
index.html

@@ -25,8 +25,8 @@
   <body>
     <div id="app"></div>
     <script type="module" src="/src/main.ts"></script>
-    <script src="<{VITE_APP_SDK_DIR}>/kankan-sdk-deps.js?v=4.3.3-alpha.8"></script>
-    <script src="<{VITE_APP_SDK_DIR}>/kankan-sdk.js?v=4.3.3-alpha.8"></script>
+    <script src="<{VITE_APP_SDK_DIR}>/kankan-sdk-deps.js?v=4.4.2-alpha.0"></script>
+    <script src="<{VITE_APP_SDK_DIR}>/kankan-sdk.js?v=4.4.2-alpha.0"></script>
     <script src="<{BASE_URL}><{VITE_APP_STATIC_DIR}>/static/lib/flv.min.js"></script>
     <script src="<{BASE_URL}><{VITE_APP_STATIC_DIR}>/static/lib/vconsole.js"></script>
     <script src="<{BASE_URL}><{VITE_APP_STATIC_DIR}>/static/lib/swiper/swiper-bundle.min.js"></script>

+ 1 - 1
src/App.vue

@@ -270,7 +270,7 @@
   </div>
   <LoadingLogo :thumb="true" />
   <!-- 引导页 -->
-  <Title v-if="isLoaded" />
+  <Title v-if="isLoaded && !!unref(refMiniMap)" />
   <Guideline />
   <div class="ui-view-layout" :class="{ show: show }">
     <div class="scene" ref="scene$"></div>

+ 21 - 2
src/components/basic/floorplan.vue

@@ -7,7 +7,7 @@
     class="tab-layer"
   >
     <div class="tabs" v-if="show">
-      <span :class="{ active: isFloorplan }" ref="floorplan_ref" @click="changeMode('floorplan')">
+      <span :class="{ active: isFloorplan }" ref="floorplan_ref" @click="handle2DMode">
         <i
           :class="{
             'icon-show_plane_selected': isFloorplan,
@@ -23,7 +23,7 @@
         ></ui-icon> -->
         {{ t('base.floorPlan') }}
       </span>
-      <span :class="{ active: isDollhouse }" ref="dollhouse_ref" @click="changeMode('dollhouse')">
+      <span :class="{ active: isDollhouse }" ref="dollhouse_ref" @click="handle3DMode">
         <i
           :class="{
             'icon-show_3d_selected': isDollhouse,
@@ -45,6 +45,8 @@
 <script lang="ts">
   import { computed, defineComponent, ref, watchEffect, watch, unref } from 'vue';
   import { useI18n } from '/@/hooks/useI18n';
+  import { useAppStore } from '/@/store/modules/app';
+  import { useRtcStore } from '/@/store/modules/rtc';
   import { propTypes } from '/@/utils/propTypes';
 
   export default defineComponent({
@@ -64,6 +66,11 @@
       const dollhouse_ref = ref<Nullable<HTMLElement>>(null);
       const isFloorplan = computed(() => props.mode === 'floorplan');
       const isDollhouse = computed(() => props.mode === 'dollhouse');
+      const rtcStore = useRtcStore();
+      const appStore = useAppStore();
+      const isLeader = computed(() => rtcStore.isLeader);
+      const isTourMode = computed(() => appStore.isTourMode);
+
       watchEffect(() => {
         console.log('floorplan', isFloorplan);
       });
@@ -100,8 +107,20 @@
       const changeMode = (eventName: string) => {
         emit('changeMode', eventName);
       };
+      const handle2DMode = () => {
+        if (unref(isLeader) || unref(isTourMode)) {
+          changeMode('floorplan');
+        }
+      };
+      const handle3DMode = () => {
+        if (unref(isLeader) || unref(isTourMode)) {
+          changeMode('dollhouse');
+        }
+      };
 
       return {
+        handle2DMode,
+        handle3DMode,
         t,
         changeMode,
         refMiniMap,

+ 5 - 5
src/components/basic/miniMap.vue

@@ -16,6 +16,7 @@
 <script lang="ts">
   import { computed, defineComponent, onMounted, ref, unref, watch } from 'vue';
   import { useI18n } from '/@/hooks/useI18n';
+  import { useAppStore } from '/@/store/modules/app';
   import { useRtcStore } from '/@/store/modules/rtc';
   import { propTypes } from '/@/utils/propTypes';
   const refMiniMap = ref<Nullable<string>>(null);
@@ -35,7 +36,9 @@
     emits: ['changeMode', 'toggleMap'],
     setup(props, { emit }) {
       const rtcStore = useRtcStore();
+      const appStore = useAppStore();
       const isLeader = computed(() => rtcStore.isLeader);
+      const isTourMode = computed(() => appStore.isTourMode);
 
       const { t } = useI18n();
       onMounted(() => {
@@ -58,8 +61,7 @@
       });
 
       const toggleMap = () => {
-        debugger;
-        if (unref(isLeader)) {
+        if (unref(isLeader) || unref(isTourMode)) {
           isCollapse.value = !isCollapse.value;
           emit('toggleMap', isCollapse.value);
           let $minmap = document.querySelector('[xui_min_map]');
@@ -73,9 +75,7 @@
         }
       };
       const changeMode = () => {
-        console.log('unref(isLeader)', unref(isLeader));
-        debugger;
-        if (unref(isLeader)) {
+        if (unref(isLeader) || unref(isTourMode)) {
           emit('changeMode', 'dollhouse');
         }
       };

+ 10 - 5
src/components/basic/title.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="header" @touchmove.prevent v-if="!isPanoramaMode">
+  <div class="header" @touchmove.prevent v-if="!isPanoramaMode || isTourMode">
     <div class="left" :class="{ show: !isTourMode }">
       <div v-show="!isPanoramaMode" class="back-pano" @click="onChangeMode">
         <i
@@ -29,9 +29,9 @@
         </span>
       </div>
     </div>
-    <div class="right" v-show="player.showWidgets" @click="onShowMore">
+    <!-- <div class="right" v-show="player.showWidgets" @click="onShowMore">
       <i class="iconfont icon-show_more_share"></i>
-    </div>
+    </div> -->
     <transition
       appear
       name="custom-classes-transition"
@@ -62,10 +62,11 @@
   // import { useStore } from "vuex";
   // import { Dialog } from "@/global_components/";
   // import { useMusicPlayer } from "@/utils/sound";
-  import { onMounted, watch, computed, ref, nextTick } from 'vue';
+  import { onMounted, watch, computed, ref, nextTick, unref } from 'vue';
   import shareImage from '/@/assets/share.png';
   import { useAppStore } from '/@/store/modules/app';
   import { useSceneStore } from '/@/store/modules/scene';
+  import { useRtcStore } from '/@/store/modules/rtc';
   // import { useApp, getApp } from "@/app";
   const appStore = useAppStore();
   const sceneStore = useSceneStore();
@@ -77,6 +78,8 @@
   }
 
   const isTourMode = computed(() => appStore.isTourMode);
+  const rtcStore = useRtcStore();
+  const isLeader = computed(() => rtcStore.isLeader);
 
   // const musicPlayer = useMusicPlayer()
   // const store = useStore();
@@ -214,7 +217,9 @@
   // };
   const onChangeMode = () => {
     //   store.commit("setMode", "panorama");
-    appStore.setMode('panorama');
+    if (unref(isLeader) || unref(isTourMode)) {
+      appStore.setMode('panorama');
+    }
   };
 </script>
 

+ 1 - 1
src/hooks/useRoom.ts

@@ -76,7 +76,6 @@ export const currentScene = computed(() => {
 
 export const changeScene = (scene: SceneItemType) => {
   const rtcStore = useRtcStore();
-  rtcStore.clearMemberList();
   if (currentScene.value?.num !== scene.num && scene?.num.length) {
     console.log(scene, currentScene.value);
     const params = new URLSearchParams(location.search);
@@ -84,6 +83,7 @@ export const changeScene = (scene: SceneItemType) => {
     const url = new URL(location.href);
     url.search = `?` + params.toString();
     location.replace(url);
+    rtcStore.clearMemberList();
   } else {
     // location.reload();
   }

+ 1 - 0
src/hooks/userSocket.ts

@@ -16,6 +16,7 @@ export function createSocket() {
   const rtcStore = useRtcStore();
   // console.log('rtcStore', rtcStore)
   const address = import.meta.env.VITE_APP_SOCKET_URL;
+  console.log('address', address);
   socket = io(address, {
     path: '/ws-sync',
     transports: ['websocket'],