Skip to content

Commit

Permalink
feat: support sort
Browse files Browse the repository at this point in the history
  • Loading branch information
ADKcodeXD committed May 9, 2024
1 parent 192c917 commit df2d710
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composables/useActivityMainPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const useActivityMain = () => {
const getVideoByDay = async (day: number, activityId: number) => {
isLoading.value = true
const { data } = await getMovieByActivityId(activityId, day)
movies.value = data?.result || []
movies.value = data?.result.sort((a, b) => (a.sortIndex || 0) - (b.sortIndex || 0)) || []
activeVideo.value = (movies.value && movies.value[0]) || null
players.value = []
isLoading.value = false
Expand Down
2 changes: 2 additions & 0 deletions types/movie.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ declare module 'Movie' {
* 关联活动id 如果不存在则为非活动作品
*/
activityId: null | number

sortIndex: null | number
/**
* 作者id 可以关联本站拥有的用户 如果不存在可以输入作者名
*/
Expand Down

0 comments on commit df2d710

Please sign in to comment.