diff --git a/index.html b/index.html index 1cd841d..55990ae 100644 --- a/index.html +++ b/index.html @@ -1,15 +1,12 @@ - + 晓螺|摄影接单 - - - - +
diff --git a/src/App.vue b/src/App.vue index abf8be2..0249d97 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,6 +2,7 @@ import { ref, onMounted, nextTick } from "vue"; import { snapdom } from "@zumer/snapdom"; import { Camera, Palette, Star, Aperture, Zap, User, Lightbulb, HeartHandshake, Users2, MapPin, WandSparkles } from "lucide-vue-next"; +import { IconQQ, IconWeChat, IconXHS } from "./components/common/icons"; interface MediaItem { id: number; @@ -11,6 +12,8 @@ interface MediaItem { thumb_url: string; meta: string; take_time: string; + width?: number; + height?: number; } const photos = ref([]); @@ -24,11 +27,17 @@ const fetchPhotos = async () => { const response = await fetch("https://paul.ren/api/media?cate=9&starred=1&size=30"); const data = await response.json(); // 处理图片 URL - photos.value = data.data.map((photo: MediaItem) => ({ - ...photo, - url: getImageUrl(photo.url), - thumb_url: getImageUrl(photo.thumb_url), - })); + photos.value = data.data.map((photo: MediaItem) => { + const parsedMeta = JSON.parse(photo.meta); + + return { + ...photo, + url: getImageUrl(photo.url), + thumb_url: getImageUrl(photo.thumb_url), + width: parsedMeta.COMPUTED.Width, + height: parsedMeta.COMPUTED.Height, + }; + }); loading.value = false; await nextTick(); @@ -69,17 +78,18 @@ const captureScreenshot = async () => { if (!posterRef.value || isCapturing.value) return; isCapturing.value = true; + try { const result = await snapdom(posterRef.value, { width: 1024, // format: 'png', quality: 1, - // scale: 2 + // scale: 2, }); result.download({ format: "webp", - filename: `晓螺摄影_${new Date().getTime()}.webp`, + filename: `晓螺摄影_${new Date().getTime()}`, }); } catch (error) { console.error("Screenshot failed:", error); @@ -172,7 +182,7 @@ onMounted(() => {
-
+
近期例图
@@ -180,8 +190,8 @@ onMounted(() => {
-
- +
+

{{ photo.title }}

{{ formatDate(photo.take_time) }}

@@ -189,6 +199,25 @@ onMounted(() => {
+
+ +
联系方式
+ +
+
+
+ + 1204958596 +
+
+ + dreamer-paul +
+
+ + @晓螺 +
+