From 03e873953c2edfe8f3d51a9376d0c47e7ee5052f Mon Sep 17 00:00:00 2001 From: Zachary Date: Wed, 24 Feb 2021 23:52:19 +0800 Subject: [PATCH] feat: playlist add collection func * remove some debug info * add style --- src/api/base.js | 4 +-- src/api/playlist.js | 6 ++++ src/assets/css/fakeqqmusic.scss | 12 ++++++++ src/components/common/BlackTip.vue | 18 +++++++++++- src/components/common/DetailInfoCard.vue | 10 +++++-- src/components/common/HomeTop.vue | 1 - src/views/musicLibrary/MvDetail.vue | 2 +- src/views/musicLibrary/NewDisc.vue | 1 - src/views/musicLibrary/PlaylistDetail.vue | 35 +++++++++++++++++++++-- src/views/musicLibrary/SongDetail.vue | 2 +- src/views/musicLibrary/SongerDetail.vue | 2 -- src/views/musicLibrary/Songers.vue | 1 - 12 files changed, 78 insertions(+), 16 deletions(-) diff --git a/src/api/base.js b/src/api/base.js index 9597259..12a7336 100644 --- a/src/api/base.js +++ b/src/api/base.js @@ -1,7 +1,7 @@ import axios from "axios"; -//const BASIC_URL = "http://zacharyzlj.cn:3000/"; -const BASIC_URL = "http://192.168.31.152:3000/"; +const BASIC_URL = "http://zacharyzlj.cn:3000/"; +//const BASIC_URL = "http://192.168.31.152:3000/"; function createBaseInstance() { const instance = axios.create({ baseURL: BASIC_URL, withCredentials: true }); diff --git a/src/api/playlist.js b/src/api/playlist.js index 32dedaf..c47b82d 100644 --- a/src/api/playlist.js +++ b/src/api/playlist.js @@ -24,3 +24,9 @@ export const getCatList = () => requset.get("/playlist/catlist"); /* 登陆后使用 */ export const getUserPlaylists = id => requset.get(`/user/playlist?uid=${id}`); + +/* 收藏/取消收藏歌单 + * 登陆后使用 + * t : 类型,1:收藏,2:取消收藏 id : 歌单 id */ +export const toggleLikePlaylist = params => + requset.get("/playlist/subscribe", { params: params }); diff --git a/src/assets/css/fakeqqmusic.scss b/src/assets/css/fakeqqmusic.scss index a2bef0a..3210ce2 100644 --- a/src/assets/css/fakeqqmusic.scss +++ b/src/assets/css/fakeqqmusic.scss @@ -118,6 +118,10 @@ $black: #000; background-position: -40px -100px; vertical-align: -2px; } +.mod_btn__icon_like--like, +.mod_btn_green__icon_like--like { + background-position: 0 -80px; +} .mod_btn__icon_add, .mod_btn__icon_batch, .mod_btn__icon_comment, @@ -1304,6 +1308,14 @@ img .playlist__pic { background-position: 0 -150px; margin: 0 auto 16px; } +.popup_tips__icon_warn { + display: block; + width: 46px; + height: 46px; + margin: 0 auto 16px; + background-position: 0 -220px; + background-image: url(../img/icon_popup.png); +} .popup_tips__tit { font-size: 14px; color: $white; diff --git a/src/components/common/BlackTip.vue b/src/components/common/BlackTip.vue index da4972b..0f8ed83 100644 --- a/src/components/common/BlackTip.vue +++ b/src/components/common/BlackTip.vue @@ -5,7 +5,7 @@ style="z-index: 2147483647; left: 646px; top: 326px" :style="{ display: ifShow ? '' : 'none' }" > - + @@ -20,6 +20,22 @@ export default { type: String, default: "", }, + // 0: tip, 1: warn + iconType: { default: 0 }, + }, + methods: { + processIcon() { + switch (this.iconType) { + case 0: + return "popup_tips__icon"; + break; + case 1: + return "popup_tips__icon_warn"; + break; + default: + return ""; + } + }, }, }; diff --git a/src/components/common/DetailInfoCard.vue b/src/components/common/DetailInfoCard.vue index 155ba5b..55f41cd 100644 --- a/src/components/common/DetailInfoCard.vue +++ b/src/components/common/DetailInfoCard.vue @@ -35,7 +35,7 @@
{{ obj.desc }}
- [更多] + [更多]