gemercheung 2 년 전
부모
커밋
15fb5cf874
6개의 변경된 파일17개의 추가작업 그리고 9개의 파일을 삭제
  1. 5 1
      src/App.vue
  2. 6 6
      src/components/chatRoom/controls/actions.ts
  3. 1 0
      src/hooks/useTRTC.ts
  4. 1 1
      src/locales/lang/en/base.ts
  5. 2 1
      src/locales/lang/zh/base.ts
  6. 2 0
      src/store/modules/app.ts

+ 5 - 1
src/App.vue

@@ -177,6 +177,7 @@
       if (toMode != 'dollhouse') {
         appStore.setFloorId(floorIndex);
       }
+      console.log('setFloorId-4', toMode, floorIndex);
       if (fromMode) {
         appStore.setFlying(true);
       }
@@ -189,7 +190,10 @@
     });
     app.Camera.on('flying.ended', ({ targetPano }) => {
       appStore.setFlying(false);
-      appStore.setFloorId(targetPano.id);
+      console.log('setFloorId-3', targetPano.floorIndex);
+      if (unref(mode) !== 'dollhouse') {
+        appStore.setFloorId(targetPano.floorIndex);
+      }
     });
     app.Scene.on('error', (data) => {
       console.log('当前错误code', data.code);

+ 6 - 6
src/components/chatRoom/controls/actions.ts

@@ -393,18 +393,18 @@ const handleRoomValidTime = (data: RoomValidTimeType) => {
   appStore.setRoomValidTime(data.ttl);
   if (rtcStore.isLeader) {
     const seconds = data.ttl;
-    if (seconds > 5) {
+    if (seconds > 3) {
       setTimeout(() => {
-        const time = dayjs.duration(seconds - 1, 'seconds').format('mm:ss');
-        console.log('time', time);
-        const timeString = time == '00:00' ? '60:00' : time;
-        const msg = String(t('base.roomTimeOut')).replace(new RegExp('%time%', 'g'), timeString);
+        // const time = dayjs.duration(seconds - 1, 'seconds').format('mm:ss');
+        // console.log('time', time);
+        // const timeString = time == '00:00' ? '60:00' : time;
+        // const msg = String(t('base.roomTimeOut')).replace(new RegExp('%time%', 'g'), timeString);
         const chat: ChatContentType = {
           role: 'leader',
           mode: '',
           Nickname: t('base.tips'),
           UserId: rtcStore.userId,
-          text: msg,
+          text: t('base.roomTimeOut'),
         };
         rtcStore.addToChatList(chat);
       }, 500);

+ 1 - 0
src/hooks/useTRTC.ts

@@ -191,6 +191,7 @@ async function handlePublish() {
   //   return;
   // }
   try {
+    await localClient.unpublish(localStream);
     await localClient.publish(localStream);
     rtcStore.setIsPublished(true);
   } catch (error) {

+ 1 - 1
src/locales/lang/en/base.ts

@@ -37,5 +37,5 @@ export default {
   baseError1: 'The scene is calculating, please try again later',
   baseError2: 'Abnormal studio, please contact the host.',
   roomTimeOut:
-    'the valid duration of the studio is %time%; after %time%, the Livestream will automatically end; please pay attention to the remaining time above. Thank you.',
+    'The valid duration of the studio is sixty minutes; after sixty minutes, the Livestream will automatically end. Please create a new studio for Livestream if necessary. Please also note the remaining time displayed above. Thank you.',
 };

+ 2 - 1
src/locales/lang/zh/base.ts

@@ -35,5 +35,6 @@ export default {
   connecting: '连接中...',
   baseError1: '该场景正在计算中,请稍后再试',
   baseError2: '房间异常,请联系主持人',
-  roomTimeOut: '房间有效时长为%time%,%time%后将自动结束此次带看,请及时关注上方的剩余时长,谢谢!',
+  roomTimeOut:
+    '带看房间有效总时长为60分钟,到期后将自动关闭。如有需要,您可重新发起。请及时关注上方的剩余时长,谢谢!',
 };

+ 2 - 0
src/store/modules/app.ts

@@ -85,6 +85,7 @@ export const useAppStore = defineStore({
       this.mode = payload;
     },
     setFloorId(id: string): void {
+      console.log('setFloor-2', id);
       this.floorId = id;
     },
     setFlying(payload: boolean): void {
@@ -92,6 +93,7 @@ export const useAppStore = defineStore({
     },
     setFloor(id: string): void {
       this.floorId = id;
+      console.log('setFloor-1', id);
       getApp().Scene.gotoFloor(id);
     },
     showVR(): void {