Skip to content
28 changes: 24 additions & 4 deletions src/components/Menu/CoverMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,32 @@ const openDropdown = async (
type: "divider",
},
{
key: "copy",
label: "复制链接",
key: "code-name",
label: `复制${type === "playlist" ? "歌单" : type === "album" ? "专辑" : type === "video" ? "视频" : "电台"}名称`,
props: {
onClick: () => copyData(`https://music.163.com/#/${type}?id=${item.id}`),
onClick: () => copyData(item.name),
},
icon: renderIcon("Link"),
icon: renderIcon("Copy", { size: 18 }),
},
{
key: "code-id",
label: `复制${type === "playlist" ? "歌单" : type === "album" ? "专辑" : type === "video" ? "视频" : "电台"} ID`,
props: {
onClick: () => copyData(item.id),
},
icon: renderIcon("Copy", { size: 18 }),
},
{
key: "share",
label: `分享${type === "playlist" ? "歌单" : type === "album" ? "专辑" : type === "video" ? "视频" : "电台"}链接`,
props: {
onClick: () =>
copyData(
`https://music.163.com/#/${type}?id=${item.id}`,
"已复制分享链接到剪贴板",
),
},
icon: renderIcon("Share", { size: 18 }),
},
];
// 显示菜单
Expand Down
14 changes: 13 additions & 1 deletion src/views/Artist/layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<script setup lang="ts">
import type { DropdownOption } from "naive-ui";
import type { ArtistType } from "@/types/main";
import { coverLoaded, renderIcon } from "@/utils/helper";
import { coverLoaded, renderIcon, copyData } from "@/utils/helper";
import { renderToolbar } from "@/utils/meta";
import { artistDetail } from "@/api/artist";
import { formatArtistsList } from "@/utils/format";
Expand Down Expand Up @@ -183,6 +183,18 @@ const listScrolling = ref<boolean>(false);

// 更多操作
const moreOptions = computed<DropdownOption[]>(() => [
{
label: "复制分享链接",
key: "copy",
props: {
onClick: () =>
copyData(
`https://music.163.com/#/artist?id=${artistId.value}`,
"已复制分享链接到剪贴板",
),
},
icon: renderIcon("Share"),
},
{
label: "打开源页面",
key: "open",
Expand Down
14 changes: 13 additions & 1 deletion src/views/List/album.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ import type { DropdownOption } from "naive-ui";
import { songDetail } from "@/api/song";
import { albumDetail } from "@/api/album";
import { formatCoverList, formatSongsList } from "@/utils/format";
import { coverLoaded, fuzzySearch, renderIcon } from "@/utils/helper";
import { coverLoaded, fuzzySearch, renderIcon, copyData } from "@/utils/helper";
import { renderToolbar } from "@/utils/meta";
import { useDataStore, useStatusStore } from "@/stores";
import { debounce } from "lodash-es";
Expand Down Expand Up @@ -222,6 +222,18 @@ const songListHeight = computed(() => {

// 更多操作
const moreOptions = computed<DropdownOption[]>(() => [
{
label: "复制分享链接",
key: "copy",
props: {
onClick: () =>
copyData(
`https://music.163.com/#/album?id=${albumId.value}`,
"已复制分享链接到剪贴板",
),
},
icon: renderIcon("Share"),
},
{
label: "打开源页面",
key: "open",
Expand Down
14 changes: 13 additions & 1 deletion src/views/List/liked.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ import type { DropdownOption, MessageReactive } from "naive-ui";
import { songDetail } from "@/api/song";
import { playlistDetail, playlistAllSongs } from "@/api/playlist";
import { formatCoverList, formatSongsList } from "@/utils/format";
import { coverLoaded, formatNumber, fuzzySearch, renderIcon } from "@/utils/helper";
import { coverLoaded, formatNumber, fuzzySearch, renderIcon, copyData } from "@/utils/helper";
import { renderToolbar } from "@/utils/meta";
import { debounce, isObject, uniqBy } from "lodash-es";
import { useDataStore, useStatusStore } from "@/stores";
Expand Down Expand Up @@ -240,6 +240,18 @@ const moreOptions = computed<DropdownOption[]>(() => [
},
icon: renderIcon("Batch"),
},
{
label: "复制分享链接",
key: "copy",
props: {
onClick: () =>
copyData(
`https://music.163.com/#/playlist?id=${playlistId.value}`,
"已复制分享链接到剪贴板",
),
},
icon: renderIcon("Share"),
},
{
label: "打开源页面",
key: "open",
Expand Down
14 changes: 13 additions & 1 deletion src/views/List/playlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ import {
updatePlaylistPrivacy,
} from "@/api/playlist";
import { formatCoverList, formatSongsList } from "@/utils/format";
import { coverLoaded, formatNumber, fuzzySearch, renderIcon } from "@/utils/helper";
import { coverLoaded, formatNumber, fuzzySearch, renderIcon, copyData } from "@/utils/helper";
import { renderToolbar } from "@/utils/meta";
import { isLogin, toLikePlaylist, updateUserLikePlaylist } from "@/utils/auth";
import { debounce } from "lodash-es";
Expand Down Expand Up @@ -311,6 +311,18 @@ const moreOptions = computed<DropdownOption[]>(() => [
},
icon: renderIcon("Batch"),
},
{
label: "复制分享链接",
key: "copy",
props: {
onClick: () =>
copyData(
`https://music.163.com/#/playlist?id=${playlistId.value}`,
"已复制分享链接到剪贴板",
),
},
icon: renderIcon("Share"),
},
{
label: "打开源页面",
key: "open",
Expand Down
14 changes: 13 additions & 1 deletion src/views/List/radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
import type { CoverType, SongType } from "@/types/main";
import type { DropdownOption, MessageReactive } from "naive-ui";
import { formatCoverList, formatSongsList } from "@/utils/format";
import { coverLoaded, fuzzySearch, renderIcon } from "@/utils/helper";
import { coverLoaded, fuzzySearch, renderIcon, copyData } from "@/utils/helper";
import { renderToolbar } from "@/utils/meta";
import { debounce } from "lodash-es";
import { useDataStore, useStatusStore } from "@/stores";
Expand Down Expand Up @@ -239,6 +239,18 @@ const moreOptions = computed<DropdownOption[]>(() => [
},
icon: renderIcon("Refresh"),
},
{
label: "复制分享链接",
key: "copy",
props: {
onClick: () =>
copyData(
`https://music.163.com/#/djradio?id=${radioId.value}`,
"已复制分享链接到剪贴板",
),
},
icon: renderIcon("Share"),
},
{
label: "打开源页面",
key: "open",
Expand Down