Browse Source

fix: 优化

shuisheng 2 years ago
parent
commit
c3e4444c54
5 changed files with 21 additions and 10 deletions
  1. 3 2
      src/interface.ts
  2. 6 2
      src/views/area/id/index.vue
  3. 6 2
      src/views/h5/area/index.vue
  4. 2 1
      src/views/h5/index.vue
  5. 4 3
      src/views/home/index.vue

+ 3 - 2
src/interface.ts

@@ -202,12 +202,13 @@ export enum LiveRoomPullIsShouldAuthEnum {
   /** 不需要鉴权 */
   no,
 }
+
 /** 是否使用cdn */
 export enum LiveRoomUseCDNEnum {
   /** 使用cdn */
-  yes = 1,
+  yes,
   /** 不使用cdn */
-  no = 2,
+  no,
 }
 
 /** 直播间状态 */

+ 6 - 2
src/views/area/id/index.vue

@@ -31,7 +31,7 @@
               直播中
             </div>
             <div
-              v-if="iten?.cdn === 1"
+              v-if="iten?.cdn === LiveRoomUseCDNEnum.yes"
               class="cdn-ico"
             >
               <div class="txt">CDN</div>
@@ -56,7 +56,11 @@ import { onMounted, ref, watch } from 'vue';
 import { useRoute } from 'vue-router';
 
 import { fetchLiveRoomList } from '@/api/area';
-import { ILiveRoom, LiveRoomPullIsShouldAuthEnum } from '@/interface';
+import {
+  ILiveRoom,
+  LiveRoomPullIsShouldAuthEnum,
+  LiveRoomUseCDNEnum,
+} from '@/interface';
 import router, { routerName } from '@/router';
 
 const liveRoomList = ref<ILiveRoom[]>([]);

+ 6 - 2
src/views/h5/area/index.vue

@@ -28,7 +28,7 @@
             <div class="live-txt">直播中</div>
           </div>
           <div
-            v-if="iten?.cdn === 1"
+            v-if="iten?.cdn === LiveRoomUseCDNEnum.yes"
             class="cdn-ico"
           >
             <div class="txt">CDN</div>
@@ -52,7 +52,11 @@ import { onMounted, ref } from 'vue';
 import { useRoute } from 'vue-router';
 
 import { fetchLiveRoomList } from '@/api/area';
-import { ILiveRoom, LiveRoomPullIsShouldAuthEnum } from '@/interface';
+import {
+  ILiveRoom,
+  LiveRoomPullIsShouldAuthEnum,
+  LiveRoomUseCDNEnum,
+} from '@/interface';
 import router, { routerName } from '@/router';
 
 const liveRoomList = ref<ILiveRoom[]>([]);

+ 2 - 1
src/views/h5/index.vue

@@ -53,7 +53,7 @@
                 直播中
               </div>
               <div
-                v-if="iten.live_room?.cdn === 1"
+                v-if="iten.live_room?.cdn === LiveRoomUseCDNEnum.yes"
                 class="cdn-ico"
               >
                 <div class="txt">CDN</div>
@@ -83,6 +83,7 @@ import {
   IAreaLiveRoom,
   LiveRoomIsShowEnum,
   LiveRoomPullIsShouldAuthEnum,
+  LiveRoomUseCDNEnum,
 } from '@/interface';
 import router, { mobileRouterName, routerName } from '@/router';
 import { useAppStore } from '@/store/app';

+ 4 - 3
src/views/home/index.vue

@@ -44,7 +44,7 @@
           @click="showJoinBtn = !showJoinBtn"
         >
           <div
-            v-if="currentLiveRoom?.live_room?.cdn === 1"
+            v-if="currentLiveRoom?.live_room?.cdn === LiveRoomUseCDNEnum.yes"
             class="cdn-ico"
           >
             <div class="txt">CDN</div>
@@ -111,7 +111,7 @@
               <div class="hidden">
                 <div
                   class="cdn-ico"
-                  v-if="item?.live_room?.cdn === 1"
+                  v-if="item?.live_room?.cdn === LiveRoomUseCDNEnum.yes"
                 >
                   <div class="txt">CDN</div>
                 </div>
@@ -168,7 +168,7 @@
                 "
               ></PullAuthTip>
               <div
-                v-if="iten?.live_room?.cdn === 1"
+                v-if="iten?.live_room?.cdn === LiveRoomUseCDNEnum.yes"
                 class="cdn-ico"
               >
                 <div class="txt">CDN</div>
@@ -210,6 +210,7 @@ import {
   LiveRoomIsShowEnum,
   LiveRoomPullIsShouldAuthEnum,
   LiveRoomTypeEnum,
+  LiveRoomUseCDNEnum,
 } from '@/interface';
 import { routerName } from '@/router';
 import { useAppStore } from '@/store/app';