shuisheng 2 anni fa
parent
commit
1daca1cf8d

+ 2 - 2
README.md

@@ -117,7 +117,7 @@ Mac端:TODO
 
 ### 安卓端
 
-- 首页、分区、排行
+- 
 
 <img
   src="https://resource.hsslive.cn/billd-live/image/38a0fae4c5104913ca0b7617ca58b518.webp" 
@@ -140,7 +140,7 @@ Mac端:TODO
   style="width:300px"
 />
 
-- 我的已登录/未登录
+- 
 
 <img
   src="https://resource.hsslive.cn/billd-live/image/3a777718d31f94e6d25071d29f5e5185.webp" 

+ 1 - 5
src/api/area.ts

@@ -14,11 +14,7 @@ export function fetchAreaLiveRoomList(params) {
   });
 }
 
-export function fetchLiveRoomList(params: {
-  pageSize?: string;
-  nowPage?: string;
-  id: number;
-}) {
+export function fetchLiveRoomList(params) {
   return request.instance({
     url: '/area/live_room_list',
     method: 'get',

+ 36 - 26
src/views/account/index.vue

@@ -32,33 +32,41 @@
         </div>
         <div>直播间名称:{{ userInfo?.live_rooms?.[0].name }}</div>
         <div>直播间简介:{{ userInfo?.live_rooms?.[0].desc }}</div>
-        <div
-          v-loading="keyLoading"
-          class="rtmp-url"
+        <template
+          v-if="
+            userStore.auths?.find(
+              (v) => v.auth_value === DEFAULT_AUTH_INFO.LIVE_PUSH.auth_value
+            )
+          "
         >
-          <span>
-            推流地址:{{
-              newRtmpUrl ||
-              handleUrl({
-                url: userInfo?.live_rooms?.[0].rtmp_url!,
-                token: userInfo?.live_rooms?.[0].key!,
-              })
-            }},
-          </span>
-          <span
-            class="link"
-            @click="handleCopy"
-          >
-            复制
-          </span>
-          <span>,</span>
-          <span
-            class="link"
-            @click="handleUpdateKey"
+          <div
+            v-loading="keyLoading"
+            class="rtmp-url"
           >
-            更新
-          </span>
-        </div>
+            <span>
+              推流地址:{{
+                newRtmpUrl ||
+                handleUrl({
+                  url: userInfo?.live_rooms?.[0].rtmp_url!,
+                  token: userInfo?.live_rooms?.[0].key!,
+                })
+              }},
+            </span>
+            <span
+              class="link"
+              @click="handleCopy"
+            >
+              复制
+            </span>
+            <span>,</span>
+            <span
+              class="link"
+              @click="handleUpdateKey"
+            >
+              更新
+            </span>
+          </div>
+        </template>
       </div>
     </div>
   </div>
@@ -71,15 +79,17 @@ import { useRouter } from 'vue-router';
 
 import { fetchUpdateLiveRoomKey } from '@/api/liveRoom';
 import { fetchUserInfo } from '@/api/user';
-import { SRS_CB_URL_PARAMS } from '@/constant';
+import { DEFAULT_AUTH_INFO, SRS_CB_URL_PARAMS } from '@/constant';
 import { loginTip } from '@/hooks/use-login';
 import { IUser, LiveRoomTypeEnum } from '@/interface';
 import { routerName } from '@/router';
+import { useUserStore } from '@/store/user';
 import { getLiveRoomPageUrl } from '@/utils';
 
 const newRtmpUrl = ref();
 const keyLoading = ref(false);
 const router = useRouter();
+const userStore = useUserStore();
 
 const userInfo = ref<IUser>();
 

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

@@ -58,6 +58,7 @@ import { useRoute } from 'vue-router';
 import { fetchLiveRoomList } from '@/api/area';
 import {
   ILiveRoom,
+  LiveRoomIsShowEnum,
   LiveRoomPullIsShouldAuthEnum,
   LiveRoomUseCDNEnum,
 } from '@/interface';
@@ -97,6 +98,7 @@ async function getData() {
     loading.value = true;
     const res = await fetchLiveRoomList({
       id: Number(route.params.id),
+      live_room_is_show: LiveRoomIsShowEnum.yes,
     });
     if (res.code === 200) {
       liveRoomList.value = res.data.rows;

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

@@ -54,6 +54,7 @@ import { useRoute } from 'vue-router';
 import { fetchLiveRoomList } from '@/api/area';
 import {
   ILiveRoom,
+  LiveRoomIsShowEnum,
   LiveRoomPullIsShouldAuthEnum,
   LiveRoomUseCDNEnum,
 } from '@/interface';
@@ -80,6 +81,7 @@ onMounted(() => {
 async function getData() {
   const res = await fetchLiveRoomList({
     id: Number(route.params.id),
+    live_room_is_show: LiveRoomIsShowEnum.yes,
   });
   if (res.code === 200) {
     liveRoomList.value = res.data.rows;

+ 24 - 11
src/views/h5/index.vue

@@ -2,9 +2,9 @@
   <div class="h5-wrap">
     <div
       class="swiper"
-      :style="{ backgroundColor: currentSwiper.bg }"
+      :style="{ backgroundImage: `url(${currentSwiper.bgi})` }"
     >
-      {{ currentSwiper.txt }}
+      <!-- {{ currentSwiper.txt }} -->
     </div>
 
     <div class="type-list">
@@ -92,9 +92,24 @@ const appStore = useAppStore();
 const liveRoomList = ref<IArea[]>([]);
 
 const swiperList = ref([
-  { id: 1, txt: '广告位1', bg: '#FFCC70', url: '' },
-  { id: 2, txt: '广告位2', bg: '#C850C0', url: '' },
-  { id: 3, txt: '广告位3', bg: '#4158D0', url: '' },
+  {
+    id: 1,
+    txt: '广告位1',
+    bgi: 'https://resource.hsslive.cn/billd-live/image/ecdece08eb3eda2f37433cb7c748766f.webp',
+    url: '',
+  },
+  {
+    id: 2,
+    txt: '广告位2',
+    bgi: 'https://resource.hsslive.cn/billd-live/image/b2e3459e7d4a70463cd201ee468491a1.webp',
+    url: '',
+  },
+  {
+    id: 3,
+    txt: '广告位3',
+    bgi: 'https://resource.hsslive.cn/billd-live/image/71d01ff0bd34c57586500e425e21938f.webp',
+    url: '',
+  },
 ]);
 const swiperTimer = ref();
 const currentSwiper = ref(swiperList.value[0]);
@@ -192,12 +207,10 @@ onUnmounted(() => {
   }
   .swiper {
     width: 100%;
-    height: 130px;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    user-select: none;
-    font-size: 30px;
+    height: 180px;
+    background-size: cover;
+    background-repeat: no-repeat;
+    background-position: center center;
   }
   .type-list {
     .item {