index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  1. <template>
  2. <div
  3. class="home-wrap"
  4. ref="docRef"
  5. >
  6. <div class="play-container">
  7. <div
  8. v-if="configBg && configBg !== ''"
  9. class="bg-img"
  10. :style="{
  11. backgroundImage: `url(${configBg})`,
  12. }"
  13. ></div>
  14. <video
  15. v-if="configVideo && configVideo !== ''"
  16. class="bg-video"
  17. :src="configVideo"
  18. muted
  19. autoplay
  20. loop
  21. ></video>
  22. <!-- <div class="slider-wrap">
  23. <div
  24. v-for="(item, index) in interactionList"
  25. :key="index"
  26. >
  27. <Slider
  28. v-if="item.length"
  29. :list="item"
  30. :width="docW"
  31. :speed="60"
  32. :direction="index % 2 === 0 ? 'l-r' : 'r-l'"
  33. :customStyle="{ margin: '0 auto' }"
  34. ></Slider>
  35. </div>
  36. </div> -->
  37. <div class="container">
  38. <div
  39. v-loading="videoLoading"
  40. class="left"
  41. ref="videoWrapTmpRef"
  42. @click="showJoinBtn = !showJoinBtn"
  43. >
  44. <div
  45. v-if="
  46. appStore.liveRoomInfo?.cdn === LiveRoomUseCDNEnum.yes &&
  47. [
  48. LiveRoomTypeEnum.tencent_css,
  49. LiveRoomTypeEnum.tencent_css_pk,
  50. ].includes(appStore.liveRoomInfo!.type!)
  51. "
  52. class="cdn-ico"
  53. >
  54. <div class="txt">CDN</div>
  55. </div>
  56. <div class="logo-watermark">Billd直播</div>
  57. <div
  58. class="cover"
  59. :style="{
  60. backgroundImage: `url(${
  61. appStore.liveRoomInfo?.cover_img ||
  62. appStore.liveRoomInfo?.users?.[0]?.avatar
  63. })`,
  64. }"
  65. ></div>
  66. <div
  67. v-if="appStore.liveRoomInfo?.flv_url"
  68. ref="remoteVideoRef"
  69. ></div>
  70. <template v-if="appStore.liveRoomInfo">
  71. <div class="video-controls">
  72. <VideoControls
  73. :resolution="videoResolution"
  74. @refresh="handleRefresh"
  75. :control="{
  76. line: true,
  77. }"
  78. ></VideoControls>
  79. </div>
  80. <div
  81. class="join-btn"
  82. :class="{
  83. show: showJoinBtn,
  84. }"
  85. >
  86. <div
  87. class="btn"
  88. @click="joinRoom(appStore.liveRoomInfo)"
  89. >
  90. 进入直播
  91. </div>
  92. </div>
  93. </template>
  94. </div>
  95. <div class="right">
  96. <div
  97. v-if="topLiveRoomList.length"
  98. class="list"
  99. >
  100. <div
  101. v-for="(item, index) in topLiveRoomList"
  102. :key="index"
  103. :class="{
  104. item: 1,
  105. active: item.live_room?.id === appStore.liveRoomInfo?.id,
  106. }"
  107. :style="{
  108. backgroundImage: `url(${
  109. item.live_room?.cover_img ||
  110. item.live_room?.users?.[0]?.avatar
  111. })`,
  112. }"
  113. @click="changeLiveRoom(item)"
  114. >
  115. <PullAuthTip
  116. v-if="
  117. item.live_room?.pull_is_should_auth ===
  118. LiveRoomPullIsShouldAuthEnum.yes
  119. "
  120. ></PullAuthTip>
  121. <div class="hidden">
  122. <div
  123. class="cdn-ico"
  124. v-if="
  125. item?.live_room?.cdn === LiveRoomUseCDNEnum.yes &&
  126. [
  127. LiveRoomTypeEnum.tencent_css,
  128. LiveRoomTypeEnum.tencent_css_pk,
  129. ].includes(item.live_room!.type!)
  130. "
  131. >
  132. <div class="txt">CDN</div>
  133. </div>
  134. </div>
  135. <div
  136. class="border"
  137. :style="{
  138. opacity:
  139. item.live_room?.id === appStore.liveRoomInfo?.id ? 1 : 0,
  140. }"
  141. ></div>
  142. <div
  143. v-if="item.live_room?.id === appStore.liveRoomInfo?.id"
  144. class="triangle"
  145. ></div>
  146. <div class="txt">{{ item.live_room?.name }}</div>
  147. </div>
  148. </div>
  149. <div
  150. v-else
  151. class="none"
  152. >
  153. {{ t('home.noliveRoomTip') }}
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <div class="area-container">
  159. <div class="area-item">
  160. <div class="title">{{ t('home.recommendLive') }}</div>
  161. <div class="live-room-list">
  162. <div
  163. v-for="(iten, indey) in otherLiveRoomList"
  164. :key="indey"
  165. class="live-room"
  166. @click="joinRoom(iten.live_room)"
  167. >
  168. <div
  169. class="cover"
  170. v-lazy:background-image="
  171. iten?.live_room?.cover_img ||
  172. iten?.live_room?.users?.[0]?.avatar
  173. "
  174. >
  175. <PullAuthTip
  176. v-if="
  177. iten.live_room?.pull_is_should_auth ===
  178. LiveRoomPullIsShouldAuthEnum.yes
  179. "
  180. ></PullAuthTip>
  181. <div
  182. v-if="
  183. iten?.live_room?.cdn === LiveRoomUseCDNEnum.yes &&
  184. [
  185. LiveRoomTypeEnum.tencent_css,
  186. LiveRoomTypeEnum.tencent_css_pk,
  187. ].includes(iten.live_room!.type!)
  188. "
  189. class="cdn-ico"
  190. >
  191. <div class="txt">CDN</div>
  192. </div>
  193. <div class="txt">{{ iten?.live_room?.users?.[0].username }}</div>
  194. </div>
  195. <div class="desc">{{ iten?.live_room?.name }}</div>
  196. </div>
  197. <div
  198. v-if="!otherLiveRoomList.length"
  199. class="null"
  200. >
  201. {{ t('common.nonedata') }}
  202. </div>
  203. </div>
  204. </div>
  205. <div class="area-item">
  206. <div class="title">{{ t('home.bilibiliLive') }}</div>
  207. <div class="live-room-list">
  208. <div
  209. v-for="(iten, indey) in bilibiliLiveRoomList"
  210. :key="indey"
  211. class="live-room"
  212. @click="joinRoom(iten.live_room)"
  213. >
  214. <div
  215. class="cover"
  216. v-lazy:background-image="
  217. iten?.live_room?.cover_img ||
  218. iten?.live_room?.users?.[0]?.avatar
  219. "
  220. >
  221. <PullAuthTip
  222. v-if="
  223. iten.live_room?.pull_is_should_auth ===
  224. LiveRoomPullIsShouldAuthEnum.yes
  225. "
  226. ></PullAuthTip>
  227. <div
  228. v-if="
  229. iten?.live_room?.cdn === LiveRoomUseCDNEnum.yes &&
  230. [
  231. LiveRoomTypeEnum.tencent_css,
  232. LiveRoomTypeEnum.tencent_css_pk,
  233. ].includes(iten.live_room!.type!)
  234. "
  235. class="cdn-ico"
  236. >
  237. <div class="txt">CDN</div>
  238. </div>
  239. <div class="txt">{{ iten?.live_room?.users?.[0].username }}</div>
  240. </div>
  241. <div class="desc">{{ iten?.live_room?.name }}</div>
  242. </div>
  243. <div
  244. v-if="bilibiliLoading"
  245. class="null"
  246. >
  247. {{ t('common.loading') }}
  248. </div>
  249. <div
  250. v-else-if="!bilibiliLiveRoomList.length"
  251. class="null"
  252. >
  253. {{ t('common.nonedata') }}
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. <!-- <div
  259. style="position: fixed; bottom: 200px; right: 0; background-color: red"
  260. >
  261. {{ isBottom }}
  262. </div>
  263. -->
  264. <div ref="loadMoreRef"></div>
  265. <div class="foot">*{{ t('home.copyrightTip') }}~</div>
  266. </div>
  267. <div
  268. class="ad-wrap-a"
  269. v-if="appStore.useGoogleAd"
  270. >
  271. <!-- live-首页广告位1 -->
  272. <ins
  273. class="adsbygoogle"
  274. style="display: block"
  275. data-ad-client="ca-pub-6064454674933772"
  276. data-ad-slot="3325489849"
  277. data-ad-format="auto"
  278. data-full-width-responsive="true"
  279. ></ins>
  280. </div>
  281. </template>
  282. <script lang="ts" setup>
  283. import { openToTarget } from 'billd-utils';
  284. import { onMounted, reactive, ref, watch } from 'vue';
  285. import { useI18n } from 'vue-i18n';
  286. import { useRouter } from 'vue-router';
  287. import { fetchLiveBilibiliGetUserRecommend } from '@/api/bilibili';
  288. import { fetchLiveList } from '@/api/live';
  289. import { sliderList, URL_QUERY } from '@/constant';
  290. import { usePull } from '@/hooks/use-pull';
  291. import { ILive, LiveLineEnum } from '@/interface';
  292. import { routerName } from '@/router';
  293. import { useAppStore } from '@/store/app';
  294. import {
  295. ILiveRoom,
  296. LiveRoomPullIsShouldAuthEnum,
  297. LiveRoomTypeEnum,
  298. LiveRoomUseCDNEnum,
  299. } from '@/types/ILiveRoom';
  300. const router = useRouter();
  301. const appStore = useAppStore();
  302. const canvasRef = ref<Element>();
  303. const bilibiliLoading = ref(false);
  304. const showJoinBtn = ref(false);
  305. const topNums = ref(6);
  306. const configBg = ref('');
  307. const configVideo = ref();
  308. // const configVideo = ref(
  309. // 'https://www.xdyun.com/resldmnqcom/ldq_website/all_ldy/cloudphone_xdyun_ldy_mobile/mobile/assets/xd-video-6c9bcd.mp4'
  310. // );
  311. const topLiveRoomList = ref<ILive[]>([]);
  312. const otherLiveRoomList = ref<ILive[]>([]);
  313. const bilibiliLiveRoomList = ref<ILive[]>([]);
  314. const interactionList = ref<any[]>([]);
  315. const videoWrapTmpRef = ref<HTMLDivElement>();
  316. const remoteVideoRef = ref<HTMLDivElement>();
  317. const docRef = ref<HTMLElement | null>();
  318. const loadMoreRef = ref<HTMLElement | null>();
  319. const pageParams = reactive({ page: 0, page_size: 30, platform: 'web' });
  320. const { t } = useI18n();
  321. const {
  322. videoWrapRef,
  323. videoLoading,
  324. roomLiving,
  325. videoResolution,
  326. handleStopDrawing,
  327. handlePlay,
  328. } = usePull();
  329. const isBottom = ref(false);
  330. const rootMargin = {
  331. bottom: 600,
  332. top: 0,
  333. left: 0,
  334. right: 0,
  335. };
  336. onMounted(() => {
  337. const intersectionObserver = new IntersectionObserver(
  338. (entries) => {
  339. entries.forEach((item) => {
  340. if (item.isIntersecting) {
  341. isBottom.value = true;
  342. } else {
  343. isBottom.value = false;
  344. }
  345. });
  346. },
  347. {
  348. // root: '',
  349. rootMargin: `${rootMargin.top}px ${rootMargin.right}px ${rootMargin.bottom}px ${rootMargin.left}px`,
  350. }
  351. );
  352. intersectionObserver.observe(loadMoreRef.value!);
  353. handleSlideList();
  354. getLiveRoomList();
  355. videoWrapRef.value = videoWrapTmpRef.value;
  356. });
  357. watch(
  358. () => isBottom.value,
  359. async (newval) => {
  360. if (newval) {
  361. const arr = await handleBilibilData();
  362. bilibiliLiveRoomList.value.push(...arr);
  363. }
  364. },
  365. {
  366. immediate: true,
  367. }
  368. );
  369. async function handleBilibilData() {
  370. if (bilibiliLoading.value) return [];
  371. bilibiliLoading.value = true;
  372. let arr: any = [];
  373. try {
  374. pageParams.page += 1;
  375. const res = await fetchLiveBilibiliGetUserRecommend(pageParams);
  376. // const list = res.data?.list;
  377. const list = res?.data?.data?.list;
  378. if (list) {
  379. arr = list.map((item) => {
  380. return {
  381. id: item.roomid,
  382. user: { username: item.uname },
  383. live_room: {
  384. id: item.roomid,
  385. name: item.title,
  386. cover_img: item.cover,
  387. is_bilibili: 1,
  388. },
  389. };
  390. });
  391. }
  392. } catch (error) {
  393. pageParams.page -= 1;
  394. console.log(error);
  395. }
  396. bilibiliLoading.value = false;
  397. return arr;
  398. }
  399. function handleSlideList() {
  400. const row = 2;
  401. const res: any[] = [];
  402. const count = Math.ceil(sliderList.length / row);
  403. for (let i = 0, len = sliderList.length; i < len; i += count) {
  404. const item = sliderList.slice(i, i + count);
  405. res.push([...item]);
  406. }
  407. interactionList.value = res;
  408. }
  409. function handleRefresh() {
  410. playLive(appStore.liveRoomInfo!);
  411. }
  412. function playLive(item: ILiveRoom) {
  413. handleStopDrawing();
  414. canvasRef.value?.childNodes?.forEach((item) => {
  415. item.remove();
  416. });
  417. // roomLiving.value = true;
  418. appStore.liveRoomInfo = item;
  419. handlePlay(item);
  420. }
  421. function changeLiveRoom(item: ILive) {
  422. if (item.id === appStore.liveRoomInfo?.id) return;
  423. if (
  424. ![
  425. LiveRoomTypeEnum.wertc_live,
  426. LiveRoomTypeEnum.wertc_meeting_one,
  427. LiveRoomTypeEnum.wertc_meeting_two,
  428. ].includes(item.live_room!.type!)
  429. ) {
  430. appStore.liveLine = LiveLineEnum.hls;
  431. }
  432. playLive(item.live_room!);
  433. }
  434. async function getLiveRoomList() {
  435. try {
  436. const res = await fetchLiveList({
  437. // orderName: 'created_at',
  438. // orderBy: 'desc',
  439. childOrderName: 'priority,name',
  440. childOrderBy: 'desc,asc',
  441. // status: 0,
  442. // is_show: 0,
  443. // cdn: 0,
  444. // is_fake: 0,
  445. // live_room_id: 1,
  446. });
  447. if (res.code === 200) {
  448. topLiveRoomList.value = res.data.rows.slice(0, topNums.value);
  449. otherLiveRoomList.value = res.data.rows.slice(topNums.value);
  450. if (res.data.total) {
  451. roomLiving.value = true;
  452. appStore.liveRoomInfo = topLiveRoomList.value[0].live_room;
  453. }
  454. }
  455. } catch (error) {
  456. console.log(error);
  457. }
  458. }
  459. function joinRoom(data) {
  460. const url = router.resolve({
  461. name: routerName.pull,
  462. params: { roomId: data.id },
  463. query: { [URL_QUERY.isBilibili]: data.is_bilibili },
  464. });
  465. openToTarget(url.href);
  466. }
  467. </script>
  468. <style lang="scss" scoped>
  469. .home-wrap {
  470. // overflow: scroll;
  471. // height: 100vh;
  472. // height: calc(100vh - $header-height);
  473. .play-container {
  474. position: relative;
  475. z-index: 1;
  476. padding-bottom: 50px;
  477. .bg-img {
  478. position: absolute;
  479. top: 0;
  480. right: 0;
  481. left: 0;
  482. z-index: -1;
  483. width: 100%;
  484. height: 100%;
  485. background-position: center;
  486. background-size: cover;
  487. background-repeat: no-repeat;
  488. }
  489. .bg-video {
  490. position: absolute;
  491. top: 0;
  492. right: 0;
  493. left: 0;
  494. z-index: -1;
  495. width: 100%;
  496. height: 100%;
  497. }
  498. .slider-wrap {
  499. padding: 4px 0;
  500. }
  501. .container {
  502. display: flex;
  503. justify-content: center;
  504. box-sizing: border-box;
  505. margin: 0 auto;
  506. padding-top: 20px;
  507. height: calc($w-1100 / $video-ratio);
  508. .left {
  509. position: relative;
  510. display: inline-block;
  511. overflow: hidden;
  512. flex-shrink: 0;
  513. box-sizing: border-box;
  514. margin-right: 20px;
  515. width: $w-1100;
  516. height: 100%;
  517. border-radius: 4px;
  518. background-color: rgba($color: #000000, $alpha: 0.3);
  519. @extend %coverBg;
  520. .cdn-ico {
  521. position: absolute;
  522. top: -9px;
  523. right: -10px;
  524. z-index: 2;
  525. width: 70px;
  526. height: 32px;
  527. background-color: #f87c48;
  528. color: white;
  529. transform: rotate(45deg);
  530. transform-origin: bottom;
  531. .txt {
  532. margin-top: 11px;
  533. margin-left: 20px;
  534. background-image: initial !important;
  535. font-size: 14px;
  536. }
  537. }
  538. .logo-watermark {
  539. position: absolute;
  540. top: 10px;
  541. left: 10px;
  542. z-index: 2;
  543. color: rgba($color: #fff, $alpha: 0.5);
  544. font-weight: bold;
  545. font-size: 30px;
  546. line-height: 1;
  547. }
  548. .cover {
  549. position: absolute;
  550. background-position: center center;
  551. background-size: cover;
  552. filter: blur(5px);
  553. inset: 0;
  554. }
  555. :deep(canvas) {
  556. position: absolute;
  557. top: 50%;
  558. left: 50%;
  559. // min-width: 100%;
  560. // min-height: 100%;
  561. max-width: $w-1100;
  562. max-height: calc($w-1100 / $video-ratio);
  563. transform: translate(-50%, -50%);
  564. user-select: none;
  565. }
  566. :deep(video) {
  567. position: absolute;
  568. top: 50%;
  569. left: 50%;
  570. // min-width: 100%;
  571. // min-height: 100%;
  572. max-width: $w-1100;
  573. max-height: calc($w-1100 / $video-ratio);
  574. transform: translate(-50%, -50%);
  575. user-select: none;
  576. }
  577. .join-btn {
  578. position: absolute;
  579. top: 50%;
  580. left: 50%;
  581. z-index: 20;
  582. display: none;
  583. align-items: center;
  584. justify-content: center;
  585. box-sizing: border-box;
  586. // width: 80%;
  587. transform: translate(-50%, -50%);
  588. &.show {
  589. display: inline-flex !important;
  590. }
  591. .btn {
  592. padding: 14px 26px;
  593. border: 2px solid rgba($color: $theme-color-gold, $alpha: 0.5);
  594. border-radius: 6px;
  595. background-color: rgba(0, 0, 0, 0.3);
  596. color: $theme-color-gold;
  597. font-size: 16px;
  598. cursor: pointer;
  599. &:hover {
  600. background-color: $theme-color-gold;
  601. color: white;
  602. }
  603. }
  604. }
  605. .video-controls {
  606. display: none;
  607. }
  608. &:hover {
  609. .join-btn {
  610. display: block;
  611. }
  612. .video-controls {
  613. display: block;
  614. }
  615. }
  616. }
  617. .right {
  618. display: inline-block;
  619. overflow: scroll;
  620. flex-shrink: 0;
  621. box-sizing: border-box;
  622. padding: 12px 10px;
  623. height: 100%;
  624. border-radius: 4px;
  625. background-color: rgba($color: #000000, $alpha: 0.3);
  626. @extend %hideScrollbar;
  627. .list {
  628. .item {
  629. position: relative;
  630. box-sizing: border-box;
  631. margin-bottom: 10px;
  632. width: 200px;
  633. height: 110px;
  634. border-radius: 4px;
  635. background-color: rgba($color: #000000, $alpha: 0.3);
  636. cursor: pointer;
  637. @extend %coverBg;
  638. &:last-child {
  639. margin-bottom: 0;
  640. }
  641. .hidden {
  642. position: relative;
  643. overflow: hidden;
  644. width: 200px;
  645. height: 110px;
  646. .cdn-ico {
  647. position: absolute;
  648. top: -9px;
  649. right: -9px;
  650. z-index: 2;
  651. width: 60px;
  652. height: 28px;
  653. background-color: #f87c48;
  654. color: white;
  655. transform: rotate(45deg);
  656. transform-origin: bottom;
  657. .txt {
  658. margin-left: 10px;
  659. background-image: initial !important;
  660. font-size: 12px;
  661. line-height: 0.8;
  662. }
  663. }
  664. }
  665. .border {
  666. position: absolute;
  667. top: 0;
  668. right: 0;
  669. bottom: 0;
  670. left: 0;
  671. z-index: 3;
  672. border: 2px solid $theme-color-gold;
  673. border-radius: 4px;
  674. }
  675. .triangle {
  676. position: absolute;
  677. top: 50%;
  678. left: 0;
  679. display: inline-block;
  680. border: 5px solid transparent;
  681. border-right-color: $theme-color-gold;
  682. transform: translate(-100%, -50%);
  683. }
  684. &.active {
  685. &::before {
  686. background-color: transparent;
  687. }
  688. }
  689. &:hover {
  690. &::before {
  691. background-color: transparent;
  692. }
  693. }
  694. &::before {
  695. position: absolute;
  696. display: block;
  697. width: 100%;
  698. height: 100%;
  699. border-radius: 4px;
  700. background-color: rgba(0, 0, 0, 0.4);
  701. content: '';
  702. transition: all cubic-bezier(0.22, 0.58, 0.12, 0.98) 0.4s;
  703. }
  704. .txt {
  705. position: absolute;
  706. bottom: 0;
  707. left: 0;
  708. box-sizing: border-box;
  709. padding: 4px 8px;
  710. width: 100%;
  711. border-radius: 0 0 4px 4px;
  712. background-image: linear-gradient(
  713. -180deg,
  714. rgba(0, 0, 0, 0),
  715. rgba(0, 0, 0, 0.6)
  716. );
  717. color: white;
  718. text-align: initial;
  719. font-size: 13px;
  720. @extend %singleEllipsis;
  721. }
  722. }
  723. }
  724. .none {
  725. width: 200px;
  726. color: white;
  727. text-align: center;
  728. font-size: 14px;
  729. }
  730. }
  731. }
  732. }
  733. .area-container {
  734. box-sizing: border-box;
  735. margin: 10px auto;
  736. width: $w-1350;
  737. .area-item {
  738. .title {
  739. padding: 10px 0;
  740. font-size: 26px;
  741. }
  742. .live-room-list {
  743. display: flex;
  744. flex-wrap: wrap;
  745. justify-content: space-between;
  746. .live-room {
  747. display: inline-block;
  748. margin-right: 32px;
  749. margin-bottom: 10px;
  750. width: 300px;
  751. cursor: pointer;
  752. .cover {
  753. position: relative;
  754. overflow: hidden;
  755. width: 100%;
  756. height: 150px;
  757. border-radius: 8px;
  758. @extend %containBg;
  759. .cdn-ico {
  760. position: absolute;
  761. top: -10px;
  762. right: -10px;
  763. z-index: 2;
  764. width: 70px;
  765. height: 28px;
  766. background-color: #f87c48;
  767. color: white;
  768. transform: rotate(45deg);
  769. transform-origin: bottom;
  770. .txt {
  771. margin-left: 18px;
  772. background-image: initial !important;
  773. font-size: 13px;
  774. }
  775. }
  776. .txt {
  777. position: absolute;
  778. bottom: 0;
  779. left: 0;
  780. box-sizing: border-box;
  781. padding: 4px 8px;
  782. width: 100%;
  783. border-radius: 0 0 4px 4px;
  784. background-image: linear-gradient(
  785. -180deg,
  786. rgba(0, 0, 0, 0),
  787. rgba(0, 0, 0, 0.6)
  788. );
  789. color: white;
  790. text-align: initial;
  791. font-size: 13px;
  792. @extend %singleEllipsis;
  793. }
  794. }
  795. .desc {
  796. margin-top: 4px;
  797. font-size: 14px;
  798. @extend %singleEllipsis;
  799. }
  800. }
  801. .null {
  802. width: 100%;
  803. text-align: center;
  804. }
  805. }
  806. }
  807. }
  808. .foot {
  809. margin-top: 10px;
  810. text-align: center;
  811. }
  812. }
  813. .ad-wrap-a {
  814. position: fixed;
  815. top: 300px;
  816. left: 10px;
  817. // background-color: red;
  818. z-index: 999;
  819. width: 250px;
  820. // height: 150px;
  821. border-radius: 10px;
  822. ins {
  823. width: 100%;
  824. height: 100%;
  825. }
  826. }
  827. // 屏幕宽度小于1330的时候
  828. @media screen and (max-width: 1330px) {
  829. .home-wrap {
  830. .play-container {
  831. .container {
  832. height: calc($w-900 / $video-ratio);
  833. .left {
  834. width: $w-900;
  835. :deep(canvas) {
  836. max-width: $w-900;
  837. max-height: calc($w-900 / $video-ratio);
  838. }
  839. :deep(video) {
  840. max-width: $w-900;
  841. max-height: calc($w-900 / $video-ratio);
  842. }
  843. }
  844. }
  845. }
  846. .area-container {
  847. width: $w-1150;
  848. .area-item {
  849. .live-room-list {
  850. .live-room {
  851. width: 250px;
  852. }
  853. }
  854. }
  855. }
  856. }
  857. }
  858. </style>