diff --git a/src/components/Songlist.vue b/src/components/Songlist.vue index 5dae589..711141d 100644 --- a/src/components/Songlist.vue +++ b/src/components/Songlist.vue @@ -185,7 +185,7 @@ export default { user-select: none; .trh{ - background-color: #eee; + background-color: #f0f0f0; font-weight: 600; td{ // background-color: red; diff --git a/src/store/index.js b/src/store/index.js index 0dc0da2..5fa4f85 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -5,7 +5,7 @@ export default createStore({ // appVersion: "0.0.1", // debugStr: "测试debug字符", showSongDetail: false, //是否显示歌曲详情 - keywords: '', //查询关键字 + keywords: "", //查询关键字 settings: { currentRoute: "/discover/recommend", //当前路由 songId: 0, //歌曲id @@ -125,6 +125,25 @@ export default createStore({ saveLoaclSettings(state.settings); } }, + // 搜索历史 + addSearchHistory(state, history) { + let h = state.settings.searchHistory.filter( + (item) => item != history + ); + h.unshift(history); + state.settings.searchHistory = h; + saveLoaclSettings(state.settings); + }, + removeSearchHistory(state, history) { + state.settings.searchHistory = state.settings.searchHistory.filter( + (item) => item != history + ); + saveLoaclSettings(state.settings); + }, + clearSearchHistory(state) { + state.settings.searchHistory = [] + saveLoaclSettings(state.settings); + }, }, actions: {}, modules: {}, diff --git a/src/views/SearchResult.vue b/src/views/SearchResult.vue index 03d78b7..6ebbe4e 100644 --- a/src/views/SearchResult.vue +++ b/src/views/SearchResult.vue @@ -1,38 +1,44 @@ @@ -146,12 +162,18 @@ export default {}; // border-bottom: solid 2px red; // } } - .bt{ + .bt { margin-top: -2px; height: 2px; background-color: #f0f0f0; } } } + + .pager{ + margin: 18px; + display: flex; + justify-content: center; + } } diff --git a/src/views/common/Search.vue b/src/views/common/Search.vue index c8247db..9400a80 100644 --- a/src/views/common/Search.vue +++ b/src/views/common/Search.vue @@ -17,6 +17,7 @@ const search = () => { if (keywords.value.length > 0){ pubsub.publish("zp.toggleSearch"); // elSearch.value.blur() + store.commit('addSearchHistory', keywords.value) router.push(`/search/1/${keywords.value}`); } }; diff --git a/src/views/common/Searching.vue b/src/views/common/Searching.vue index b148019..2514452 100644 --- a/src/views/common/Searching.vue +++ b/src/views/common/Searching.vue @@ -1,11 +1,13 @@