reghao 2 лет назад
Родитель
Сommit
4f21f491d9
5 измененных файлов с 36 добавлено и 42 удалено
  1. 23 10
      src/views/home/Discover.vue
  2. 7 1
      src/views/home/Index.vue
  3. 1 1
      src/views/user/Collection.vue
  4. 1 1
      src/views/user/History.vue
  5. 4 29
      src/views/user/Home.vue

+ 23 - 10
src/views/home/Discover.vue

@@ -4,8 +4,8 @@
     <el-row id="movie-list">
     <el-row id="movie-list">
       <!--电影列表-->
       <!--电影列表-->
       <el-col :md="24">
       <el-col :md="24">
-        <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
-          <image-card :video="video" />
+        <el-col v-for="(user, index) in userList" :key="index" :md="6" :sm="12" :xs="12">
+          <user-card :user="user"></user-card>
         </el-col>
         </el-col>
         <!--
         <!--
           分页按钮:
           分页按钮:
@@ -27,34 +27,41 @@
         </el-col>
         </el-col>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
+    <el-row v-if="showEmpty" class="not-result">
+      <el-col :span="12" :offset="6">
+        <img src="@/assets/img/icon/not-result.png">
+        <div>没有发现用户呢</div>
+      </el-col>
+    </el-row>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import ImageCard from 'components/card/ImageCard'
-import { videoRecommend } from '@/api/video'
+import UserCard from '@/components/card/UserCard'
+import { getUserInfo } from "@/api/user";
 
 
 export default {
 export default {
   name: 'Discover',
   name: 'Discover',
-  components: { ImageCard },
+  components: { UserCard },
   data() {
   data() {
     return {
     return {
       // 屏幕宽度, 为了控制分页条的大小
       // 屏幕宽度, 为了控制分页条的大小
       screenWidth: document.body.clientWidth,
       screenWidth: document.body.clientWidth,
       currentPage: 1,
       currentPage: 1,
-      videoList: []
+      userList: [],
+      showEmpty: true
     }
     }
   },
   },
   created() {
   created() {
     document.title = '发现'
     document.title = '发现'
     this.currentPage = 1
     this.currentPage = 1
-    videoRecommend(this.currentPage).then(res => {
+    /*videoRecommend(this.currentPage).then(res => {
       if (res.code === 0) {
       if (res.code === 0) {
         const resData = res.data
         const resData = res.data
-        this.videoList = resData.list
+        this.userList = resData.list
       }
       }
-    })
-    // console.log(this.$store.state.videos);
+    })*/
+    // this.showEmpty = false
     // 当页面挂载时,页码变为1
     // 当页面挂载时,页码变为1
     this.$store.commit('updatePage', 1)
     this.$store.commit('updatePage', 1)
   },
   },
@@ -86,6 +93,12 @@ export default {
   padding-right: 6%;
   padding-right: 6%;
 }
 }
 
 
+.not-result {
+  padding-top: 100px;
+  padding-bottom: 100px;
+  text-align: center;
+}
+
 .pagination {
 .pagination {
   text-align: center;
   text-align: center;
   padding: 10px;
   padding: 10px;

+ 7 - 1
src/views/home/Index.vue

@@ -19,7 +19,7 @@
     <el-row v-else class="not-result">
     <el-row v-else class="not-result">
       <el-col :span="12" :offset="6">
       <el-col :span="12" :offset="6">
         <img src="@/assets/img/icon/not-collection.png">
         <img src="@/assets/img/icon/not-collection.png">
-        <div>暂无推荐数据</div>
+        <div>推荐数据正在计算中</div>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
   </div>
   </div>
@@ -102,6 +102,12 @@ export default {
   padding-right: 6%;
   padding-right: 6%;
 }
 }
 
 
+.not-result {
+  padding-top: 100px;
+  padding-bottom: 100px;
+  text-align: center;
+}
+
 /*处于手机屏幕时*/
 /*处于手机屏幕时*/
 @media screen and (max-width: 768px){
 @media screen and (max-width: 768px){
   #movie-list {
   #movie-list {

+ 1 - 1
src/views/user/Collection.vue

@@ -38,7 +38,7 @@
     <el-row v-else class="not-result">
     <el-row v-else class="not-result">
       <el-col :span="12" :offset="6">
       <el-col :span="12" :offset="6">
         <img src="@/assets/img/icon/not-collection.png">
         <img src="@/assets/img/icon/not-collection.png">
-        <div>暂无收藏</div>
+        <div>你还没有收藏任何东西呢</div>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
   </div>
   </div>

+ 1 - 1
src/views/user/History.vue

@@ -35,7 +35,7 @@
     <el-row v-else class="not-result">
     <el-row v-else class="not-result">
       <el-col :span="12" :offset="6">
       <el-col :span="12" :offset="6">
         <img src="@/assets/img/icon/not-history.png">
         <img src="@/assets/img/icon/not-history.png">
-        <div>无播放历史</div>
+        <div>你还没有看过任何东西呢</div>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
 
 

+ 4 - 29
src/views/user/Home.vue

@@ -138,7 +138,7 @@
     <el-row v-if="showEmpty" class="not-result">
     <el-row v-if="showEmpty" class="not-result">
       <el-col :span="12" :offset="6">
       <el-col :span="12" :offset="6">
         <img src="@/assets/img/icon/not-collection.png">
         <img src="@/assets/img/icon/not-collection.png">
-        <div>暂无内容</div>
+        <div>该用户还没发布任何东西呢</div>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
   </div>
   </div>
@@ -173,7 +173,7 @@ export default {
       statusList: [],
       statusList: [],
       followerList: [],
       followerList: [],
       followingList: [],
       followingList: [],
-      showEmpty: false,
+      showEmpty: true,
       videoCount: 0,
       videoCount: 0,
       statusCount: 0,
       statusCount: 0,
       followingCount: 0,
       followingCount: 0,
@@ -228,7 +228,8 @@ export default {
         this.followerCount = resData.userFollowCount.followerCount
         this.followerCount = resData.userFollowCount.followerCount
       }
       }
     })
     })
-    this.userVideoListWrapper(1, this.userId, 0)
+    //this.userVideoListWrapper(1, this.userId, 0)
+    this.getData()
   },
   },
   mounted() {
   mounted() {
     // 当窗口宽度改变时获取屏幕宽度
     // 当窗口宽度改变时获取屏幕宽度
@@ -282,44 +283,18 @@ export default {
           return
           return
         }
         }
         this.$router.push(path)
         this.$router.push(path)
-
-        /*this.currentPage = 1
-        this.lastId = 0
-        this.userStatusListWrapper(this.currentPage, this.userId, this.lastId)*/
       } else if (this.activeName === 'video') {
       } else if (this.activeName === 'video') {
         this.goToTab(this.activeName)
         this.goToTab(this.activeName)
-        /*this.currentPage = 1
-        this.lastId = 0
-        this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)*/
       } else if (this.activeName === 'image') {
       } else if (this.activeName === 'image') {
         this.goToTab(this.activeName)
         this.goToTab(this.activeName)
-        /*this.currentPage = 1
-        this.lastId = 0
-        this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)*/
       } else if (this.activeName === 'audio') {
       } else if (this.activeName === 'audio') {
         this.goToTab(this.activeName)
         this.goToTab(this.activeName)
-        /*this.currentPage = 1
-        this.lastId = 0
-        this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)*/
       } else if (this.activeName === 'article') {
       } else if (this.activeName === 'article') {
         this.goToTab(this.activeName)
         this.goToTab(this.activeName)
-        /*this.currentPage = 1
-        this.lastId = 0
-        this.userVideoListWrapper(this.currentPage, this.userId, this.lastId)*/
       } else if (this.activeName === 'following') {
       } else if (this.activeName === 'following') {
         this.goToTab(this.activeName)
         this.goToTab(this.activeName)
-        /*getUserFollowing(this.userId).then(res => {
-          if (res.code === 0) {
-            this.followingList = res.data
-          }
-        })*/
       } else if (this.activeName === 'follower') {
       } else if (this.activeName === 'follower') {
         this.goToTab(this.activeName)
         this.goToTab(this.activeName)
-        /*getUserFollower(this.userId).then(res => {
-          if (res.code === 0) {
-            this.followerList = res.data
-          }
-        })*/
       }
       }
     },
     },
     goToTab(activeName) {
     goToTab(activeName) {