diff --git a/src/components/MusicList.vue b/src/components/MusicList.vue new file mode 100644 index 0000000..38f36d9 --- /dev/null +++ b/src/components/MusicList.vue @@ -0,0 +1,77 @@ + + + + + \ No newline at end of file diff --git a/src/components/common/PlayBottom.vue b/src/components/common/PlayBottom.vue new file mode 100644 index 0000000..4cb1a03 --- /dev/null +++ b/src/components/common/PlayBottom.vue @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/src/layout/AppLayout.vue b/src/layout/AppLayout.vue index bc6abe0..cb258dd 100644 --- a/src/layout/AppLayout.vue +++ b/src/layout/AppLayout.vue @@ -67,9 +67,8 @@ const menus = store.state.menus; @apply pr-6 flex-1 box-border; height: 100vh; &-content { - @apply rounded-2xl; + @apply rounded-2xl pb-28 box-border; height: calc(100vh - 60px); - margin-bottom: 90px; } &-page { margin: 20px 0; diff --git a/src/type/listDetail.ts b/src/type/listDetail.ts index e397c67..5031b59 100644 --- a/src/type/listDetail.ts +++ b/src/type/listDetail.ts @@ -1,203 +1,203 @@ -export interface IListDetail { - code: number; - relatedVideos?: any; - playlist: Playlist; - urls?: any; - privileges: Privilege[]; - sharedPrivilege?: any; - resEntrance?: any; -} - -interface Privilege { - id: number; - fee: number; - payed: number; - realPayed: number; - st: number; - pl: number; - dl: number; - sp: number; - cp: number; - subp: number; - cs: boolean; - maxbr: number; - fl: number; - pc?: any; - toast: boolean; - flag: number; - paidBigBang: boolean; - preSell: boolean; - playMaxbr: number; - downloadMaxbr: number; - rscl?: any; - freeTrialPrivilege: FreeTrialPrivilege; - chargeInfoList: ChargeInfoList[]; -} - -interface ChargeInfoList { - rate: number; - chargeUrl?: any; - chargeMessage?: any; - chargeType: number; -} - -interface FreeTrialPrivilege { - resConsumable: boolean; - userConsumable: boolean; -} - -interface Playlist { - id: number; - name: string; - coverImgId: number; - coverImgUrl: string; - coverImgId_str: string; - adType: number; - userId: number; - createTime: number; - status: number; - opRecommend: boolean; - highQuality: boolean; - newImported: boolean; - updateTime: number; - trackCount: number; - specialType: number; - privacy: number; - trackUpdateTime: number; - commentThreadId: string; - playCount: number; - trackNumberUpdateTime: number; - subscribedCount: number; - cloudTrackCount: number; - ordered: boolean; - description: string; - tags: string[]; - updateFrequency?: any; - backgroundCoverId: number; - backgroundCoverUrl?: any; - titleImage: number; - titleImageUrl?: any; - englishTitle?: any; - officialPlaylistType?: any; - subscribers: Subscriber[]; - subscribed: boolean; - creator: Subscriber; - tracks: Track[]; - videoIds?: any; - videos?: any; - trackIds: TrackId[]; - shareCount: number; - commentCount: number; - remixVideo?: any; - sharedUsers?: any; - historySharedUsers?: any; -} - -interface TrackId { - id: number; - v: number; - t: number; - at: number; - alg?: any; - uid: number; - rcmdReason: string; -} - -interface Track { - name: string; - id: number; - pst: number; - t: number; - ar: Ar[]; - alia: string[]; - pop: number; - st: number; - rt?: string; - fee: number; - v: number; - crbt?: any; - cf: string; - al: Al; - dt: number; - h: H; - m: H; - l?: H; - a?: any; - cd: string; - no: number; - rtUrl?: any; - ftype: number; - rtUrls: any[]; - djId: number; - copyright: number; - s_id: number; - mark: number; - originCoverType: number; - originSongSimpleData?: any; - single: number; - noCopyrightRcmd?: any; - mst: number; - cp: number; - mv: number; - rtype: number; - rurl?: any; - publishTime: number; - tns?: string[]; -} - -interface H { - br: number; - fid: number; - size: number; - vd: number; -} - -interface Al { - id: number; - name: string; - picUrl: string; - tns: any[]; - pic_str?: string; - pic: number; -} - -interface Ar { - id: number; - name: string; - tns: any[]; - alias: any[]; -} - -interface Subscriber { - defaultAvatar: boolean; - province: number; - authStatus: number; - followed: boolean; - avatarUrl: string; - accountStatus: number; - gender: number; - city: number; - birthday: number; - userId: number; - userType: number; - nickname: string; - signature: string; - description: string; - detailDescription: string; - avatarImgId: number; - backgroundImgId: number; - backgroundUrl: string; - authority: number; - mutual: boolean; - expertTags?: any; - experts?: any; - djStatus: number; - vipType: number; - remarkName?: any; - authenticationTypes: number; - avatarDetail?: any; - backgroundImgIdStr: string; - anchor: boolean; - avatarImgIdStr: string; - avatarImgId_str: string; -} +export interface IListDetail { + code: number; + relatedVideos?: any; + playlist: Playlist; + urls?: any; + privileges: Privilege[]; + sharedPrivilege?: any; + resEntrance?: any; +} + +interface Privilege { + id: number; + fee: number; + payed: number; + realPayed: number; + st: number; + pl: number; + dl: number; + sp: number; + cp: number; + subp: number; + cs: boolean; + maxbr: number; + fl: number; + pc?: any; + toast: boolean; + flag: number; + paidBigBang: boolean; + preSell: boolean; + playMaxbr: number; + downloadMaxbr: number; + rscl?: any; + freeTrialPrivilege: FreeTrialPrivilege; + chargeInfoList: ChargeInfoList[]; +} + +interface ChargeInfoList { + rate: number; + chargeUrl?: any; + chargeMessage?: any; + chargeType: number; +} + +interface FreeTrialPrivilege { + resConsumable: boolean; + userConsumable: boolean; +} + +export interface Playlist { + id: number + name: string + coverImgId: number + coverImgUrl: string + coverImgId_str: string + adType: number + userId: number + createTime: number + status: number + opRecommend: boolean + highQuality: boolean + newImported: boolean + updateTime: number + trackCount: number + specialType: number + privacy: number + trackUpdateTime: number + commentThreadId: string + playCount: number + trackNumberUpdateTime: number + subscribedCount: number + cloudTrackCount: number + ordered: boolean + description: string + tags: string[] + updateFrequency?: any + backgroundCoverId: number + backgroundCoverUrl?: any + titleImage: number + titleImageUrl?: any + englishTitle?: any + officialPlaylistType?: any + subscribers: Subscriber[] + subscribed: boolean + creator: Subscriber + tracks: Track[] + videoIds?: any + videos?: any + trackIds: TrackId[] + shareCount: number + commentCount: number + remixVideo?: any + sharedUsers?: any + historySharedUsers?: any +} + +interface TrackId { + id: number; + v: number; + t: number; + at: number; + alg?: any; + uid: number; + rcmdReason: string; +} + +interface Track { + name: string; + id: number; + pst: number; + t: number; + ar: Ar[]; + alia: string[]; + pop: number; + st: number; + rt?: string; + fee: number; + v: number; + crbt?: any; + cf: string; + al: Al; + dt: number; + h: H; + m: H; + l?: H; + a?: any; + cd: string; + no: number; + rtUrl?: any; + ftype: number; + rtUrls: any[]; + djId: number; + copyright: number; + s_id: number; + mark: number; + originCoverType: number; + originSongSimpleData?: any; + single: number; + noCopyrightRcmd?: any; + mst: number; + cp: number; + mv: number; + rtype: number; + rurl?: any; + publishTime: number; + tns?: string[]; +} + +interface H { + br: number; + fid: number; + size: number; + vd: number; +} + +interface Al { + id: number; + name: string; + picUrl: string; + tns: any[]; + pic_str?: string; + pic: number; +} + +interface Ar { + id: number; + name: string; + tns: any[]; + alias: any[]; +} + +interface Subscriber { + defaultAvatar: boolean; + province: number; + authStatus: number; + followed: boolean; + avatarUrl: string; + accountStatus: number; + gender: number; + city: number; + birthday: number; + userId: number; + userType: number; + nickname: string; + signature: string; + description: string; + detailDescription: string; + avatarImgId: number; + backgroundImgId: number; + backgroundUrl: string; + authority: number; + mutual: boolean; + expertTags?: any; + experts?: any; + djStatus: number; + vipType: number; + remarkName?: any; + authenticationTypes: number; + avatarDetail?: any; + backgroundImgIdStr: string; + anchor: boolean; + avatarImgIdStr: string; + avatarImgId_str: string; +} diff --git a/src/views/list/index.vue b/src/views/list/index.vue index 7f6182e..d8e62f5 100644 --- a/src/views/list/index.vue +++ b/src/views/list/index.vue @@ -1,15 +1,13 @@ @@ -160,14 +108,6 @@ const handlePlay = (item: any) => { @apply relative h-full w-full pt-4; } -.musicPage-enter-active { - animation: fadeInUp 0.8s ease-in-out; -} - -.musicPage-leave-active { - animation: fadeOutDown 0.8s ease-in-out; -} - .recommend { @apply w-full h-full bg-none; &-title { @@ -218,29 +158,4 @@ const handlePlay = (item: any) => { } } -.music { - &-page { - // width: 100%; - // height: 70%; - // position: absolute; - // background-color: #000000f0; - // bottom: 0; - // left: 0; - // border-radius: 30px 30px 0 0; - // animation-duration: 300ms; - @apply w-full h-5/6 absolute bottom-0 left-0 bg-black rounded-t-3xl flex flex-col transition-all; - } - &-title { - @apply text-lg font-bold text-white p-4; - } - - &-close { - @apply absolute top-4 right-4 cursor-pointer text-white text-3xl; - } - - &-list { - height: 594px; - background-color: #00000000; - } -} \ No newline at end of file diff --git a/src/views/user/index.vue b/src/views/user/index.vue index 73a2738..2920867 100644 --- a/src/views/user/index.vue +++ b/src/views/user/index.vue @@ -7,13 +7,12 @@ import { computed, ref } from "vue"; import { setAnimationClass, setAnimationDelay, getImgUrl } from "@/utils"; import { getListDetail } from '@/api/list' import SongItem from "@/components/common/SongItem.vue"; - +import MusicList from "@/components/MusicList.vue"; +import type { Playlist } from '@/type/listDetail'; const store = useStore() const router = useRouter() - - const userDetail = ref() const playList = ref([]) const recordList = ref() @@ -40,7 +39,7 @@ loadPage() const isShowList = ref(false) -const list = ref() +const list = ref() // 展示歌单 const showPlaylist = async (id: number) => { const { data } = await getListDetail(id) @@ -61,21 +60,12 @@ const formatDetail = computed(() => (detail: any) => { return detail }) -const musicFullClass = computed(() => { - if (isShowList.value) { - return setAnimationClass('animate__fadeInUp') - } else { - return setAnimationClass('animate__fadeOutDown') - } -}) - const handlePlay = (item: any) => { - const tracks = list.value?.tracks || [] + const tracks = recordList.value || [] const musicIndex = (tracks.findIndex((music: any) => music.id == item.id) || 0) store.commit('setPlayList', tracks.slice(musicIndex)) } - @@ -173,7 +147,7 @@ const handlePlay = (item: any) => { animation: fadeOutDown 0.8s ease-in-out; } .user-page { - @apply flex; + @apply flex h-full; .left { max-width: 600px; background-color: #0d0d0d; @@ -204,9 +178,8 @@ const handlePlay = (item: any) => { .right { @apply flex-1 ml-4; .record-list { - height: 750px; background-color: #0d0d0d; - @apply rounded-2xl; + @apply rounded-2xl h-full; .record-item { @apply flex items-center px-4; } @@ -247,28 +220,4 @@ const handlePlay = (item: any) => { } } -.music { - &-page { - width: 100%; - height: 734px; - position: absolute; - background-color: #000000f0; - top: 100px; - left: 0; - border-radius: 30px 30px 0 0; - animation-duration: 300ms; - } - &-title { - @apply text-lg font-bold text-white p-4; - } - - &-close { - @apply absolute top-4 right-4 cursor-pointer text-white text-3xl; - } - - &-list { - height: 594px; - background-color: #00000000; - } -} \ No newline at end of file