💄 弹窗改为弹出框

This commit is contained in:
BTMuli
2023-12-18 22:05:16 +08:00
parent 5a95fc1eda
commit 48159aa483
2 changed files with 90 additions and 2 deletions

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

View File

@@ -100,6 +100,7 @@
</div>
</div>
</div>
<ToNamecard v-model="showNameCard" :data="curCard" />
</template>
<script lang="ts" setup>
@@ -110,10 +111,10 @@ import { useRoute, useRouter } from "vue-router";
import showConfirm from "../../components/func/confirm";
import showSnackbar from "../../components/func/snackbar";
import ToLoading from "../../components/overlay/to-loading.vue";
import ToNamecard from "../../components/overlay/to-namecard.vue";
import { AppAchievementSeriesData } from "../../data";
import TGSqlite from "../../plugins/Sqlite";
import { useAchievementsStore } from "../../store/modules/achievements";
import { createTGWindow } from "../../utils/TGWindow";
import { getNowStr } from "../../utils/toolFunc";
import { getUiafHeader, readUiafData, verifyUiafData } from "../../utils/UIAF";
@@ -125,6 +126,7 @@ const loading = ref<boolean>(true);
const loadingTitle = ref<string>("正在加载数据");
const search = ref<string>("");
const hideFin = ref<boolean>(false);
const showNameCard = ref<boolean>(false);
// data
const title = ref(achievementsStore.title);
let curCard = reactive({ profile: "", bg: "", icon: "", name: "", desc: "" });
@@ -237,7 +239,7 @@ async function selectSeries(index: number): Promise<void> {
// 打开图片
function openImg(): void {
createTGWindow(curCard.profile, "Sub_window", `Namecard_${curCard.name}`, 840, 400, false);
showNameCard.value = true;
}
async function searchCard(): Promise<void> {