mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
feat: Support copy artist and album URL (#708)
This commit is contained in:
parent
e226afbaff
commit
b9da9a41fd
7 changed files with 207 additions and 100 deletions
|
|
@ -116,9 +116,14 @@
|
|||
<ContextMenu ref="albumMenu">
|
||||
<!-- <div class="item">{{ $t('contextMenu.addToQueue') }}</div> -->
|
||||
<div class="item" @click="likeAlbum(true)">{{
|
||||
dynamicDetail.isSub ? '从音乐库删除' : '保存到音乐库'
|
||||
dynamicDetail.isSub
|
||||
? $t('contextMenu.removeFromLibrary')
|
||||
: $t('contextMenu.saveToLibrary')
|
||||
}}</div>
|
||||
<div class="item">{{ $t('contextMenu.addToPlaylist') }}</div>
|
||||
<div class="item" @click="copyUrl(album.id)">{{
|
||||
$t('contextMenu.copyUrl')
|
||||
}}</div>
|
||||
<div class="item">添加到歌单</div>
|
||||
</ContextMenu>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -128,6 +133,7 @@ import { mapMutations, mapActions, mapState } from 'vuex';
|
|||
import { getArtistAlbum } from '@/api/artist';
|
||||
import { getTrackDetail } from '@/api/track';
|
||||
import { getAlbum, albumDynamicDetail, likeAAlbum } from '@/api/album';
|
||||
import locale from '@/locale';
|
||||
import { splitSoundtrackAlbumTitle, splitAlbumTitle } from '@/utils/common';
|
||||
import NProgress from 'nprogress';
|
||||
import { isAccountLoggedIn } from '@/utils/auth';
|
||||
|
|
@ -267,9 +273,6 @@ export default {
|
|||
this.dynamicDetail = data;
|
||||
});
|
||||
},
|
||||
openMenu(e) {
|
||||
this.$refs.albumMenu.openMenu(e);
|
||||
},
|
||||
toggleFullDescription() {
|
||||
this.showFullDescription = !this.showFullDescription;
|
||||
if (this.showFullDescription) {
|
||||
|
|
@ -278,6 +281,19 @@ export default {
|
|||
enableScrolling();
|
||||
}
|
||||
},
|
||||
openMenu(e) {
|
||||
this.$refs.albumMenu.openMenu(e);
|
||||
},
|
||||
copyUrl(id) {
|
||||
let showToast = this.showToast;
|
||||
this.$copyText('https://music.163.com/#/album?id=' + id)
|
||||
.then(function () {
|
||||
showToast(locale.t('toast.copied'));
|
||||
})
|
||||
.catch(error => {
|
||||
showToast(`${locale.t('toast.copyFailed')}${error}`);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue