From 7f84a53f6d799c9f7fae650ad6bc965324dc462c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Sun, 22 Sep 2024 11:48:25 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=A5=88=E6=84=BF=E3=80=81=E6=B7=B1=E6=B8=8A=E3=80=81=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E9=A1=B5=E9=9D=A2=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=B8=B8=E6=88=8F=E8=B4=A6=E5=8F=B7=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #126 --- src/components/config/tc-userBadge.vue | 22 +- src/components/func/confirm.vue | 2 +- src/components/userAvatar/tua-avatar-box.vue | 11 +- src/pages/User/Abyss.vue | 49 ++-- src/pages/User/Characters.vue | 274 ++++++++++++------- src/pages/User/Gacha.vue | 247 ++++++++--------- src/plugins/Sqlite/modules/userAvatar.ts | 20 +- src/store/modules/user.ts | 25 ++ 8 files changed, 357 insertions(+), 293 deletions(-) diff --git a/src/components/config/tc-userBadge.vue b/src/components/config/tc-userBadge.vue index 7dc934b9..8a4209b7 100644 --- a/src/components/config/tc-userBadge.vue +++ b/src/components/config/tc-userBadge.vue @@ -21,7 +21,7 @@ {{ account.nickname }} @@ -406,23 +406,15 @@ async function showMenu(): Promise { } async function showAccounts(): Promise { - if (!userStore.uid.value) return; + if (!userStore.uid.value) { + showSnackbar({ text: "未登录!", color: "error" }); + return; + } gameAccounts.value = await TSUserAccount.game.getAccount(userStore.uid.value); -} - -async function switchGameAccount(account: TGApp.Sqlite.Account.Game): Promise { - if (account.gameUid === userStore.account.value.gameUid) { - showSnackbar({ text: "已经登录,无需切换!", color: "warn" }); + if (gameAccounts.value.length === 0) { + showSnackbar({ text: "未找到账户的游戏数据,请尝试刷新!", color: "warn" }); return; } - await TSUserAccount.game.switchAccount(account.uid, account.gameUid); - const gameAccount = await TSUserAccount.game.getCurAccount(account.uid); - if (!gameAccount) { - showSnackbar({ text: `无法获取${account.uid}的游戏信息`, color: "warn" }); - return; - } - userStore.account.value = gameAccount; - showSnackbar({ text: "成功切换游戏账户!", color: "success" }); }