From 63b7f685c1bed5e11dc509aa2c03ddef02840c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Fri, 10 Jan 2025 17:41:08 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20=E6=94=AF=E6=8C=81=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=9B=BE=E5=83=8F=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/app/t-postcard.vue | 2 +- src/components/userGacha/gro-table.vue | 2 +- src/components/viewPost/tp-image.vue | 13 +- src/components/viewPost/tp-linkCard.vue | 15 ++- src/components/viewPost/tp-video.vue | 6 +- src/components/viewPost/tp-vod.vue | 21 +++- src/components/viewPost/vp-overlay-image.vue | 19 ++- src/pages/common/PageConfig.vue | 120 ++++++++++++++----- src/store/modules/app.ts | 22 +++- 9 files changed, 156 insertions(+), 64 deletions(-) diff --git a/src/components/app/t-postcard.vue b/src/components/app/t-postcard.vue index 1dd3be8e..82b1fe7c 100644 --- a/src/components/app/t-postcard.vue +++ b/src/components/app/t-postcard.vue @@ -142,7 +142,7 @@ function getPostCover(item: TGApp.Plugins.Mys.Post.FullData): string { else if (item.post.images.length > 0) cover = item.post.images[0]; if (cover === undefined) return ""; if (cover.endsWith(".gif")) return cover; - // 裁剪图片格式为 png,比例为 36:13,进行缩放但是不拉伸 + // return `${cover}?x-oss-process=image/resize,m_fill,w_360,h_130,limit_0/format,jpg/quality,Q_${imageQualityPercent.value}`; return `${cover}?x-oss-process=image/resize,m_fill,w_360,h_130,limit_0/format,png`; } diff --git a/src/components/userGacha/gro-table.vue b/src/components/userGacha/gro-table.vue index 0aba7b2d..9bff9837 100644 --- a/src/components/userGacha/gro-table.vue +++ b/src/components/userGacha/gro-table.vue @@ -25,7 +25,7 @@ type GroTableProps = { modelValue: Array const props = defineProps(); -const headers = [ +const headers = [ { title: "时间", align: "center", key: "time" }, { title: "卡池", align: "center", key: "uigfType" }, { title: "类型", align: "center", key: "type" }, diff --git a/src/components/viewPost/tp-image.vue b/src/components/viewPost/tp-image.vue index 142cf230..2d01a951 100644 --- a/src/components/viewPost/tp-image.vue +++ b/src/components/viewPost/tp-image.vue @@ -2,7 +2,7 @@
-
+
加载中...
@@ -13,6 +13,7 @@ import { computed, onMounted, onUnmounted, ref } from "vue"; import VpOverlayImage from "./vp-overlay-image.vue"; +import { useAppStore } from "@/store/modules/app.js"; import { saveImgLocal } from "@/utils/TGShare.js"; import { bytesToSize } from "@/utils/toolFunc.js"; @@ -28,6 +29,7 @@ export type TpImage = { }; type TpImageProps = { data: TpImage }; +const appStore = useAppStore(); const props = defineProps(); const showOverlay = ref(false); const localUrl = ref(); @@ -41,7 +43,7 @@ const imgWidth = computed(() => { console.log("tp-image", props.data.insert.image, props.data.attributes); onMounted(async () => { - const link = getImageUrl(); + const link = appStore.getImageUrl(props.data.insert.image); localUrl.value = await saveImgLocal(link); }); @@ -63,13 +65,6 @@ function getImageTitle(): string { } return res.join("\n"); } - -function getImageUrl(): string { - const img = props.data.insert.image; - const append = "?x-oss-process=image/format,png"; - if (img.endsWith(".gif")) return img; - return img + append; -}