From 9c92e157a5ead688694a212e3f7b924d46c059a1 Mon Sep 17 00:00:00 2001 From: Ap_Tx <3045929398@qq.com> Date: Wed, 21 Oct 2026 22:25:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9A=AE=E8=82=A4=E7=AB=99=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6=E7=AE=A1=E7=90=86=E8=A1=A5=E5=85=85=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E3=80=81=E5=88=87=E6=8D=A2=E6=AD=A3=E7=89=88?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=E4=B8=8E=E9=BB=98=E8=AE=A4=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除/重命名/切换正版改为两段式确认,取消可整体复位 - 玩家列表与详情区均提供切换正版按钮 - 默认角色在列表和详情区显示「默认」徽章 - 补 rename/delete/mojang 三组确认文案 --- .../ui/skin-site/SkinSiteProfileView.vue | 164 +++++++++++++++++- .../app-frontend/src/locales/en-US/index.json | 3 + .../app-frontend/src/locales/zh-CN/index.json | 3 + 3 files changed, 168 insertions(+), 2 deletions(-) diff --git a/apps/app-frontend/src/components/ui/skin-site/SkinSiteProfileView.vue b/apps/app-frontend/src/components/ui/skin-site/SkinSiteProfileView.vue index 3162ca4..5858458 100644 --- a/apps/app-frontend/src/components/ui/skin-site/SkinSiteProfileView.vue +++ b/apps/app-frontend/src/components/ui/skin-site/SkinSiteProfileView.vue @@ -88,6 +88,18 @@ const messages = defineMessages({ id: 'app.skin-site.profile-view.mojang-toggled', defaultMessage: 'Mojang status updated.', }, + deleteConfirm: { + id: 'app.skin-site.profile-view.delete-confirm', + defaultMessage: 'Delete this player? This cannot be undone.', + }, + mojangConfirm: { + id: 'app.skin-site.profile-view.mojang-confirm', + defaultMessage: 'Toggle Mojang status for this player?', + }, + renameConfirm: { + id: 'app.skin-site.profile-view.rename-confirm', + defaultMessage: 'Rename this player?', + }, }) const selectedId = ref(null) const texture = ref({}) @@ -151,14 +163,18 @@ const showAdd = ref(false) const newName = ref('') const renamingId = ref(null) const renameValue = ref('') +const confirmingRename = ref(false) const confirmingDeleteId = ref(null) +const confirmingMojangId = ref(null) function resetDialogs() { showAdd.value = false newName.value = '' renamingId.value = null renameValue.value = '' + confirmingRename.value = false confirmingDeleteId.value = null + confirmingMojangId.value = null } async function submitAdd() { @@ -182,11 +198,22 @@ async function submitAdd() { function startRename(player: { uuid: string; name: string }) { renamingId.value = player.uuid renameValue.value = player.name + confirmingRename.value = false +} + +function requestRename() { + const name = renameValue.value.trim() + if (!renamingId.value || !name) return + confirmingRename.value = true } async function submitRename() { const name = renameValue.value.trim() if (!renamingId.value || !name || busy.value) return + if (!confirmingRename.value) { + confirmingRename.value = true + return + } busy.value = 'rename' try { const res = await skinSiteRenamePlayer(renamingId.value, name) @@ -201,8 +228,17 @@ async function submitRename() { } } +function requestDelete(uuid: string) { + if (busy.value) return + confirmingDeleteId.value = uuid +} + async function submitDelete(uuid: string) { if (busy.value) return + if (confirmingDeleteId.value !== uuid) { + confirmingDeleteId.value = uuid + return + } busy.value = 'delete' try { const res = await skinSiteDeletePlayer(uuid) @@ -249,8 +285,17 @@ async function clearDefaultPlayer() { } } +function requestToggleMojang(uuid: string) { + if (busy.value) return + confirmingMojangId.value = uuid +} + async function toggleMojang(uuid: string) { if (busy.value) return + if (confirmingMojangId.value !== uuid) { + confirmingMojangId.value = uuid + return + } busy.value = 'mojang' try { const res = await skinSiteSwitchMojang(uuid) @@ -377,6 +422,39 @@ watch(signedIn, (value) => { +
+ +

+ {{ formatMessage(messages.renameConfirm) }} +

+
+ + +
+
+
{{ formatMessage(messages.loading) }} @@ -403,6 +481,12 @@ watch(signedIn, (value) => { class="!rounded-md" /> {{ player.name }} + + {{ formatMessage(messages.isDefault) }} + Mojang @@ -411,6 +495,7 @@ watch(signedIn, (value) => { v-if="defaultUuid === player.uuid" type="button" class="rounded px-1.5 py-0.5 text-[10px] font-semibold text-brand" + :disabled="busy !== null" @click.stop="clearDefaultPlayer" > {{ formatMessage(messages.clearDefault) }} @@ -419,6 +504,7 @@ watch(signedIn, (value) => { v-else type="button" class="rounded px-1.5 py-0.5 text-[10px] font-semibold text-secondary hover:bg-bg" + :disabled="busy !== null" @click.stop="setDefaultPlayer(player.uuid)" > {{ formatMessage(messages.setDefault) }} @@ -426,20 +512,67 @@ watch(signedIn, (value) => { + + +
+
+ {{ formatMessage(messages.deleteConfirm) }} +
+
+ {{ formatMessage(messages.mojangConfirm) }} + +
@@ -451,10 +584,37 @@ watch(signedIn, (value) => {