wws před 2 roky
rodič
revize
5147846579

binární
src/assets/close.png


binární
src/assets/live/gift.png


binární
src/assets/live/live-full.png


+ 5 - 3
src/components/chat-wrapper/ChatWrapper.vue

@@ -42,11 +42,13 @@ export default {
 <style scoped>
 
 .chat-box {
-  //position: absolute;
-  //bottom: 0;
-  height: 340px;
+  //height: 340px;
+  width: 256px;
+  height: calc(100vh - 382px);
   margin-top: 20px;
   overflow: auto;
+  -ms-overflow-style: none;  /* IE and Edge */
+  scrollbar-width: none;  /* Firefox */
 }
 
 .chat-item {

+ 70 - 0
src/components/live-footer/LiveFooter.vue

@@ -0,0 +1,70 @@
+<script>
+export default {
+  name: "LiveFooter"
+}
+</script>
+
+<template>
+  <div class="live-footer">
+    <div class="live-input-row">发个弹幕吧~</div>
+    <div class="live-footer-item" style="padding: 6px 5px">
+      <img src="@/assets/cart.png" class="live-footer-icon" />
+    </div>
+
+    <div class="live-footer-item">
+      <img src="@/assets/share.png" class="live-footer-icon" />
+      <span class="live-footer-count">345.9W</span>
+    </div>
+
+    <div class="live-footer-item">
+      <img src="@/assets/like_active.png" class="live-footer-icon" />
+      <span class="live-footer-count">999.9K</span>
+    </div>
+  </div>
+</template>
+
+<style scoped>
+
+.live-footer {
+  margin: 8px 8px 10px;
+  display: flex;
+  align-items: center;
+  column-gap: 6px;
+}
+
+.live-input-row {
+  width: 122px;
+  height: 36px;
+  background: rgba(26, 40, 55, 0.5);
+  box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.24);
+  border-radius: 18px;
+  font-weight: 400;
+  font-size: 16px;
+  color: rgba(255,255,255,0.5);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.live-footer-item {
+  display: flex;
+  align-items: center;
+  column-gap: 4px;
+  background: rgba(26, 40, 55, 0.5);
+  box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.24);
+  border-radius: 18px;
+  box-sizing: border-box;
+  padding: 6px 10px;
+}
+
+.live-footer-icon {
+  width: 24px;
+  height: 24px;
+}
+
+.live-footer-count {
+  font-weight: bold;
+  font-size: 12px;
+  color: #FFFFFF;
+}
+</style>

+ 153 - 0
src/components/live-header/LiveHeader.vue

@@ -0,0 +1,153 @@
+<script>
+import LiveNotice from "@/components/notcie/LiveNotice.vue";
+
+export default {
+  name: "LiveHeader",
+  components: {LiveNotice}
+}
+</script>
+
+<template>
+  <div>
+    <div class="live-header">
+      <div class="header-l">
+        <img src="@/assets/live/arrow-left.png" class="arrow-left" />
+        <div class="live-box">
+          <img src="https://picsum.photos/200" class="user-avatar" />
+          <div class="live-info">
+            <span class="live-name">2024秋季投资策2024秋季投资策略2024秋季投资策略</span>
+            <span class="live-user-count">13.4 万人看过</span>
+          </div>
+          <div class="follow-status">关注</div>
+        </div>
+      </div>
+
+      <div class="header-r">
+        <img src="@/assets/fenestrule.png" class="header-r-icon" />
+        <img src="@/assets/more.png" class="header-r-icon" />
+      </div>
+    </div>
+    <div class="preside-row">主持人:汪老师 · 职业编号:S0570618010086</div>
+    <live-notice />
+    <div class="live-status">
+      <img src="@/assets/undulate.png" class="undulate-icon" />
+      <span>直播中</span>
+    </div>
+  </div>
+</template>
+
+<style scoped>
+
+
+.live-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  column-gap: 8px;
+  margin: 0 15px;
+}
+
+.header-l {
+  display: flex;
+  align-items: center;
+}
+
+.arrow-left {
+  width: 28px;
+  height: 28px;
+}
+
+.user-avatar {
+  width: 32px;
+  height: 32px;
+  border-radius: 50%;
+}
+
+.live-box {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  column-gap: 8px;
+  background: rgba(26, 40, 55, 0.5);
+  box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.24);
+  border-radius: 21px;
+  box-sizing: border-box;
+  padding: 4px 10px 4px 0;
+}
+
+.live-info {
+  display: flex;
+  flex-direction: column;
+  row-gap: 4px;
+}
+
+.live-name {
+  width: 138px;
+  font-weight: 600;
+  font-size: 14px;
+  color: #FFFFFF;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.live-user-count {
+  font-weight: 400;
+  font-size: 10px;
+  color: #FFFFFF;
+}
+
+.follow-status {
+  background: rgba(255,255,255,0);
+  border-radius: 14px;
+  border: 1px solid #EC2E31;
+  font-weight: 400;
+  font-size: 14px;
+  color: #EC2E31;
+  box-sizing: border-box;
+  padding: 2px 12px;
+}
+
+.header-r {
+  display: flex;
+  align-items: center;
+  column-gap: 4px;
+}
+
+.header-r-icon {
+  width: 28px;
+  height: 28px;
+}
+
+.preside-row {
+  font-weight: 400;
+  font-size: 10px;
+  color: #FFFFFF;
+  margin: 8px 15px 0;
+}
+
+
+
+.live-status {
+  width: 68px;
+  height: 20px;
+  display: flex;
+  align-items: center;
+  column-gap: 4px;
+  background: rgba(26, 40, 55, 0.5);
+  box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.24);
+  border-radius: 10px;
+  color: #ffffff;
+  font-weight: 400;
+  font-size: 12px;
+  margin: 8px 15px 0;
+  box-sizing: border-box;
+  padding: 0 8px;
+}
+
+.undulate-icon {
+  width: 12px;
+  height: 12px;
+}
+
+</style>

+ 65 - 45
src/components/live/LiveInteract.vue

@@ -1,32 +1,38 @@
 <script>
 import ChatWrapper from "@/components/chat-wrapper/ChatWrapper.vue";
+import LiveFooter from "@/components/live-footer/LiveFooter.vue";
+import LiveHeader from "@/components/live-header/LiveHeader.vue";
 
 export default {
   name: "LiveInteract",
-  components: {ChatWrapper}
+  components: {LiveHeader, LiveFooter, ChatWrapper}
 }
 </script>
 
 <template>
-  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" :show-indicators="false">
+  <van-swipe class="my-swipe"
+             :autoplay="0"
+             :loop="false"
+             :initial-swipe="1"
+             :show-indicators="false">
     <van-swipe-item>
-      <div style="position: absolute; bottom: 0">
-        <chat-wrapper />
-
-        <div class="live-footer">
-          <div class="live-input-row">发个弹幕吧~</div>
-          <div class="live-footer-item" style="padding: 6px 5px">
-            <img src="@/assets/cart.png" class="live-footer-icon" />
-          </div>
-
-          <div class="live-footer-item">
-            <img src="@/assets/share.png" class="live-footer-icon" />
-            <span class="live-footer-count">345.9W</span>
-          </div>
+      清除
+    </van-swipe-item>
+    <van-swipe-item>
+      <div class="interact-box">
+        <live-header />
+        <div class="footer">
+          <chat-wrapper />
+          <live-footer />
+          <div class="shop-and-gift">
+            <div class="guide-box">
+              <img src="https://picsum.photos/200" class="guide-cover" />
+              <img src="@/assets/close.png" class="close-icon" />
+            </div>
 
-          <div class="live-footer-item">
-            <img src="@/assets/like_active.png" class="live-footer-icon" />
-            <span class="live-footer-count">999.9K</span>
+            <div class="gift-box">
+              <img src="@/assets/live/gift.png" class="gift-icon" />
+            </div>
           </div>
         </div>
       </div>
@@ -42,47 +48,61 @@ export default {
   background: rgba(255, 255, 255, 0.5);
 }
 
-.live-footer {
-  margin: 8px 8px 10px;
+.interact-box {
+  height: 100%;
   display: flex;
-  align-items: center;
-  column-gap: 8px;
+  flex-direction: column;
+  justify-content: space-between;
+  box-sizing: border-box;
+  padding: 14px 0 0;
 }
 
-.live-input-row {
-  width: 122px;
-  height: 36px;
+.shop-and-gift {
+  position: absolute;
+  right: 8px;
+  bottom: 62px;
+  display: flex;
+  flex-direction: column;
+  align-items: flex-end;
+}
+
+
+.gift-box {
+  width: 40px;
+  height: 40px;
+  border-radius: 20px;
   background: rgba(26, 40, 55, 0.5);
   box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.24);
-  border-radius: 18px;
-  font-weight: 400;
-  font-size: 16px;
-  color: rgba(255,255,255,0.5);
   display: flex;
   align-items: center;
   justify-content: center;
 }
 
-.live-footer-item {
-  display: flex;
-  align-items: center;
-  column-gap: 4px;
-  background: rgba(26, 40, 55, 0.5);
-  box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.24);
-  border-radius: 18px;
-  box-sizing: border-box;
-  padding: 6px 10px;
+.gift-icon {
+  width: 20px;
+  height: 20px;
 }
 
-.live-footer-icon {
-  width: 24px;
-  height: 24px;
+.guide-box {
+  width: 80px;
+  height: 100px;
+  border-radius: 8px;
+  position: relative;
+  margin-bottom: 16px;
 }
 
-.live-footer-count {
-  font-weight: bold;
-  font-size: 12px;
-  color: #FFFFFF;
+.guide-cover {
+  width: 80px;
+  height: 100px;
+  border-radius: 8px;
+}
+
+.close-icon {
+  width: 20px;
+  height: 20px;
+  position: absolute;
+  top: 4px;
+  right: 4px;
 }
 
 </style>

+ 5 - 1
src/router/index.js

@@ -9,9 +9,13 @@ const routes = [
     component: () => import( '../views/video/VideoItem.vue')
   },
   {
-    path: '/',
+    path: '/live',
     component: () => import( '../views/live/LiveItem.vue')
   },
+  {
+    path: '/',
+    component: () => import( '../views/live/VerticalLive.vue')
+  },
 ]
 
 const router = new VueRouter({

+ 38 - 118
src/views/live/LiveItem.vue

@@ -1,41 +1,27 @@
 <script>
 import LiveInteract from "@/components/live/LiveInteract.vue";
-import LiveNotice from "@/components/notcie/LiveNotice.vue";
 
 export default {
   name: "LiveItem",
-  components: {LiveNotice, LiveInteract}
+  components: {LiveInteract},
+  methods: {
+    handleClick() {
+      console.log("测试点击")
+    }
+  }
 }
 </script>
 
 <template>
   <div class="live-item">
-    <div class="live-header">
-      <div class="header-l">
-        <img src="@/assets/live/arrow-left.png" class="arrow-left" />
-        <div class="live-box">
-          <img src="https://picsum.photos/200" class="user-avatar" />
-          <div class="live-info">
-            <span class="live-name">2024秋季投资策2024秋季投资策略2024秋季投资策略</span>
-            <span class="live-user-count">13.4 万人看过</span>
-          </div>
-          <div class="follow-status">关注</div>
-        </div>
+    <div class="live-video-box">
+      <div class="video-box"></div>
+      <div class="video-tip">
+        市场有风险 投资需谨慎
       </div>
-
-      <div class="header-r">
-        <img src="@/assets/fenestrule.png" class="header-r-icon" />
-        <img src="@/assets/more.png" class="header-r-icon" />
-      </div>
-    </div>
-    <div class="preside-row">主持人:汪老师 · 职业编号:S0570618010086</div>
-    <live-notice />
-    <div class="live-status">
-      <img src="@/assets/undulate.png" class="undulate-icon" />
-      <span>直播中</span>
+      <img src="@/assets/live/live-full.png" class="full-icon" @click="handleClick" />
     </div>
-
-    <live-interact  style="flex: 1" />
+    <live-interact class="interact"  style="flex: 1" />
   </div>
 </template>
 
@@ -44,116 +30,50 @@ export default {
 .live-item {
   width: 100vw;
   height: 100vh;
-  background: #000000;
+  background: transparent;
   display: flex;
   flex-direction: column;
 }
 
-.live-header {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  column-gap: 8px;
-  margin: 0 15px;
-}
-
-.header-l {
-  display: flex;
-  align-items: center;
-}
-
-.arrow-left {
-  width: 28px;
-  height: 28px;
-}
-
-.user-avatar {
-  width: 32px;
-  height: 32px;
-  border-radius: 50%;
+.live-video-box {
+  position: absolute;
+  top: 120px;
+  width: 100vw;
+  height: 206px;
+  background: pink;
 }
 
-.live-box {
-  flex: 1;
-  display: flex;
-  align-items: center;
-  column-gap: 8px;
+.video-tip {
+  width: 100vw;
+  height: 14px;
   background: rgba(26, 40, 55, 0.5);
   box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.24);
-  border-radius: 21px;
-  box-sizing: border-box;
-  padding: 4px 10px 4px 0;
-}
-
-.live-info {
-  display: flex;
-  flex-direction: column;
-  row-gap: 4px;
-}
-
-.live-name {
-  width: 138px;
-  font-weight: 600;
-  font-size: 14px;
-  color: #FFFFFF;
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
-}
-
-.live-user-count {
   font-weight: 400;
   font-size: 10px;
   color: #FFFFFF;
-}
-
-.follow-status {
-  background: rgba(255,255,255,0);
-  border-radius: 14px;
-  border: 1px solid #EC2E31;
-  font-weight: 400;
-  font-size: 14px;
-  color: #EC2E31;
   box-sizing: border-box;
-  padding: 2px 12px;
-}
-
-.header-r {
-  display: flex;
-  align-items: center;
-  column-gap: 4px;
-}
-
-.header-r-icon {
-  width: 28px;
-  height: 28px;
+  padding: 0 20px;
+  position: absolute;
+  bottom: 0;
 }
 
-.preside-row {
-  font-weight: 400;
-  font-size: 10px;
-  color: #FFFFFF;
-  margin: 8px 15px 0;
+.full-icon {
+  width: 24px;
+  height: 24px;
+  position: absolute;
+  right: 20px;
+  bottom: 20px;
+  z-index: 9999;
 }
 
 
 
-.live-status {
-  display: flex;
-  align-items: center;
-  column-gap: 4px;
-  background: rgba(26, 40, 55, 0.5);
-  box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.24);
-  border-radius: 10px;
-  color: #ffffff;
-  font-weight: 400;
-  font-size: 12px;
-  margin: 8px 15px 0;
-}
-
-.undulate-icon {
-  width: 12px;
-  height: 12px;
+.interact {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
 }
 
 </style>

+ 37 - 0
src/views/live/VerticalLive.vue

@@ -0,0 +1,37 @@
+<script>
+import LiveInteract from "@/components/live/LiveInteract.vue";
+
+export default {
+  name: "VerticalLive",
+  components: {LiveInteract}
+}
+</script>
+
+<template>
+  <div>
+    <div class="video-box"></div>
+
+<!--    <div class="live-video-box">-->
+<!--      <div class="video-tip">市场有风险 投资需谨慎 </div>-->
+<!--    </div>-->
+    <live-interact class="interact"  style="flex: 1" />
+  </div>
+</template>
+
+<style scoped>
+
+.video-box {
+  width: 100vw;
+  height: 100vh;
+  background: pink;
+}
+
+.interact {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+}
+
+</style>