Forráskód Böngészése

update Timeline.vue

reghao 2 éve
szülő
commit
8866c9e6da
1 módosított fájl, 15 hozzáadás és 23 törlés
  1. 15 23
      src/views/home/Timeline.vue

+ 15 - 23
src/views/home/Timeline.vue

@@ -1,14 +1,11 @@
 <template>
   <div>
-    <el-row>
-      <el-col :md="3">
-        <hot-search />
-      </el-col>
-      <el-col :md="18">
-        <el-row class="movie-list">
+    <el-row class="movie-list">
+      <el-col :md="12">
+        <el-row>
           <text-card />
         </el-row>
-        <el-row class="movie-list">
+        <el-row>
           <el-tabs v-model="activeName" @tab-click='tabClick'>
             <el-tab-pane label="视频" name="video">
               <div v-if="activeName === 'video'">
@@ -31,9 +28,6 @@
           </el-tabs>
         </el-row>
       </el-col>
-      <el-col :md="3">
-        <hot-video />
-      </el-col>
     </el-row>
   </div>
 </template>
@@ -42,15 +36,13 @@
 import TextCard from '@/components/card/TextCard'
 import StatusCard from '@/components/card/StatusCard'
 import VideoCard from '@/components/card/VideoCard'
-import HotVideo from '@/components/card/HotVideo'
-import HotSearch from '@/components/card/HotSearch'
-import { getUserInfo } from '@/utils/auth'
+
 import { statusTimeline, videoTimeline } from '@/api/timeline'
 import {getMyInfo} from "@/api/user";
 
 export default {
   name: 'Timeline',
-  components: { TextCard, StatusCard, VideoCard, HotVideo, HotSearch },
+  components: { TextCard, StatusCard, VideoCard },
   data() {
     return {
       // 屏幕宽度, 为了控制分页条的大小
@@ -82,6 +74,15 @@ export default {
     }
   },
   methods: {
+    tabClick(tab) {
+      this.nextId = 0
+      const tabName = tab.name
+      if (tabName === 'video') {
+        this.videoTimelineWrapper(this.nextId)
+      } else if (tabName === 'status') {
+        this.statusTimelineWrapper(this.nextId)
+      }
+    },
     statusTimelineWrapper(nextId) {
       statusTimeline(nextId).then(res => {
         if (res.code === 0) {
@@ -99,15 +100,6 @@ export default {
           this.nextId = resData.nextId
         }
       })
-    },
-    tabClick(tab) {
-      this.nextId = 0
-      const tabName = tab.name
-      if (tabName === 'video') {
-        this.videoTimelineWrapper(this.nextId)
-      } else if (tabName === 'status') {
-        this.statusTimelineWrapper(this.nextId)
-      }
     }
   }
 }