From 68f91035df971d579bdb55161fa28f6e90fc241d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Fri, 16 Aug 2024 14:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E8=A1=A8=E4=BB=A5=E5=AD=98=E5=82=A8=E6=96=B0=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/userAvatar/tua-avatar-box.vue | 53 +++-- src/pages/User/Characters.vue | 190 +++++------------- src/plugins/Sqlite/index.ts | 57 +----- src/plugins/Sqlite/modules/userAvatar.ts | 45 +++++ src/plugins/Sqlite/sql/createTable.sql | 27 +-- src/plugins/Sqlite/sql/insertData.ts | 44 ++--- src/plugins/Sqlite/utils/transUserRoles.ts | 158 ++------------- src/types/Game/Avatar.d.ts | 34 ++-- src/types/Sqlite/Character.d.ts | 194 ++++++------------- 9 files changed, 253 insertions(+), 549 deletions(-) diff --git a/src/components/userAvatar/tua-avatar-box.vue b/src/components/userAvatar/tua-avatar-box.vue index b530daa6..6b232c73 100644 --- a/src/components/userAvatar/tua-avatar-box.vue +++ b/src/components/userAvatar/tua-avatar-box.vue @@ -9,7 +9,7 @@
fetter - {{ props.modelValue.base.fetter }} + {{ props.modelValue.avatar.fetter }}
@@ -41,8 +41,8 @@ relic relic
-
- bg +
+ bg
{{ relic.level }} @@ -51,10 +51,18 @@
- {{ relic === false ? getRelicName(index) : getPropName(relic) }} + {{ relic === false ? getRelicName(index) : relic.main_property.value }}
-
- {{ relic !== false ? relic.main_property.value : "" }} +
+
+ prop + {{ getPropName(relic)?.name }} +
@@ -70,7 +78,7 @@ import { getZhElement } from "../../utils/toolFunc.js"; import TItembox, { TItemBoxData } from "../main/t-itembox.vue"; interface TuaAvatarBoxProps { - modelValue: TGApp.Game.Avatar.DetailList; + modelValue: TGApp.Sqlite.Character.UserRole; } type FixedLenArr = [T, ...T[]] & { length: N }; @@ -80,7 +88,7 @@ const props = defineProps(); const userStore = useUserStore(); const avatarBox = computed(() => { - const avatar = props.modelValue.base; + const avatar = props.modelValue.avatar; return { size: "100px", height: "120px", @@ -118,10 +126,10 @@ const weaponBox = computed(() => { }; }); const isFetterMax = computed(() => { - if (props.modelValue.base.id === 10000005 || props.modelValue.base.id === 10000007) { + if (props.modelValue.avatar.id === 10000005 || props.modelValue.avatar.id === 10000007) { return true; } - return props.modelValue.base.fetter === 10; + return props.modelValue.avatar.fetter === 10; }); const skills = computed(() => { return props.modelValue.skills.filter((skill) => skill.skill_type === 1); @@ -141,8 +149,8 @@ const nameCard = ref(false); onMounted(async () => { if (!props.modelValue) return; - if (props.modelValue.base.id !== 10000005 && props.modelValue.base.id !== 10000007) { - const role = await TGSqlite.getAppCharacter(props.modelValue.base.id); + if (props.modelValue.avatar.id !== 10000005 && props.modelValue.avatar.id !== 10000007) { + const role = await TGSqlite.getAppCharacter(props.modelValue.avatar.id); nameCard.value = `/source/nameCard/profile/${role.nameCard}.webp`; } else { nameCard.value = "/source/nameCard/profile/原神·印象.webp"; @@ -154,9 +162,8 @@ function getRelicName(pos: number): string { return nameList[pos]; } -function getPropName(relic: TGApp.Game.Avatar.Relic): string { - const prop = userStore.getProp(relic.main_property.property_type); - return prop === false ? "" : prop.name; +function getPropName(relic: TGApp.Game.Avatar.Relic): TGApp.Game.Avatar.PropMapItem | false { + return userStore.getProp(relic.main_property.property_type); } diff --git a/src/pages/User/Characters.vue b/src/pages/User/Characters.vue index 3f131576..020ec95d 100644 --- a/src/pages/User/Characters.vue +++ b/src/pages/User/Characters.vue @@ -9,19 +9,13 @@ 暂无数据
- + - 更新角色数据 + 刷新 - - - 更新天赋数据 - - + @@ -30,7 +24,7 @@
-
- -