From fb68e87624cc43269b688f6c5a43996a90df5baf Mon Sep 17 00:00:00 2001 From: zzc <1761997216@qq.com> Date: Wed, 28 Jan 2026 21:37:37 +0800 Subject: [PATCH] fix: wteail detail --- api/wallpaper.js | 7 ++ pages/wallpaper/detail.vue | 241 +++++++++++++++++-------------------- 2 files changed, 117 insertions(+), 131 deletions(-) diff --git a/api/wallpaper.js b/api/wallpaper.js index 381dd0a..2f4ac74 100644 --- a/api/wallpaper.js +++ b/api/wallpaper.js @@ -13,3 +13,10 @@ export const getWallpaperCategoryList = async () => { method: "GET", }); }; + +export const getWallpaperRecommendList = async () => { + return request({ + url: `/api/blessing/wallpaper/recommend/list`, + method: "get", + }); +}; diff --git a/pages/wallpaper/detail.vue b/pages/wallpaper/detail.vue index 87175e1..618f6b0 100644 --- a/pages/wallpaper/detail.vue +++ b/pages/wallpaper/detail.vue @@ -13,109 +13,107 @@ - - - - - - - {{ - detailData.from.nickname || "神秘好友" - }} - 给你分享了一张2026新春精美壁纸 - ★ 2026 且马贺岁 - - - - - - PREVIEW - - - - - - - - - - - - 更多精美新春壁纸 - - 查看更多 - - - - - - - {{ item.title || "新春壁纸" }} - - - - - - - - - - - - - - - - - - - - - - - - - - - 2026 HAPPY NEW YEAR - - - 新春祝福 · 传递温情 + + + + + + {{ + detailData.from.nickname || "神秘好友" + }} + 给你分享了一张2026新春精美壁纸 + ★ 2026 且马贺岁 - + + + + PREVIEW + + + + + + + + + + + + 更多精美新春壁纸 + + 查看更多 + + + + + + + {{ item.title || "新春壁纸" }} + + + + + + + + + + + + + + + + + + + + + + + + + + + 2026 HAPPY NEW YEAR + + + 新春祝福 · 传递温情 + + @@ -124,7 +122,7 @@ import { ref } from "vue"; import { onLoad } from "@dcloudio/uni-app"; import { getBavBarHeight } from "@/utils/system"; import { getPageDetail } from "@/api/system"; -import { getWallpaperList } from "@/api/wallpaper"; +import { getWallpaperRecommendList } from "@/api/wallpaper"; import { saveViewRequest } from "@/utils/common.js"; const navHeight = getBavBarHeight(); @@ -162,13 +160,8 @@ const fetchDetail = async () => { const fetchRecommend = async () => { try { - // Try to get wallpapers. Assuming empty category returns a default list or we use a known category if available. - // For now, passing empty string as categoryId. - const res = await getWallpaperList("", 1); - if (res && res.list) { - // Take first 3 items - recommendList.value = res.list.slice(0, 3); - } + const res = await getWallpaperRecommendList(); + recommendList.value = res; } catch (e) { console.error("Failed to fetch recommendations", e); } @@ -198,22 +191,15 @@ const goToFortune = () => { }; const previewImage = () => { - if (detailData.value.imageUrl) { - uni.previewImage({ - urls: [detailData.value.imageUrl], - }); - } + // if (detailData.value.imageUrl) { + // uni.previewImage({ + // urls: [detailData.value.imageUrl], + // }); + // } }; -const onRecommendClick = (item) => { - // If clicking a recommended item, maybe we just preview it or go to wallpaper list? - // Since this is a "detail" page for a specific share, clicking another wallpaper - // might normally go to its detail, but we don't have a generic detail page logic - // (unless we reuse this page with a new token, but these items might not have tokens). - // Best fallback: Preview it. - uni.previewImage({ - urls: [item.imageUrl], - }); +const onRecommendClick = () => { + goToIndex(); }; const goToGreeting = () => { @@ -232,8 +218,6 @@ const goToAvatar = () => { min-height: 100vh; background: #ffffff; box-sizing: border-box; - display: flex; - flex-direction: column; } .nav-bar { @@ -242,7 +226,7 @@ const goToAvatar = () => { left: 0; width: 100%; z-index: 100; - background-color: transparent; // Make it transparent as per design + background-color: #ffffff; .nav-content { height: 44px; // Standard nav height @@ -274,11 +258,6 @@ const goToAvatar = () => { } } -.content-scroll { - flex: 1; - height: 0; // Important for scroll-view in flex container -} - .content-container { padding: 20px; padding-bottom: 40px;