新增删除列表前的确认弹窗

pull/639/head
lyswhut 2021-09-30 14:45:14 +08:00
parent ce7bca5b36
commit b1918e8b15
7 changed files with 21 additions and 3 deletions

View File

@ -2,6 +2,7 @@
- 新增歌词简体中文转繁体中文,当软件语言被设置为繁体中文后,播放歌曲的歌词也将自动转成繁体中文显示 - 新增歌词简体中文转繁体中文,当软件语言被设置为繁体中文后,播放歌曲的歌词也将自动转成繁体中文显示
- 为方便分享歌曲列表,新增单个列表导入/导出功能,可在右击“我的列表”里的列表名后弹出的菜单中使用 - 为方便分享歌曲列表,新增单个列表导入/导出功能,可在右击“我的列表”里的列表名后弹出的菜单中使用
- 为防止误删列表,新增删除列表前的确认弹窗
### 修复 ### 修复

View File

@ -24,6 +24,8 @@
"lists_new_list_btn": "Create list", "lists_new_list_btn": "Create list",
"lists_new_list_input": "New list...", "lists_new_list_input": "New list...",
"lists_remove": "Remove", "lists_remove": "Remove",
"lists_remove_tip": "Do you really want to remove {name}?",
"lists_remove_tip_button": "Yes, that's right",
"lists_rename": "Rename", "lists_rename": "Rename",
"lists_sync": "Update", "lists_sync": "Update",
"loding_list": "Loading...", "loding_list": "Loading...",

View File

@ -24,6 +24,8 @@
"lists_new_list_btn": "新建列表", "lists_new_list_btn": "新建列表",
"lists_new_list_input": "新列表...", "lists_new_list_input": "新列表...",
"lists_remove": "删除", "lists_remove": "删除",
"lists_remove_tip": "你真的想要移除 {name} 吗?",
"lists_remove_tip_button": "是的 没错",
"lists_rename": "重命名", "lists_rename": "重命名",
"lists_sync": "更新", "lists_sync": "更新",
"loding_list": "加载中...", "loding_list": "加载中...",

View File

@ -24,6 +24,8 @@
"lists_new_list_btn": "新建列表", "lists_new_list_btn": "新建列表",
"lists_new_list_input": "新列表...", "lists_new_list_input": "新列表...",
"lists_remove": "刪除", "lists_remove": "刪除",
"lists_remove_tip": "你真的想要移除 {name} 嗎?",
"lists_remove_tip_button": "是的 沒錯",
"lists_rename": "重命名", "lists_rename": "重命名",
"lists_sync": "更新", "lists_sync": "更新",
"loding_list": "加載中...", "loding_list": "加載中...",

View File

@ -55,10 +55,11 @@ export default {
.main { .main {
flex: auto; flex: auto;
min-height: 50px; min-height: 40px;
padding: 15px; padding: 15px;
font-size: 14px; font-size: 14px;
max-width: 320px; max-width: 320px;
min-width: 220px;
line-height: 1.5; line-height: 1.5;
} }

View File

@ -41,7 +41,11 @@ const dialog = {
} }
}) })
} }
dialog.confirm = options => dialog({ ...options, showCancel: true }) dialog.confirm = options => dialog(
typeof options == 'string'
? { message: options, showCancel: true }
: { ...options, showCancel: true },
)
Vue.prototype.$dialog = dialog Vue.prototype.$dialog = dialog
}, },

View File

@ -818,7 +818,13 @@ export default {
this.movedownUserList({ id: this.userList[index].id }) this.movedownUserList({ id: this.userList[index].id })
break break
case 'remove': case 'remove':
this.removeUserList({ id: this.userList[index].id }) this.$dialog.confirm({
message: this.$t('view.list.lists_remove_tip', { name: this.userList[index].name }),
confirmButtonText: this.$t('view.list.lists_remove_tip_button'),
}).then(isRemove => {
if (!isRemove) return
this.removeUserList({ id: this.userList[index].id })
})
break break
} }
}, },