瀏覽代碼

科技培训

guhongwei 4 年之前
父節點
當前提交
941d577d00
共有 3 個文件被更改,包括 52 次插入8 次删除
  1. 4 4
      src/layout/kjpx/right.vue
  2. 8 2
      src/layout/kjpx/videos.vue
  3. 40 2
      src/views/kjpx/index copy.vue

+ 4 - 4
src/layout/kjpx/right.vue

@@ -11,7 +11,7 @@
                   {{ item.title }}
                 </el-col>
                 <el-col :span="4" class="date textOver">
-                  {{ item.date }}
+                  {{ item.create_time }}
                 </el-col>
               </el-col>
             </el-col>
@@ -24,7 +24,7 @@
                   {{ item.title }}
                 </el-col>
                 <el-col :span="4" class="date textOver">
-                  {{ item.date }}
+                  {{ item.create_time }}
                 </el-col>
               </el-col>
             </el-col>
@@ -37,7 +37,7 @@
                   {{ item.title }}
                 </el-col>
                 <el-col :span="4" class="date textOver">
-                  {{ item.date }}
+                  {{ item.create_time }}
                 </el-col>
               </el-col>
             </el-col>
@@ -50,7 +50,7 @@
                   {{ item.title }}
                 </el-col>
                 <el-col :span="4" class="date textOver">
-                  {{ item.date }}
+                  {{ item.create_time }}
                 </el-col>
               </el-col>
             </el-col>

+ 8 - 2
src/layout/kjpx/videos.vue

@@ -14,7 +14,7 @@
         <el-col :span="24" class="info">
           <el-col :span="24" class="videoList" v-for="(item, index) in videoList" :key="index">
             <el-col :span="3" class="date textOver">
-              {{ item.date }}
+              {{ getdata(item.create_time) }}
             </el-col>
             <el-col :span="21" class="listright">
               <el-col :span="24" class="title textOver">
@@ -33,6 +33,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
+var moment = require('moment');
 export default {
   name: 'videos',
   props: {
@@ -43,7 +44,12 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    getdata(value) {
+      let date = moment(value).format('MM-DD');
+      if (date) return date;
+    },
+  },
   computed: {
     ...mapState(['user']),
   },

+ 40 - 2
src/views/kjpx/index copy.vue

@@ -36,6 +36,9 @@ import foot from '@/components/common/foot.vue';
 import videos from '@/layout/kjpx/videos.vue';
 import right from '@/layout/kjpx/right.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: videomeet } = createNamespacedHelpers('videomeet');
+const { mapActions: traincolumn } = createNamespacedHelpers('traincolumn');
+const { mapActions: trainnews } = createNamespacedHelpers('trainnews');
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -111,8 +114,43 @@ export default {
       ],
     };
   },
-  created() {},
-  methods: {},
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...videomeet({ videomeetquery: 'query' }),
+    ...traincolumn({ columnquery: 'query', columnfetch: 'fetch' }),
+    ...trainnews({ connewsquery: 'query', connewsfetch: 'fetch' }),
+    async search() {
+      let res = await this.videomeetquery({ limit: 7 });
+      if (this.$checkRes(res)) {
+        this.$set(this, `videoList`, res.data);
+      }
+      res = await this.columnquery();
+      if (this.$checkRes(res)) {
+        let ztyt = res.data.find(i => i.site == 'ztyt');
+        if (ztyt) {
+          let res = await this.connewsquery({ limit: 16, column_id: ztyt.id });
+          if (this.$checkRes(res)) this.$set(this, `${ztyt.site}List`, res.data);
+        }
+        let jswd = res.data.find(i => i.site == 'jswd');
+        if (jswd) {
+          let res = await this.connewsquery({ limit: 16, column_id: jswd.id });
+          if (this.$checkRes(res)) this.$set(this, `${jswd.site}List`, res.data);
+        }
+        let hyyj = res.data.find(i => i.site == 'hyyj');
+        if (hyyj) {
+          let res = await this.connewsquery({ limit: 16, column_id: hyyj.id });
+          if (this.$checkRes(res)) this.$set(this, `${hyyj.site}List`, res.data);
+        }
+        let jypx = res.data.find(i => i.site == 'jypx');
+        if (jypx) {
+          let res = await this.connewsquery({ limit: 16, column_id: jypx.id });
+          if (this.$checkRes(res)) this.$set(this, `${jypx.site}List`, res.data);
+        }
+      }
+    },
+  },
   computed: {
     ...mapState(['user']),
   },