💄 修复渲染异常

This commit is contained in:
目棃
2024-12-31 11:18:22 +08:00
parent 4cfb19dc21
commit 1350ca17df
5 changed files with 12 additions and 25 deletions

View File

@@ -110,7 +110,7 @@ const skills = computed<Array<TGApp.Game.Avatar.Skill>>(() =>
);
const nameCard = computed<string>(() => {
const cardFind = TSUserAvatar.getAvatarCard(props.modelValue.avatar.id);
return `/source/nameCard/profile/${cardFind}.webp`;
return `/WIKI/nameCard/profile/${cardFind}.webp`;
});
function getWeaponTitle(): string {

View File

@@ -99,7 +99,7 @@ const propMain = computed<Array<TGApp.Game.Avatar.PropMapItem | false>>(() =>
props.modelValue.propSelected.map((item) => userStore.getProp(item.property_type)),
);
const bg = ref<string>("/source/nameCard/profile/原神·印象.webp");
const bg = ref<string>("/WIKI/nameCard/profile/原神·印象.webp");
const avatar = ref<string>(props.modelValue.avatar.image);
const loading = ref<boolean>(false);
@@ -126,7 +126,7 @@ watch(
async function loadData(): Promise<void> {
const card = TSUserAvatar.getAvatarCard(props.modelValue.cid);
bg.value = `url("/source/nameCard/profile/${card}.webp")`;
bg.value = `url("/WIKI/nameCard/profile/${card}.webp")`;
if (!avatar.value.startsWith("blob:")) {
avatar.value = await saveImgLocal(props.modelValue.avatar.image);
}

View File

@@ -81,7 +81,7 @@ watch(() => props.modelValue, loadData);
function loadData(): void {
const card = TSUserAvatar.getAvatarCard(props.modelValue.cid);
nameCard.value = `/source/nameCard/profile/${card}.webp`;
nameCard.value = `/WIKI/nameCard/profile/${card}.webp`;
}
async function share(): Promise<void> {

View File

@@ -5,8 +5,8 @@
</template>
<template #content>
<TucDetailItemBox
:icon="`/icon/bg/${modelValue.rarity}-Star.webp`"
:bg="`/WIKI/weapon/${modelValue.id}.webp`"
:bg="`/icon/bg/${modelValue.rarity}-Star.webp`"
:icon="`/WIKI/weapon/${modelValue.id}.webp`"
/>
<div class="tuc-ddw-content">
<div class="tuc-ddwc-top">

View File

@@ -1,19 +1,16 @@
<template>
<div class="tuc-dib-box">
<div v-if="bg" class="tuc-dib-bg">
<img :src="bg" alt="bg" />
</div>
<div v-if="icon" class="tuc-dib-icon">
<img :src="icon" alt="icon" />
</div>
<img :src="bg" alt="bg" class="tuc-dib-bg" />
<img :src="icon" alt="icon" class="tuc-dib-icon" />
</div>
</template>
<script lang="ts" setup>
defineProps<{ icon?: string; bg?: string }>();
defineProps<{ icon: string; bg: string }>();
</script>
<style lang="css" scoped>
.tuc-dib-box {
position: relative;
overflow: hidden;
width: 60px;
height: 60px;
border-radius: 5px;
@@ -21,25 +18,15 @@ defineProps<{ icon?: string; bg?: string }>();
.tuc-dib-bg {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
}
.tuc-dib-bg img {
width: 100%;
height: 100%;
border-radius: 5px;
}
.tuc-dib-icon {
position: absolute;
z-index: 2;
width: 100%;
height: 100%;
}
.tuc-dib-icon img {
width: 100%;
height: 100%;
border-radius: 5px;
}
</style>