Bladeren bron

feat: save

gemercheung 1 jaar geleden
bovenliggende
commit
2ddceb783d
9 gewijzigde bestanden met toevoegingen van 27 en 9 verwijderingen
  1. 2 0
      .env.development
  2. 2 0
      .env.eur
  3. 2 0
      .env.eur.prod
  4. 1 0
      .env.home.prod
  5. 2 0
      .env.home.test
  6. 1 1
      .env.production
  7. 13 4
      src/components/chatRoom/controls/join.ts
  8. 3 3
      src/components/hotspot/index.vue
  9. 1 1
      src/hooks/useRoom.ts

+ 2 - 0
.env.development

@@ -26,3 +26,5 @@ VITE_SHOW_CONSOLE=1
 VITE_SHOW_DEBUGPANEL=1
 VITE_TEST_VERSION =2022120905
 VITE_ENABLE_VIDEO=1
+VITE_IS_INTERNATIONAL=0
+

+ 2 - 0
.env.eur

@@ -26,3 +26,5 @@ VITE_SHOW_CONSOLE=1
 VITE_SHOW_DEBUGPANEL=1
 VITE_TEST_VERSION =20230111
 VITE_ENABLE_VIDEO=0
+VITE_IS_INTERNATIONAL=1
+VITE_404_PAGE="https://testeur.4dkankan.com/#/404"

+ 2 - 0
.env.eur.prod

@@ -27,3 +27,5 @@ VITE_SHOW_DEBUGPANEL=0
 VITE_TEST_VERSION=
 # 是否开启 web TRTC
 VITE_ENABLE_VIDEO=1
+VITE_IS_INTERNATIONAL=1
+VITE_404_PAGE="https://eur.4dkankan.com/#/404"

+ 1 - 0
.env.home.prod

@@ -26,3 +26,4 @@ VITE_SHOW_CONSOLE=0
 VITE_SHOW_DEBUGPANEL=0
 VITE_TEST_VERSION =20231031
 VITE_ENABLE_VIDEO=1
+VITE_IS_INTERNATIONAL=0

+ 2 - 0
.env.home.test

@@ -26,3 +26,5 @@ VITE_SHOW_CONSOLE=1
 VITE_SHOW_DEBUGPANEL=1
 VITE_TEST_VERSION =20230111
 VITE_ENABLE_VIDEO=1
+VITE_IS_INTERNATIONAL=0
+VITE_404_PAGE="https://test.4dkankan.com/#/404"

+ 1 - 1
.env.production

@@ -24,4 +24,4 @@ VITE_SHOW_CONSOLE=0
 VITE_SHOW_DEBUGPANEL=0
 VITE_TEST_VERSION =20230111
 VITE_ENABLE_VIDEO=1
-
+VITE_IS_INTERNATIONAL=0

+ 13 - 4
src/components/chatRoom/controls/join.ts

@@ -1,20 +1,22 @@
 import consolaGlobalInstance from 'consola';
 // import sortBy from 'lodash-es/sortBy';
-import { unref } from 'vue';
+import { unref, ref } from 'vue';
 import { useI18n } from '/@/hooks/useI18n';
 // import { unref } from 'vue';
 // import Dialog from '/@/components/basic/dialog';
 // import { getApp } from '/@/hooks/userApp';
-import { useRoom } from '/@/hooks/useRoom';
+import { roomId, useRoom } from '/@/hooks/useRoom';
 import { useSocket } from '/@/hooks/userSocket';
 import { UserInfoType, useRtcStore } from '/@/store/modules/rtc';
 import { useAppStore } from '/@/store/modules/app';
 // import { useRtcSdk } from '/@/hooks/useTRTC';
 // import { useMiniApp } from '/@/hooks/useMiniApp';
 const { enterRoom } = useRoom();
+const isInternational = ref(import.meta.env.VITE_IS_INTERNATIONAL);
+const is404Page = ref(import.meta.env.VITE_404_PAGE);
 
 // 自已join的方法
-export function handleJoin(data: any) {
+export async function handleJoin(data: any) {
   // const app = getApp();
   const { socket, closeSocket } = useSocket();
   const members = data?.members as any as UserInfoType[];
@@ -23,7 +25,14 @@ export function handleJoin(data: any) {
 
   // const userExsit = rtcStore.checkUserInMemberList(rtcStore.userId);
   // banLaterEnterer(members, user);
-  enterRoom();
+  const res = await enterRoom();
+  const { code } = res.data;
+
+  if (code === 4003 && !roomId.includes('temp_') && unref(isInternational)) {
+    location.href = is404Page.value;
+    return;
+  }
+
   rtcStore.setIsJoined(true);
   consolaGlobalInstance.info({
     message: data,

+ 3 - 3
src/components/hotspot/index.vue

@@ -18,7 +18,7 @@
           class="point zoom"
           @mouseenter.prevent="onMouseEnter($event, tag)"
           @click.stop="goTag($event, tag)"
-          :style="{ 'background-image': 'url(' + getUrl(tag.icon) + ')' }"
+          :style="{ 'background-image': 'url(' + getUrl(tag.icon, tag.type) + ')' }"
         ></span>
         <div class="content">
           <div
@@ -182,10 +182,10 @@
       emit('setCurrentTag');
     });
   });
-  const getUrl = (icon) => {
+  const getUrl = (icon, type) => {
     // let url = icon == '' || !icon ? getApp().resource.getAppURL('images/tag_icon_default.svg') : icon
     let url;
-    if (styleList.value.includes(icon)) {
+    if (styleList.value.includes(icon) || type == 'link') {
       // url = getApp().resource.getAppURL('images/tag/' + icon)
       url = getApp().resource.getAppURL('images/tag_icon_default.svg');
     } else {

+ 1 - 1
src/hooks/useRoom.ts

@@ -160,7 +160,7 @@ export const enterRoom = async () => {
     }
   }
 
-  await shopAxios.get('/takelook/inOrOutRoom', {
+  return await shopAxios.get('/takelook/inOrOutRoom', {
     params: {
       type: 0,
       role: role,