From 2433c89c2b2335592bb60f43ddb9b1a06cfe1141 Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Wed, 27 Nov 2024 17:52:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E8=A1=A8=E6=83=85?= =?UTF-8?q?=E5=8C=85=E4=B8=8B=E8=BD=BD=E6=A0=BC=E5=BC=8F=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/emoji/[id].vue | 31 ++++++++++++++++++++++++++----- src/types.ts | 6 +++--- src/utils/image.ts | 16 ++++++++-------- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/pages/emoji/[id].vue b/src/pages/emoji/[id].vue index 6cf881e..31bb7dc 100644 --- a/src/pages/emoji/[id].vue +++ b/src/pages/emoji/[id].vue @@ -2,7 +2,7 @@ import { APIFetch } from "../../APIFetch.ts"; import { BatchDownloadTask, - EmojiImages, + EmojiImage, EmojiPackageDetail, SuitDetail, SuitEmojiPackageProperties @@ -11,7 +11,7 @@ import { autoJump, resolveText } from "../../utils/linkResolver.ts"; import { sep } from "@tauri-apps/api/path"; import { UnwrapRef } from "vue"; import { formatToUrl } from "../../utils/image.ts"; -import {globalConfig} from "../../utils/globalConfig.ts"; +import { allowedImageFormats, globalConfig } from "../../utils/globalConfig.ts"; const route = useRoute<'/emoji/[id]'>() const loading = ref(false) @@ -19,7 +19,7 @@ const loading = ref(false) const id = ref('') const name = ref('') -const emojiInfo = ref<(EmojiImages & { +const emojiInfo = ref<(EmojiImage & { name: string })[]>([]) const link = ref('') @@ -147,7 +147,10 @@ const resolveLink = async () => { } } -const pictureLinks = computed(() => emojiInfo.value.map(e => e.image_webp ?? e.image_gif ?? e.image)) +// 是否为动态表情包 +const hasDynamicImage = computed(() => emojiInfo.value.some(e => e.image_webp !== undefined || e.image_gif !== undefined)) + +const pictureLinks = computed(() => emojiInfo.value.map(image => formatToUrl(globalConfig.value.imageSaveFormat, image)))