Parcourir la source

添加获取视频收藏夹接口

reghao il y a 2 ans
Parent
commit
520a6f7ed4

+ 7 - 1
src/api/collect.js

@@ -3,7 +3,8 @@ import { get, post, delete0 } from '@/utils/request'
 const collectApi = {
   collectItemApi: '/api/content/favlist/collect',
   userFavlistApi: '/api/content/favlist/user',
-  favlistApi: '/api/content/favlist'
+  favlistApi: '/api/content/favlist',
+  videoFavlistApi: '/api/content/favlist/video'
 }
 
 // 收藏(取消收藏)内容
@@ -25,3 +26,8 @@ export function getUserFavlist() {
 export function getFavlist(favlistId, contentType, page) {
   return get(collectApi.favlistApi + '?favlistId=' + favlistId + '&contentType=' + contentType + '&page=' + page)
 }
+
+// 获取视频收藏夹内容
+export function getVideoFavlist(favlistId, page) {
+  return get(collectApi.favlistApi + '?favlistId=' + favlistId + '&page=' + page)
+}

+ 2 - 2
src/components/card/HistoryVideoCard.vue

@@ -23,7 +23,7 @@
             <span style="position: absolute; bottom: 0; right: 0; color:white"> {{ video.duration }} </span>
           </div>
         </router-link>
-        <el-progress :percentage="setItemProgress(video)"/>
+        <el-progress :percentage="setItemProgress(video)" />
         <div style="padding: 14px">
           <router-link target="_blank" :to="`/video/${video.videoId}`">
             <span style="left: 0;margin-bottom: 0px;color: black;">{{ video.title | ellipsis }}</span>
@@ -79,7 +79,7 @@ export default {
       return handleVisited(visited)
     },
     convertTimestamp(value) {
-      const date = new Date(value*1000)
+      const date = new Date(value * 1000)
       var month = date.getMonth()
       if (month < 10) {
         if (month === 0) {

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

@@ -86,7 +86,7 @@ export default {
       return handleVisited(visited)
     },
     convertTimestamp(value) {
-      const date = new Date(value*1000)
+      const date = new Date(value * 1000)
       var month = date.getMonth()
       if (month < 10) {
         if (month === 0) {

+ 0 - 8
src/router/index.js

@@ -6,7 +6,6 @@ import Vue from 'vue'
 // 应用主页
 const Home = () => import('views/home/Index')
 const TimelineIndex = () => import('views/home/Timeline')
-const StatusPage = () => import('views/home/Status')
 const VideoIndex = () => import('views/home/Video')
 const ShortVideoIndex = () => import('views/home/ShortVideo')
 const VideoPage = () => import('views/home/VideoPage')
@@ -58,15 +57,8 @@ const PostPublishFile = () => import('components/upload/PublishFile')
 const UserPostVideo = () => import('views/post/VideoPost')
 const PostEditVideo = () => import('components/upload/EditVideo')
 const UserPostAudio = () => import('views/post/AudioPost')
-const PostEditAudio = () => import('components/upload/EditAudio')
 const UserPostImage = () => import('views/post/ImagePost')
-const PostEditAlbum = () => import('components/upload/EditImage')
 const UserPostArticle = () => import('views/post/ArticlePost')
-const PostEditArticle = () => import('components/upload/EditArticle')
-
-const PostPublish = () => import('views/post/PostPublish')
-const PostList = () => import('views/post/PostList')
-const PostAnalysis = () => import('views/post/PostAnalysis')
 
 // 使用安装路由插件
 Vue.use(VueRouter)

+ 4 - 1
src/views/my/FavlistVideo.vue

@@ -58,7 +58,7 @@ import VideoCard from '@/components/card/VideoCard'
 import {
   deleteFavlist,
   getFavlist,
-  collectItem
+  collectItem, getUserFavlist
 } from '@/api/collect'
 
 export default {
@@ -78,6 +78,9 @@ export default {
   },
   created() {
     this.getFavlistWrapper(this.favlistId, this.contentType, this.currentPage)
+    getUserFavlist().then(resp => {
+      console.log(resp.data)
+    })
     document.title = '视频收藏夹'
   },
   methods: {