️增加主角名片

This commit is contained in:
BTMuli
2024-01-14 00:02:41 +08:00
parent d2842e7139
commit 9ca507f777
2 changed files with 13 additions and 6 deletions

View File

@@ -96,6 +96,8 @@ async function loadData(): Promise<void> {
if (props.dataVal.cid !== 10000005 && props.dataVal.cid !== 10000007) {
const role = await TGSqlite.getAppCharacter(props.dataVal.cid);
nameCard.value = `/source/nameCard/profile/${role.nameCard}.webp`;
} else {
nameCard.value = "/source/nameCard/profile/原神·印象.webp";
}
}

View File

@@ -10,7 +10,7 @@
<span>{{ props.modelValue.fetter }}</span>
</div>
<div class="tuc-rbm-other">
<span v-if="props.modelValue.fetter !== 10">
<span v-if="!showNameCard">
<v-icon>mdi-lock-outline</v-icon>
</span>
<span v-if="props.modelValue.costume !== '[]'">
@@ -20,11 +20,7 @@
</div>
<div class="tuc-rb-bottom">
<div class="tuc-rbb-bg">
<img
v-if="nameCard !== false && props.modelValue.fetter === 10"
:src="nameCard"
alt="nameCard"
/>
<img v-if="nameCard !== false && showNameCard" :src="nameCard" alt="nameCard" />
</div>
<div v-show="talents.length > 0" class="tuc-rbb-content">
<div v-for="talent in talents" :key="talent.pos" class="tuc-rbb-talent">
@@ -48,6 +44,13 @@ interface TucRoleBoxProps {
const props = defineProps<TucRoleBoxProps>();
const talents = ref<TGApp.Sqlite.Character.RoleTalent[]>([]);
const showNameCard = computed(() => {
if (props.modelValue.cid === 10000005 || props.modelValue.cid === 10000007) {
return true;
} else {
return props.modelValue.fetter === 10;
}
});
const avatarBox = computed(() => {
return {
@@ -92,6 +95,8 @@ onMounted(async () => {
if (props.modelValue.cid !== 10000005 && props.modelValue.cid !== 10000007) {
const role = await TGSqlite.getAppCharacter(props.modelValue.cid);
nameCard.value = `/source/nameCard/profile/${role.nameCard}.webp`;
} else {
nameCard.value = "/source/nameCard/profile/原神·印象.webp";
}
if (props.modelValue.talent !== "" && props.modelValue.talent !== "[]") {
const talentsLocal: TGApp.Sqlite.Character.RoleTalent[] = JSON.parse(props.modelValue.talent);