wxy 4 năm trước cách đây
mục cha
commit
7ab686254f
1 tập tin đã thay đổi với 22 bổ sung17 xóa
  1. 22 17
      src/views/kjpdhall/index.vue

+ 22 - 17
src/views/kjpdhall/index.vue

@@ -35,7 +35,7 @@
                       视频列表
                     </el-col>
                     <el-col :span="24" class="list">
-                      <el-col :span="24" class="videolist" v-for="(item, index) in videolist" :key="index">
+                      <el-col :span="24" class="videolist" v-for="(item, index) in videolist" :key="index" @click.native="show(item)">
                         <p>{{ item.title }}</p>
                       </el-col>
                     </el-col>
@@ -72,6 +72,7 @@
 import liveFoot from '@/layout/live/foot.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: channel } = createNamespacedHelpers('channel');
+const { mapActions: channelvideo } = createNamespacedHelpers('channelvideo');
 var moment = require('moment');
 export default {
   name: 'index',
@@ -82,29 +83,16 @@ export default {
       // 信息详情
       info: {},
       videoUrl: '',
-      videolist: [
-        { title: '节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-        { title: '节目单' },
-      ],
+      videolist: [],
     };
   },
   async created() {
     await this.search();
+    // await this.searchVedio();
   },
   methods: {
     ...channel(['query', 'fetch', 'update', 'create', 'delete']),
+    ...channelvideo({ videoquery: 'query', videofetch: 'fetch', videoupdate: 'update', videocreate: 'create', videodelete: 'delete' }),
     async search() {
       let id = this.$route.query.id;
       if (id) {
@@ -113,10 +101,27 @@ export default {
           this.$set(this, `info`, res.data);
         }
       }
+      const res = await this.videoquery({ user_id: this.id });
+      if (this.$checkRes(res)) {
+        this.$set(this, `videolist`, res.data);
+      }
+    },
+    show(data) {
+      console.log(data);
+      this.videoUrl = data.file_path;
     },
+    // async searchVedio() {
+    //   const res = await this.videoquery({ user_id: this.id });
+    //   if (this.$checkRes(res)) {
+    //     this.$set(this, `videolist`, res.data);
+    //   }
+    // },
   },
   computed: {
     ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };