mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
💄 弹窗改为弹出框
This commit is contained in:
86
src/components/overlay/to-namecard.vue
Normal file
86
src/components/overlay/to-namecard.vue
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
<template>
|
||||||
|
<!-- todo 支持 share -->
|
||||||
|
<TOverlay v-model="visible" hide :to-click="onCancel" blur-val="20px">
|
||||||
|
<div class="ton-box" v-if="props.data">
|
||||||
|
<img alt="bg" class="ton-bg" v-if="props.data" :src="props.data.profile" />
|
||||||
|
<div class="ton-content">
|
||||||
|
<span>{{ props.data.name }}</span>
|
||||||
|
<span>{{ props.data.desc }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</TOverlay>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from "vue";
|
||||||
|
|
||||||
|
import TOverlay from "../main/t-overlay.vue";
|
||||||
|
|
||||||
|
interface ToNamecardProps {
|
||||||
|
modelValue: boolean;
|
||||||
|
data?: {
|
||||||
|
profile: string;
|
||||||
|
name: string;
|
||||||
|
bg: string;
|
||||||
|
icon: string;
|
||||||
|
desc: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
type ToNamecardEmits = (e: "update:modelValue", value: boolean) => void;
|
||||||
|
|
||||||
|
const props = defineProps<ToNamecardProps>();
|
||||||
|
|
||||||
|
const emits = defineEmits<ToNamecardEmits>();
|
||||||
|
|
||||||
|
const visible = computed({
|
||||||
|
get: () => props.modelValue,
|
||||||
|
set: (value) => {
|
||||||
|
emits("update:modelValue", value);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
function onCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="css" scoped>
|
||||||
|
.ton-box {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 800px;
|
||||||
|
height: 400px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ton-bg {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ton-content {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 10px;
|
||||||
|
background: rgb(0 0 0 / 20%);
|
||||||
|
box-shadow: 0 0 10px rgb(255 255 255 /20%);
|
||||||
|
color: var(--tgc-white-1);
|
||||||
|
text-shadow: 0 0 5px rgb(0 0 0/80%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ton-content :nth-child(1) {
|
||||||
|
font-family: var(--font-title);
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ton-content :nth-child(2) {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -100,6 +100,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ToNamecard v-model="showNameCard" :data="curCard" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -110,10 +111,10 @@ import { useRoute, useRouter } from "vue-router";
|
|||||||
import showConfirm from "../../components/func/confirm";
|
import showConfirm from "../../components/func/confirm";
|
||||||
import showSnackbar from "../../components/func/snackbar";
|
import showSnackbar from "../../components/func/snackbar";
|
||||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||||
|
import ToNamecard from "../../components/overlay/to-namecard.vue";
|
||||||
import { AppAchievementSeriesData } from "../../data";
|
import { AppAchievementSeriesData } from "../../data";
|
||||||
import TGSqlite from "../../plugins/Sqlite";
|
import TGSqlite from "../../plugins/Sqlite";
|
||||||
import { useAchievementsStore } from "../../store/modules/achievements";
|
import { useAchievementsStore } from "../../store/modules/achievements";
|
||||||
import { createTGWindow } from "../../utils/TGWindow";
|
|
||||||
import { getNowStr } from "../../utils/toolFunc";
|
import { getNowStr } from "../../utils/toolFunc";
|
||||||
import { getUiafHeader, readUiafData, verifyUiafData } from "../../utils/UIAF";
|
import { getUiafHeader, readUiafData, verifyUiafData } from "../../utils/UIAF";
|
||||||
|
|
||||||
@@ -125,6 +126,7 @@ const loading = ref<boolean>(true);
|
|||||||
const loadingTitle = ref<string>("正在加载数据");
|
const loadingTitle = ref<string>("正在加载数据");
|
||||||
const search = ref<string>("");
|
const search = ref<string>("");
|
||||||
const hideFin = ref<boolean>(false);
|
const hideFin = ref<boolean>(false);
|
||||||
|
const showNameCard = ref<boolean>(false);
|
||||||
// data
|
// data
|
||||||
const title = ref(achievementsStore.title);
|
const title = ref(achievementsStore.title);
|
||||||
let curCard = reactive({ profile: "", bg: "", icon: "", name: "", desc: "" });
|
let curCard = reactive({ profile: "", bg: "", icon: "", name: "", desc: "" });
|
||||||
@@ -237,7 +239,7 @@ async function selectSeries(index: number): Promise<void> {
|
|||||||
|
|
||||||
// 打开图片
|
// 打开图片
|
||||||
function openImg(): void {
|
function openImg(): void {
|
||||||
createTGWindow(curCard.profile, "Sub_window", `Namecard_${curCard.name}`, 840, 400, false);
|
showNameCard.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function searchCard(): Promise<void> {
|
async function searchCard(): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user