From c24d51ea9e6a558dd90a0f83cbc6d5f8f751d098 Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Sun, 25 May 2025 10:28:16 +1000 Subject: [PATCH] =?UTF-8?q?feat(=E6=92=AD=E6=94=BE=E5=99=A8):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=92=AD=E6=94=BE=E5=AE=A4=E9=A1=B5=E9=9D=A2=E5=B9=B6?= =?UTF-8?q?=E9=9B=86=E6=88=90GSAP=E5=8A=A8=E7=94=BB=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增播放室页面,支持歌曲播放进度条拖拽功能。在播放队列存储中添加当前播放时间和总时长状态。更新播放器组件以支持跳转到播放室页面,并集成GSAP动画库用于实现进度条拖拽效果。 --- package-lock.json | 7 +++ package.json | 1 + src/components/Player.vue | 97 ++++++++++++++++++++------------- src/main.ts | 2 + src/pages/Playroom.vue | 68 +++++++++++++++++++++++ src/stores/usePlayQueueStore.ts | 4 +- 6 files changed, 141 insertions(+), 38 deletions(-) create mode 100644 src/pages/Playroom.vue diff --git a/package-lock.json b/package-lock.json index f7d889b..ad8e931 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@tailwindcss/vite": "^4.1.7", "axios": "^1.9.0", + "gsap": "^3.13.0", "pinia": "^3.0.2", "tailwindcss": "^4.1.7", "vue": "^3.5.13", @@ -1841,6 +1842,12 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, + "node_modules/gsap": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/gsap/-/gsap-3.13.0.tgz", + "integrity": "sha512-QL7MJ2WMjm1PHWsoFrAQH/J8wUeqZvMtHO58qdekHpCfhvhSL4gSiz6vJf5EeMP0LOn3ZCprL2ki/gjED8ghVw==", + "license": "Standard 'no charge' license: https://gsap.com/standard-license." + }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", diff --git a/package.json b/package.json index cf52a8a..e933d4e 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "dependencies": { "@tailwindcss/vite": "^4.1.7", "axios": "^1.9.0", + "gsap": "^3.13.0", "pinia": "^3.0.2", "tailwindcss": "^4.1.7", "vue": "^3.5.13", diff --git a/src/components/Player.vue b/src/components/Player.vue index fcc140a..4acace0 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -1,9 +1,10 @@ \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 7a5c2c1..8be5812 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,10 +6,12 @@ import { createPinia } from 'pinia' import App from './App.vue' import HomePage from './pages/Home.vue' import AlbumDetailView from './pages/AlbumDetail.vue' +import Playroom from './pages/Playroom.vue' const routes = [ { path: '/', component: HomePage }, { path: '/albums/:albumId', component: AlbumDetailView }, + { path: '/playroom', component: Playroom } ] const router = createRouter({ diff --git a/src/pages/Playroom.vue b/src/pages/Playroom.vue new file mode 100644 index 0000000..b53f83e --- /dev/null +++ b/src/pages/Playroom.vue @@ -0,0 +1,68 @@ + + + \ No newline at end of file diff --git a/src/stores/usePlayQueueStore.ts b/src/stores/usePlayQueueStore.ts index 607e77f..b13afac 100644 --- a/src/stores/usePlayQueueStore.ts +++ b/src/stores/usePlayQueueStore.ts @@ -7,6 +7,8 @@ export const usePlayQueueStore = defineStore('queue', () =>{ const isPlaying = ref(false) const queueReplaceLock = ref(false) const isBuffering = ref(false) + const currentTime = ref(0) + const duration = ref(0) - return { list, currentIndex, isPlaying, queueReplaceLock, isBuffering } + return { list, currentIndex, isPlaying, queueReplaceLock, isBuffering, currentTime, duration } }) \ No newline at end of file