From d7a6491df58a06df1391cd79e42d546d63c4d425 Mon Sep 17 00:00:00 2001 From: "ex_zhangwenlei@exiot.cmcc" <15196725410@139.com> Date: Wed, 17 Jan 2024 11:07:50 +0800 Subject: [PATCH 1/3] fix: play music bug when there is only a song,cant play forever --- src/components/PlayMusic/index.vue | 20 +++++++++++++------- todo.todo | 4 +++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/PlayMusic/index.vue b/src/components/PlayMusic/index.vue index 0cb83c4..4ab907b 100644 --- a/src/components/PlayMusic/index.vue +++ b/src/components/PlayMusic/index.vue @@ -14,9 +14,12 @@ const settingRef = ref() // const audio = ref(new Audio()) const globalConfig = useStore().globalConfig const { getMusicList: localMusicList,getCurrentMusic:currentMusic } = storeToRefs(globalConfig); -const localMusicListValue = ref(localMusicList) +// const localMusicListValue = ref(localMusicList) const play = async (item: any) => { + if(!item){ + return + } // if (!audio.value.paused && !skip) { // audio.value.pause() @@ -37,6 +40,9 @@ const play = async (item: any) => { audio.value.play() } const playMusic=(item:any,skip = false)=>{ + if(!item){ + return + } if(!currentMusic.value.paused&&!skip){ globalConfig.setCurrentMusic(item,true) @@ -46,13 +52,13 @@ return } const nextPlay = () => { // 播放下一首 - if (localMusicListValue.value.length > 1) { - let index = localMusicListValue.value.findIndex((item: any) => item.name == currentMusic.value.item.name) + if (localMusicList.value.length >= 1) { + let index = localMusicList.value.findIndex((item: any) => item.name == currentMusic.value.item.name) index++ - if (index >= localMusicListValue.value.length) { + if (index >= localMusicList.value.length) { index = 0 } - globalConfig.setCurrentMusic(localMusicListValue.value[index],false) + globalConfig.setCurrentMusic(localMusicList.value[index],false) } } // 监听播放成后开始下一首 @@ -68,7 +74,7 @@ const enterHome = () => { } onMounted(() => { - globalConfig.setCurrentMusic(localMusicListValue.value[0],true) + globalConfig.setCurrentMusic(localMusicList.value[0],true) onPlayEnd() // 不使用空格控制audio }) @@ -101,7 +107,7 @@ watch(currentMusic, (val: any) => { -
+
diff --git a/todo.todo b/todo.todo index 880ccbb..14240cd 100644 --- a/todo.todo +++ b/todo.todo @@ -6,4 +6,6 @@ -- 导出表格 --- 手机端访问提示跳转PC端 \ No newline at end of file +-- 手机端访问提示跳转PC端 + +不同抽奖3D图形,球体、螺旋体... \ No newline at end of file From 3c738f2082266a497449455e95b48e72aef3e39f Mon Sep 17 00:00:00 2001 From: "ex_zhangwenlei@exiot.cmcc" <15196725410@139.com> Date: Wed, 17 Jan 2024 15:12:54 +0800 Subject: [PATCH 2/3] style: add header icon --- index.html | 2 +- public/dog.svg | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 public/dog.svg diff --git a/index.html b/index.html index 21ded49..8de64fc 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - + Log-Lottery diff --git a/public/dog.svg b/public/dog.svg new file mode 100644 index 0000000..af8e03e --- /dev/null +++ b/public/dog.svg @@ -0,0 +1 @@ + \ No newline at end of file From 44a35a504f112f33bbbf2014705c14115233dbad Mon Sep 17 00:00:00 2001 From: "ex_zhangwenlei@exiot.cmcc" <15196725410@139.com> Date: Wed, 17 Jan 2024 22:11:38 +0800 Subject: [PATCH 3/3] style: title icon --- public/dog.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/dog.svg b/public/dog.svg index af8e03e..323cce2 100644 --- a/public/dog.svg +++ b/public/dog.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file