liuyu hace 4 años
padre
commit
f3bc09544b
Se han modificado 1 ficheros con 23 adiciones y 38 borrados
  1. 23 38
      src/views/index.vue

+ 23 - 38
src/views/index.vue

@@ -32,17 +32,17 @@
             <h4>往期直播</h4>
             <van-col span="24">
               <van-col span="11" class="videoList" v-for="(item, index) in videoList" :key="index">
-                <van-image :src="item.videoUrl" />
+                <van-image :src="item.filedir" @click.native="$router.push({ path: '/onlive/videoinfo', query: { id: item.id, fileid: item.file_id } })" />
                 <p>{{ item.title }}</p>
               </van-col>
             </van-col>
           </van-col>
           <van-col span="24" class="foot">
             <van-tabbar v-model="active">
-              <van-tabbar-item icon="home-o">測試</van-tabbar-item>
-              <van-tabbar-item icon="search">測試</van-tabbar-item>
-              <van-tabbar-item icon="friends-o">測試</van-tabbar-item>
-              <van-tabbar-item icon="setting-o">測試</van-tabbar-item>
+              <van-tabbar-item icon="home-o">首页</van-tabbar-item>
+              <van-tabbar-item icon="search">直播</van-tabbar-item>
+              <van-tabbar-item icon="friends-o">往期</van-tabbar-item>
+              <van-tabbar-item icon="setting-o">我的</van-tabbar-item>
             </van-tabbar>
           </van-col>
         </van-col>
@@ -78,6 +78,7 @@
 
 <script>
 import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
+const { mapActions: room } = createNamespacedHelpers('room');
 const jwt = require('jsonwebtoken');
 export default {
   name: 'index',
@@ -92,6 +93,12 @@ export default {
     navShow: true,
     // 轮播图
     swipList: [
+      {
+        url: require('@/assets/7.png'),
+      },
+      {
+        url: require('@/assets/6.png'),
+      },
       {
         url: require('@/assets/1.jpg'),
       },
@@ -107,40 +114,9 @@ export default {
       {
         url: require('@/assets/5.jpg'),
       },
-      {
-        url: require('@/assets/6.png'),
-      },
-      {
-        url: require('@/assets/7.png'),
-      },
     ],
     // 往期直播
-    videoList: [
-      {
-        videoUrl: require('@/assets/test1.jpg'),
-        title: '测试标题',
-      },
-      {
-        videoUrl: require('@/assets/test1.jpg'),
-        title: '测试标题',
-      },
-      {
-        videoUrl: require('@/assets/test1.jpg'),
-        title: '测试标题',
-      },
-      {
-        videoUrl: require('@/assets/test1.jpg'),
-        title: '测试标题',
-      },
-      {
-        videoUrl: require('@/assets/test1.jpg'),
-        title: '测试标题',
-      },
-      {
-        videoUrl: require('@/assets/test1.jpg'),
-        title: '测试标题',
-      },
-    ],
+    videoList: [],
     // 底部标签
     active: 0,
   }),
@@ -148,9 +124,19 @@ export default {
     if (this.token) {
       this.sesstoken();
     }
+    this.searchInfo();
   },
   methods: {
     ...mapMutations(['setUser']),
+    ...room({ roomQuery: 'query' }),
+    async searchInfo() {
+      const info = {};
+      info.ishis = '1';
+      let res = await this.roomQuery(info);
+      if (this.$checkRes(res)) {
+        this.$set(this, `videoList`, res.data);
+      }
+    },
     sesstoken() {
       sessionStorage.setItem('token', this.token);
       let user = jwt.decode(this.token);
@@ -175,7 +161,6 @@ export default {
 <style lang="less" scoped>
 .style {
   .banner {
-    border-bottom: 1px solid red;
     .swipList {
       width: 100%;
       height: 200px;