guhongwei 4 anni fa
parent
commit
184b055d5d

+ 2 - 0
package.json

@@ -21,9 +21,11 @@
     "naf-core": "^0.1.2",
     "qrcode": "^1.4.4",
     "stomp": "^0.1.1",
+    "swiper": "^6.3.5",
     "videojs-contrib-hls": "^5.15.0",
     "videojs-flash": "^2.2.1",
     "vue": "^2.6.11",
+    "vue-awesome-swiper": "^4.1.1",
     "vue-meta": "^2.3.4",
     "vue-router": "^3.3.2",
     "vue-video-player": "^5.0.2",

+ 11 - 9
public/index.html

@@ -5,6 +5,8 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <link rel="stylesheet" href="/swiper/swiper-bundle.min.css">
+    <script src="/static/js/swiper-bundle.min.js"></script>
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>
   <body>
@@ -15,15 +17,15 @@
     <!-- built files will be auto injected -->
       <script language=javascript>
           // 禁止右键菜单
-            document.oncontextmenu = function () { return false; };
-            // 禁止文字选择
-            document.onselectstart = function () { return false; };
-            // 禁止复制
-            document.oncopy = function () { return false; };
-            // 禁止剪切
-            document.oncut = function () { return false; };
-            // 禁止粘贴
-            document.onpaste = function () { return false; };
+            // document.oncontextmenu = function () { return false; };
+            // // 禁止文字选择
+            // document.onselectstart = function () { return false; };
+            // // 禁止复制
+            // document.oncopy = function () { return false; };
+            // // 禁止剪切
+            // document.oncut = function () { return false; };
+            // // 禁止粘贴
+            // document.onpaste = function () { return false; };
       </script>
   </body>
 </html>

File diff suppressed because it is too large
+ 14 - 0
public/static/js/swiper-bundle.min.js


File diff suppressed because it is too large
+ 13 - 0
public/swiper/swiper-bundle.min.css


BIN
src/assets/emotion/flower2.gif


+ 45 - 7
src/views/hall/direct.vue

@@ -62,16 +62,31 @@
                     </div>
                   </el-col>
                   <el-col :span="24" class="videoDown">
-                    <el-carousel :interval="4000" type="card" height="50px" :autoplay="false">
+                    <!-- <el-carousel type="card" height="50px" :autoplay="false">
                       <el-carousel-item
                         v-for="(item, index) in videoData"
                         :key="index"
                         :class="menuIndex == index ? 'indexClass' : 'videodata'"
                         @click.native="changeMenu(index, item)"
                       >
-                        {{ item.videointro }}
+                        第{{ index + 1 }}辑
                       </el-carousel-item>
-                    </el-carousel>
+                    </el-carousel> -->
+                    <div class="swiper-container">
+                      <div class="swiper-wrapper">
+                        <div
+                          v-for="(item, index) in videoData"
+                          :key="index"
+                          :class="`${menuIndex == index ? 'indexClass' : 'videodata'} swiper-slide`"
+                          @click="changeMenu(index, item)"
+                        >
+                          <p>第{{ index + 1 }}辑</p>
+                        </div>
+                      </div>
+                      <!-- 如果需要导航按钮 -->
+                      <div class="swiper-button-prev"></div>
+                      <div class="swiper-button-next"></div>
+                    </div>
                   </el-col>
                 </el-col>
               </el-col>
@@ -454,6 +469,7 @@ export default {
   },
   data: () => ({
     achievezb: require('@/assets/3.png'),
+    hand: require('@/assets/emotion/flower2.gif'),
     touxiang: require('@/assets/emotion/touxiang.png'),
     videodisplay: 'list',
     activeName: 'second',
@@ -759,6 +775,18 @@ export default {
       let res = await this.dockFetch(this.dock_id);
       if (this.$checkRes(res)) {
         this.$set(this, `videoData`, res.data.videodata);
+        this.$nextTick(() => {
+          var mySwiper = new Swiper('.swiper-container', {
+            slidesPerView: 4,
+            centeredSlides: true,
+            centeredSlidesBounds: true,
+            // 如果需要前进后退按钮
+            navigation: {
+              nextEl: '.swiper-button-next',
+              prevEl: '.swiper-button-prev',
+            },
+          });
+        });
         this.changeMenu('0', this.videoData[0]);
       }
     },
@@ -924,11 +952,15 @@ export default {
           height: 50px;
           overflow: hidden;
           border: 1px solid #ccc;
+          .swiper-container {
+            width: 100%;
+            height: 50px;
+          }
           .videodata {
             border-radius: 10px;
             background: #cccccc8f;
-            height: 50px;
-            line-height: 50px;
+            height: 39px;
+            line-height: 39px;
             text-align: center;
             margin: 0 5px;
             font-weight: bold;
@@ -940,14 +972,20 @@ export default {
           }
           .indexClass {
             border-radius: 10px;
-            height: 50px;
-            line-height: 50px;
+            height: 39px;
+            line-height: 39px;
             text-align: center;
             margin: 0 5px;
             font-weight: bold;
             color: #fff;
             background: #409eff;
           }
+          // /deep/.el-carousel__item--card {
+          //   width: 10%;
+          // }
+          // /deep/.el-carousel__indicators {
+          //   display: none;
+          // }
         }
       }
     }