From 36faa33c5f01285942df51644690c23c4429b8ad Mon Sep 17 00:00:00 2001 From: BeADre <34639100+BeADre@users.noreply.github.com> Date: Wed, 21 Oct 2020 18:49:57 +0800 Subject: [PATCH] =?UTF-8?q?search=E5=9B=BD=E9=99=85=E5=8C=96=E4=BB=A5?= =?UTF-8?q?=E5=8F=8Akeywords=E5=92=8Cresult=E7=9A=84=E9=AA=8C=E8=AF=81=20(?= =?UTF-8?q?#32)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add i18n of modal * feat: add i18n of search * fix: checkout keywords * fix: checkout result Co-authored-by: wanghaobb --- src/components/Navbar.vue | 1 + src/locale/lang/en.js | 8 ++++++++ src/locale/lang/zh-CN.js | 8 ++++++++ src/views/search.vue | 19 +++++++++++-------- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 4c176b5..9127d6b 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -70,6 +70,7 @@ export default { else this.$router.go(1); }, goToSearchPage() { + if(!this.keywords) return; this.$router.push({ name: "search", query: { keywords: this.keywords }, diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js index 985f736..28cdc98 100644 --- a/src/locale/lang/en.js +++ b/src/locale/lang/en.js @@ -82,5 +82,13 @@ export default { }, modal: { close: "Close" + }, + search: { + artist: "Artists", + album: "Albums", + song: "Songs", + mv: "MVs", + playlist: "Playlists", + noResult: "No Results" } }; diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index d9fd2f6..fd2ee5c 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -87,5 +87,13 @@ export default { }, modal: { close: "关闭" + }, + search: { + artist: "歌手", + album: "专辑", + song: "歌曲", + mv: "视频", + playlist: "歌单", + noResult: "暂无结果" } }; diff --git a/src/views/search.vue b/src/views/search.vue index 9065179..9ff1e83 100644 --- a/src/views/search.vue +++ b/src/views/search.vue @@ -1,10 +1,10 @@ @@ -150,7 +150,10 @@ export default { tracks() { let tracks = this.result.song.songs.slice(0, 12); return tracks; - } + }, + isExistResult() { + return Object.keys(this.result).length; + } }, methods: { goToAlbum(id) {