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 @@
-
- -