mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
通过歌曲菜单添加不喜欢歌曲时需要二次确认防止手抖
This commit is contained in:
parent
908d23fc82
commit
c12bc8a4df
@ -1,3 +1,7 @@
|
||||
### 优化
|
||||
|
||||
- 通过歌曲菜单添加不喜欢歌曲时需要二次确认防止手抖
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复横屏状态下的歌词滚动位置计算问题
|
||||
|
@ -4,7 +4,7 @@ import { playList, playNext } from '@/core/player/player'
|
||||
import { addTempPlayList } from '@/core/player/tempPlayList'
|
||||
import settingState from '@/store/setting/state'
|
||||
import { getListMusicSync } from '@/utils/listManage'
|
||||
import { shareMusic } from '@/utils/tools'
|
||||
import { confirmDialog, shareMusic, toast } from '@/utils/tools'
|
||||
import { addDislikeInfo, hasDislike } from '@/core/dislikeList'
|
||||
import playerState from '@/store/player/state'
|
||||
|
||||
@ -30,7 +30,15 @@ export const handleShare = (musicInfo: LX.Music.MusicInfoOnline) => {
|
||||
}
|
||||
|
||||
export const handleDislikeMusic = async(musicInfo: LX.Music.MusicInfoOnline) => {
|
||||
const confirm = await confirmDialog({
|
||||
message: global.i18n.t('lists_dislike_music_tip', { name: musicInfo.name }),
|
||||
cancelButtonText: global.i18n.t('cancel_button_text_2'),
|
||||
confirmButtonText: global.i18n.t('confirm_button_text'),
|
||||
bgClose: false,
|
||||
})
|
||||
if (!confirm) return
|
||||
await addDislikeInfo([{ name: musicInfo.name, singer: musicInfo.singer }])
|
||||
toast(global.i18n.t('lists_dislike_music_add_tip'))
|
||||
if (hasDislike(playerState.playMusicInfo.musicInfo)) {
|
||||
void playNext(true)
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
"back": "Back",
|
||||
"back_home": "Back",
|
||||
"cancel": "Cancel",
|
||||
"cancel_button_text_2": "No, no, no, wrong click",
|
||||
"change_position": "Change Position",
|
||||
"change_position_list_title": "Change the position of the list",
|
||||
"change_position_music_multi_title": "Adjust the position of the selected {num} song to",
|
||||
@ -88,6 +89,8 @@
|
||||
"list_temp": "Temp list",
|
||||
"list_update_error": "{name} failed to update",
|
||||
"list_update_success": "{name} updated successfully",
|
||||
"lists_dislike_music_add_tip": "Added",
|
||||
"lists_dislike_music_tip": "Do you really dislike {name}?",
|
||||
"load_failed": "Ah, loading failed 😥",
|
||||
"loading": "Loading...",
|
||||
"location": "From {location}",
|
||||
|
@ -5,6 +5,7 @@
|
||||
"back": "返回",
|
||||
"back_home": "返回桌面",
|
||||
"cancel": "取消",
|
||||
"cancel_button_text_2": "不不不,点错了",
|
||||
"change_position": "调整位置",
|
||||
"change_position_list_title": "调整列表位置",
|
||||
"change_position_music_multi_title": "将已选的 {num} 首歌曲的位置调整到",
|
||||
@ -88,6 +89,8 @@
|
||||
"list_temp": "临时列表",
|
||||
"list_update_error": "{name} 更新失败",
|
||||
"list_update_success": "{name} 更新成功",
|
||||
"lists_dislike_music_add_tip": "已添加",
|
||||
"lists_dislike_music_tip": "你真的不喜欢 {name} 吗?",
|
||||
"load_failed": "啊 加载失败了 😥",
|
||||
"loading": "加载中...",
|
||||
"location": "来自{location}",
|
||||
|
@ -3,7 +3,7 @@ import { playList, playNext } from '@/core/player/player'
|
||||
import { addTempPlayList } from '@/core/player/tempPlayList'
|
||||
import settingState from '@/store/setting/state'
|
||||
import { similar, sortInsert } from '@/utils'
|
||||
import { confirmDialog, shareMusic } from '@/utils/tools'
|
||||
import { confirmDialog, shareMusic, toast } from '@/utils/tools'
|
||||
import { addDislikeInfo, hasDislike } from '@/core/dislikeList'
|
||||
import playerState from '@/store/player/state'
|
||||
|
||||
@ -72,7 +72,15 @@ export const searchListMusic = (list: LX.Music.MusicInfo[], text: string) => {
|
||||
}
|
||||
|
||||
export const handleDislikeMusic = async(musicInfo: SelectInfo['musicInfo']) => {
|
||||
const confirm = await confirmDialog({
|
||||
message: global.i18n.t('lists_dislike_music_tip', { name: musicInfo.name }),
|
||||
cancelButtonText: global.i18n.t('cancel_button_text_2'),
|
||||
confirmButtonText: global.i18n.t('confirm_button_text'),
|
||||
bgClose: false,
|
||||
})
|
||||
if (!confirm) return
|
||||
await addDislikeInfo([{ name: musicInfo.name, singer: musicInfo.singer }])
|
||||
toast(global.i18n.t('lists_dislike_music_add_tip'))
|
||||
if (hasDislike(playerState.playMusicInfo.musicInfo)) {
|
||||
void playNext(true)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user