reghao 2 роки тому
батько
коміт
2f633b761f

+ 2 - 1
src/api/video.js

@@ -10,9 +10,10 @@ const videoApi = {
   videoUrlApi: '/api/content/video/url',
   videoSubmitApi: '/api/content/video/submit',
   userVideoListApi: '/api/content/video/user',
-  userContentDataApi: '/api/content/video/userdata',
   hotVideoApi: '/api/content/video/hot',
 
+  userContentDataApi: '/api/content/userdata',
+
   playerRecordApi: '/api/media/video/play/record',
   userRecentlyVideoListApi: '/api/media/video/post/user/recently',
   testVideoApi: '/api/media/video/post/display'

+ 1 - 1
src/components/card/ImageAlbumCard.vue

@@ -11,7 +11,7 @@
               class="coverImg"
             />
             <span style="position: absolute; bottom: 0; right: 0; color:white">
-              <i v-if="true" class="el-icon-picture-outline">123</i>
+              <i class="el-icon-picture-outline">{{imageAlbum.total}}</i>
             </span>
           </div>
         </router-link>

+ 6 - 0
src/views/home/Video.vue

@@ -175,6 +175,12 @@ export default {
       videoPage(pageNumber, prevId, nextId, categoryId).then(res => {
         if (res.code === 0) {
           const resData = res.data
+          if (resData.list.length > 0) {
+            this.showEmpty = false
+          } else {
+            this.showEmpty = true
+          }
+
           this.videoList = resData.list
           this.totalPages = resData.totalPages
           this.totalSize = resData.totalSize

+ 20 - 28
src/views/user/Home.vue

@@ -47,19 +47,9 @@
     <el-row>
       <el-col :md="24" class="movie-list">
         <el-tabs v-model="activeName" @tab-click='tabClick'>
-          <el-tab-pane name="status">
-            <span slot="label">
-              状态<el-badge :value="statusCount" :max="9999" class="item" type="warning"/>
-            </span>
-            <div v-if="activeName === 'status'">
-              <el-row v-for="(status, index) in statusList" :key="index" :md="16" :sm="12" :xs="12">
-                <status-card :status="status" />
-              </el-row>
-            </div>
-          </el-tab-pane>
           <el-tab-pane name="video">
             <span slot="label">
-              视频<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
+              视频<el-badge :value="userContentData.videoCount" :max="9999" class="item" type="warning"/>
             </span>
             <div v-if="activeName === 'video'">
               <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
@@ -69,7 +59,7 @@
           </el-tab-pane>
           <el-tab-pane name="image">
             <span slot="label">
-              相册<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
+              相册<el-badge :value="userContentData.albumCount" :max="9999" class="item" type="warning"/>
             </span>
             <div v-if="activeName === 'image'">
               <el-col v-for="(album, index) in dataList" :key="index" :md="6" :sm="12" :xs="12">
@@ -79,7 +69,7 @@
           </el-tab-pane>
           <el-tab-pane name="audio">
             <span slot="label">
-              音频<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
+              音频<el-badge :value="userContentData.audioCount" :max="9999" class="item" type="warning"/>
             </span>
             <div v-if="activeName === 'audio'">
               <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
@@ -87,9 +77,10 @@
               </el-col>
             </div>
           </el-tab-pane>
+          <!--
           <el-tab-pane name="article">
             <span slot="label">
-              文章<el-badge :value="videoCount" :max="9999" class="item" type="warning"/>
+              文章<el-badge :value="userContentData.articleCount" :max="9999" class="item" type="warning"/>
             </span>
             <div v-if="activeName === 'article'">
               <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
@@ -97,9 +88,19 @@
               </el-col>
             </div>
           </el-tab-pane>
+          <el-tab-pane name="status">
+            <span slot="label">
+              状态<el-badge :value="userContentData.statusCount" :max="9999" class="item" type="warning"/>
+            </span>
+            <div v-if="activeName === 'status'">
+              <el-row v-for="(status, index) in statusList" :key="index" :md="16" :sm="12" :xs="12">
+                <status-card :status="status" />
+              </el-row>
+            </div>
+          </el-tab-pane>-->
           <el-tab-pane name="following">
             <span slot="label">
-              Ta 的关注<el-badge :value="followingCount" :max="9999" class="item" type="warning"/>
+              Ta 的关注<el-badge :value="userContentData.userFollowCount.followingCount" :max="9999" class="item" type="warning"/>
             </span>
             <div v-if="activeName === 'following'">
               <el-col v-for="(user, index) in followingList" :key="index" :md="6" :sm="12" :xs="12">
@@ -109,7 +110,7 @@
           </el-tab-pane>
           <el-tab-pane name="follower">
             <span slot="label">
-              Ta 的粉丝<el-badge :value="followerCount" :max="9999" class="item" type="warning"/>
+              Ta 的粉丝<el-badge :value="userContentData.userFollowCount.followerCount" :max="9999" class="item" type="warning"/>
             </span>
             <div v-if="activeName === 'follower'">
               <el-col v-for="(user, index) in followerList" :key="index" :md="6" :sm="12" :xs="12">
@@ -168,7 +169,7 @@ export default {
         icon: 'el-icon-plus',
         text: '关注'
       },
-      activeName: 'status',
+      activeName: 'video',
       currentPage: 1,
       pageSize: 12,
       totalSize: 0,
@@ -178,10 +179,7 @@ export default {
       followerList: [],
       followingList: [],
       showEmpty: true,
-      videoCount: 0,
-      statusCount: 0,
-      followingCount: 0,
-      followerCount: 0
+      userContentData: null
     }
   },
   created() {
@@ -190,8 +188,6 @@ export default {
       if (res.code === 0) {
         this.user = res.data
         const path = this.$route.path
-        console.log('path = ' + path)
-        console.log(path.endsWith("video"))
         if (path.endsWith("video")) {
           this.activeName = 'video'
           document.title = this.user.screenName + '的视频'
@@ -228,11 +224,7 @@ export default {
 
     getUserContentData(this.userId).then(res => {
       if (res.code === 0) {
-        const resData = res.data
-        this.videoCount = resData.videoCount
-        this.statusCount = resData.statusCount
-        this.followingCount = resData.userFollowCount.followingCount
-        this.followerCount = resData.userFollowCount.followerCount
+        this.userContentData = res.data
       }
     })
   },