From f0e5ea436395e95e4caba3b1e4a99a7a20ab1fa1 Mon Sep 17 00:00:00 2001 From: zilong Date: Thu, 4 Nov 2021 20:09:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=94=E8=BE=83=E5=AE=8C=E7=BE=8E=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E8=BF=94=E5=9B=9E=E6=BB=9A=E5=8A=A8=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 22 ++- src/components/Albumlist.vue | 16 ++ src/components/Artistlist.vue | 55 +++++++ src/components/Songlist.vue | 47 +++--- src/lib/eventBus.js | 5 + src/lib/useBackSnaps.js | 122 +++++++++++++++ src/router/index.js | 76 ++++++---- src/store/index.js | 21 +++ src/views/Played.vue | 9 +- src/views/SearchResult.vue | 245 +++++++++++++++++++++++++++---- src/views/common/Search.vue | 2 +- src/views/common/Searching.vue | 4 +- src/views/discover/Discover.vue | 2 +- src/views/discover/Recommend.vue | 4 + 14 files changed, 535 insertions(+), 95 deletions(-) create mode 100644 src/components/Albumlist.vue create mode 100644 src/components/Artistlist.vue create mode 100644 src/lib/eventBus.js create mode 100644 src/lib/useBackSnaps.js diff --git a/src/App.vue b/src/App.vue index 9b36d7d..1b0dfd2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,6 +22,7 @@ import { NMessageProvider, } from "naive-ui"; import router from "./router"; + // import { CloudCircleSharp } from "@vicons/ionicons5"; const store = useStore(); @@ -44,6 +45,16 @@ store.commit("loadSettings"); store.state.settings.playing = false; //默认停止播放 store.commit("loadCaches"); +// onMounted(() => { +// window.addEventListener('popstate', popstate, false); +// }) +// const popstate = (event)=>{ +// console.log('popstate--',event); +// } +// onUnmounted(() => { +// window.removeEventListener('popstate',pop) +// }) + // router.replace('/discover/recommend') const showPlaying = ref(false); //是否显示播放列表 @@ -60,14 +71,15 @@ watch( } ) + //处理route消息 const routeToken = pubsub.subscribe("router", (msg, data) => { switch (msg) { case "router.beforeEach": case "router.afterEach": - store.commit("saveSettings", { - currentRoute: data.to.fullPath, - }); + // store.commit("saveSettings", { + // currentRoute: data.to.fullPath, + // }); break; } }); @@ -140,9 +152,9 @@ const hideWins = (e) => {
- + - + + + + {{ar.name}} + + {{ar.alias.length > 0 ? '(' + ar.alias.join(' ') + ')' : ''}} + + + + + + + + + + \ No newline at end of file diff --git a/src/components/Songlist.vue b/src/components/Songlist.vue index 711141d..6a0b0b8 100644 --- a/src/components/Songlist.vue +++ b/src/components/Songlist.vue @@ -1,31 +1,14 @@