Skip to content

Commit

Permalink
💄深渊分享显示应用信息,圣遗物详情推荐属性高亮
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Oct 17, 2024
1 parent 632b4e8 commit 9744419
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 25 deletions.
49 changes: 46 additions & 3 deletions src/components/userAvatar/tua-dc-relic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@
:src="propMain.icon"
alt="propMain"
/>
<span>{{ propMain !== false ? propMain.name : "未知属性" }}</span>
<span :style="getPropMainStyle()">
{{ propMain !== false ? propMain.name : "未知属性" }}
</span>
</span>
<span>{{ props.modelValue.main_property.value }}</span>
</div>
<div v-for="(prop, index) in propSubs" :key="index" class="tua-dcr-prop">
<span class="tua-prop-sub">
<img v-if="prop !== false && prop.icon !== ''" :src="prop.icon" alt="propSub" />
<span>{{ prop !== false ? prop.name : "未知属性" }}</span>
<span :style="getPropSubStyle(prop, props.recommend.sub_property_list)">
{{ prop !== false ? prop.name : "未知属性" }}
</span>
<span class="tua-prop-time" v-if="props.modelValue.sub_property_list[index].times !== 0">
{{ props.modelValue.sub_property_list[index].times }}
</span>
Expand All @@ -60,6 +64,7 @@ import { useUserStore } from "../../store/modules/user.js";
interface TuaDcRelicProps {
modelValue: TGApp.Game.Avatar.Relic | false;
pos: "1" | "2" | "3" | "4" | "5";
recommend: TGApp.Game.Avatar.PropRecommend;
}
const props = defineProps<TuaDcRelicProps>();
Expand All @@ -85,6 +90,45 @@ function getRelicTitle(): string {
if (props.modelValue === false) return getRelicPos();
return props.modelValue.name;
}
function getPropMainStyle(): string {
if (props.modelValue === false) return "";
if (props.pos === "3") {
if (
props.recommend.sand_main_property_list.includes(props.modelValue.main_property.property_type)
) {
return "color: var(--tgc-yellow-1);";
}
}
if (props.pos === "4") {
if (
props.recommend.goblet_main_property_list.includes(
props.modelValue.main_property.property_type,
)
) {
return "color: var(--tgc-yellow-1);";
}
}
if (props.pos === "5") {
if (
props.recommend.circlet_main_property_list.includes(
props.modelValue.main_property.property_type,
)
) {
return "color: var(--tgc-yellow-1);";
}
}
return "";
}
function getPropSubStyle(
propItem: TGApp.Game.Avatar.PropMapItem | false,
propsR: number[],
): string {
if (propItem === false) return "";
if (propsR.includes(propItem.property_type)) return "color: var(--tgc-yellow-1);";
return "";
}
</script>
<style lang="css" scoped>
.tua-dcr-box {
Expand Down Expand Up @@ -232,7 +276,6 @@ function getRelicTitle(): string {
.tua-prop-time {
width: 14px;
height: 14px;
padding-bottom: 1px;
border: 1px solid rgb(255 255 255 / 20%);
border-radius: 4px;
background: rgb(0 0 0 / 20%);
Expand Down
30 changes: 25 additions & 5 deletions src/components/userAvatar/tua-detail-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,31 @@
:uid="props.modelValue.uid"
:updated="props.modelValue.updated"
/>
<TuaDcRelic :model-value="relicList[0]" pos="1" />
<TuaDcRelic :model-value="relicList[1]" pos="2" />
<TuaDcRelic :model-value="relicList[2]" pos="3" />
<TuaDcRelic :model-value="relicList[3]" pos="4" />
<TuaDcRelic :model-value="relicList[4]" pos="5" />
<TuaDcRelic
:model-value="relicList[0]"
pos="1"
:recommend="props.modelValue.propRecommend.recommend_properties"
/>
<TuaDcRelic
:model-value="relicList[1]"
pos="2"
:recommend="props.modelValue.propRecommend.recommend_properties"
/>
<TuaDcRelic
:model-value="relicList[2]"
pos="3"
:recommend="props.modelValue.propRecommend.recommend_properties"
/>
<TuaDcRelic
:model-value="relicList[3]"
pos="4"
:recommend="props.modelValue.propRecommend.recommend_properties"
/>
<TuaDcRelic
:model-value="relicList[4]"
pos="5"
:recommend="props.modelValue.propRecommend.recommend_properties"
/>
</div>
<!-- 左下命座跟天赋 -->
<div class="tua-dc-lb">
Expand Down
20 changes: 10 additions & 10 deletions src/components/userAvatar/tua-detail-overlay.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<TOverlay v-model="visible" hide blur-val="5px" :to-click="onCancel">
<TOverlay v-model="visible" :hide="true" blur-val="5px" :to-click="onCancel">
<div class="tdo-box">
<div class="tdo-avatars-container">
<v-tabs
Expand All @@ -15,15 +15,7 @@
@click="onAvatarClick(avatar)"
:title="avatar.avatar.name"
>
<div
class="tdo-avatar"
:style="{
backgroundColor:
props.avatar.avatar.id === avatar.avatar.id
? 'var(--tgc-od-white)'
: 'transparent',
}"
>
<div class="tdo-avatar" :style="getAvatarBg(avatar)">
<img :src="avatar.avatar.side_icon" :alt="avatar.avatar.name" />
</div>
</v-tab>
Expand Down Expand Up @@ -89,6 +81,7 @@ const modeTab = computed<"classic" | "card" | "dev">({
get: () => props.mode,
set: (val) => emits("update:mode", val),
});
const avatarsWidth = computed<string>(() => {
switch (props.mode) {
case "classic":
Expand Down Expand Up @@ -121,6 +114,13 @@ function handleClick(pos: "left" | "right"): void {
function onAvatarClick(avatar: TGApp.Sqlite.Character.UserRole): void {
emits("toAvatar", avatar);
}
function getAvatarBg(avatar: TGApp.Sqlite.Character.UserRole): string {
if (props.avatar.avatar.id === avatar.avatar.id) {
return "background-color:var(--tgc-od-white);";
}
return "background-color:transparent;";
}
</script>
<style lang="css" scoped>
.tdo-box {
Expand Down
33 changes: 26 additions & 7 deletions src/pages/User/Abyss.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@
class="ua-window-item"
>
<div :id="`user-abyss-${item.id}`" class="uaw-i-ref">
<div class="uaw-title">
<span>第</span>
<span>{{ item.id }}</span>
<span>期 UID</span>
<span>{{ uidCur }}</span>
<span>更新于</span>
<span>{{ item.updated }}</span>
<div class="uaw-top">
<div class="uaw-title">
<span>第</span>
<span>{{ item.id }}</span>
<span>期 UID</span>
<span>{{ uidCur }}</span>
<span>更新于</span>
<span>{{ item.updated }}</span>
</div>
<div class="uaw-share">Render by TeyvatGuide v{{ version }}</div>
</div>
<TSubLine>统计周期 {{ item.startTime }} ~ {{ item.endTime }}</TSubLine>
<div class="uaw-o-box">
Expand Down Expand Up @@ -95,6 +98,7 @@
</div>
</template>
<script lang="ts" setup>
import { getVersion } from "@tauri-apps/api/app";
import { storeToRefs } from "pinia";
import { onMounted, ref, watch, computed } from "vue";
Expand Down Expand Up @@ -125,6 +129,7 @@ const user = computed<TGApp.Sqlite.Account.Game>(() => userStore.account.value);
const localAbyss = ref<TGApp.Sqlite.Abyss.SingleTable[]>([]);
const abyssRef = ref<HTMLElement>(<HTMLElement>{});
const version = ref<string>();
const uidList = ref<string[]>();
const uidCur = ref<string>();
Expand All @@ -133,6 +138,7 @@ const abyssIdList = computed<number[]>(() => {
});
onMounted(async () => {
version.value = await getVersion();
await TGLogger.Info("[UserAbyss][onMounted] 打开角色深渊页面");
loadingTitle.value = "正在加载深渊数据";
uidList.value = await TSUserAbyss.getAllUid();
Expand Down Expand Up @@ -379,6 +385,13 @@ async function deleteAbyss(): Promise<void> {
gap: 5px;
}
.uaw-top {
display: flex;
width: 100%;
align-items: flex-end;
justify-content: space-between;
}
.uaw-title {
display: flex;
align-items: center;
Expand All @@ -393,6 +406,12 @@ async function deleteAbyss(): Promise<void> {
color: var(--tgc-yellow-1);
}
.uaw-share {
z-index: -1;
font-size: 12px;
opacity: 0.8;
}
.uaw-o-box {
display: grid;
width: 100%;
Expand Down

0 comments on commit 9744419

Please sign in to comment.