Selaa lähdekoodia

fix: 分区优化

shuisheng 2 vuotta sitten
vanhempi
sitoutus
067a7b7559
3 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 3 1
      src/hooks/use-push.ts
  2. 3 1
      src/interface.ts
  3. 4 0
      src/views/h5/area/index.vue

+ 3 - 1
src/hooks/use-push.ts

@@ -159,7 +159,9 @@ export function usePush({
       const res = await fetchCreateUserLiveRoom();
       if (res.code === 200) {
         window.$message.success('开通直播间成功!');
-        windowReload();
+        setTimeout(() => {
+          windowReload();
+        }, 500);
       }
     } catch (error) {
       console.log(error);

+ 3 - 1
src/interface.ts

@@ -153,8 +153,10 @@ export interface ILiveRoom {
   users?: IUser[];
   /** 分区信息 */
   area?: IArea;
-  name?: string;
+  /** 直播信息 */
+  live?: ILive;
   user_live_room?: IUserLiveRoom & { user: IUser };
+  name?: string;
   /** 权重 */
   weight?: number;
   key?: string;

+ 4 - 0
src/views/h5/area/index.vue

@@ -42,6 +42,10 @@ const liveRoomList = ref<ILiveRoom[]>([]);
 
 const route = useRoute();
 function goRoom(item: ILiveRoom) {
+  if (!item.live) {
+    window.$message.info('该直播间没在直播~');
+    return;
+  }
   router.push({
     name: routerName.h5Room,
     params: { roomId: item.id },