通过歌曲菜单添加不喜欢歌曲时需要二次确认防止手抖

This commit is contained in:
lyswhut
2023-09-20 13:41:25 +08:00
parent 52630aa735
commit 5364b7a09b
7 changed files with 30 additions and 5 deletions
@@ -52,7 +52,7 @@ export default ({ list, selectedList, removeAllSelect }) => {
if (selectedList.value.length && !single) {
// const confirm = await (selectedList.value.length > 1
// ? dialog.confirm({
// message: t('lists__remove music_tip', { len: selectedList.value.length }),
// message: t('lists__remove_music_tip', { len: selectedList.value.length }),
// confirmButtonText: t('lists__remove_tip_button'),
// })
// : Promise.resolve(true)
@@ -39,6 +39,12 @@ export default ({ props, list, selectedList, removeAllSelect }) => {
const handleDislikeMusic = async(index) => {
const minfo = list.value[index]
const confirm = await dialog.confirm({
message: t('lists__dislike_music_tip', { name: minfo.name }),
cancelButtonText: t('cancel_button_text_2'),
confirmButtonText: t('confirm_button_text'),
})
if (!confirm) return
await addDislikeInfo([{ name: minfo.name, singer: minfo.singer }])
if (hasDislike(playMusicInfo.musicInfo)) {
playNext(true)
@@ -49,7 +55,7 @@ export default ({ props, list, selectedList, removeAllSelect }) => {
if (selectedList.value.length && !single) {
const confirm = await (selectedList.value.length > 1
? dialog.confirm({
message: t('lists__remove music_tip', { len: selectedList.value.length }),
message: t('lists__remove_music_tip', { len: selectedList.value.length }),
confirmButtonText: t('lists__remove_tip_button'),
})
: Promise.resolve(true)