From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示

---
 src/hooks/components/EventPopUpBox.vue |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/hooks/components/EventPopUpBox.vue b/src/hooks/components/EventPopUpBox.vue
index 5a50e29..ddee5be 100644
--- a/src/hooks/components/EventPopUpBox.vue
+++ b/src/hooks/components/EventPopUpBox.vue
@@ -31,7 +31,7 @@
 	</div>
 </template>
 <script setup>
-import { ElImage } from 'element-plus'
+import { ElImage, ElIcon } from 'element-plus'
 
 // src="@/assets/images/home/useEventOperate/eventErr.png"
 import { Close } from '@element-plus/icons-vue'
@@ -54,10 +54,20 @@
 	loading.value = true
 	const res = await getEventDetails({ id: props.data.eventId })
 	info.value = res.data.data
-
-	info.value.url = import.meta.env.VITE_APP_AIRLINE_URL + info.value.url
+	info.value.url = disposeUrl(info.value)
 	loading.value = false
 })
+
+const disposeUrl = ({ url, media_type }) => {
+	if (media_type == 'PHOTO_TYPE') {
+		const parts = url.split('.')
+		parts[parts.length - 2] += '_small' // 在最后一个点前插入 _small
+
+		return import.meta.env.VITE_APP_AIRLINE_URL + parts.join('.')
+	}
+
+	return import.meta.env.VITE_APP_AIRLINE_URL + url
+}
 </script>
 
 <style scoped lang="scss">

--
Gitblit v1.9.3