fix: wteail detail

This commit is contained in:
zzc
2026-01-28 21:37:37 +08:00
parent c0a4423124
commit fb68e87624
2 changed files with 117 additions and 131 deletions

View File

@@ -13,3 +13,10 @@ export const getWallpaperCategoryList = async () => {
method: "GET", method: "GET",
}); });
}; };
export const getWallpaperRecommendList = async () => {
return request({
url: `/api/blessing/wallpaper/recommend/list`,
method: "get",
});
};

View File

@@ -13,7 +13,6 @@
</view> </view>
</view> </view>
<scroll-view scroll-y class="content-scroll">
<view class="content-container"> <view class="content-container">
<!-- Sharer Info --> <!-- Sharer Info -->
<view class="sharer-info" v-if="detailData.from"> <view class="sharer-info" v-if="detailData.from">
@@ -115,7 +114,6 @@
<view class="footer-sub">新春祝福 · 传递温情</view> <view class="footer-sub">新春祝福 · 传递温情</view>
</view> </view>
</view> </view>
</scroll-view>
</view> </view>
</template> </template>
@@ -124,7 +122,7 @@ import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { getBavBarHeight } from "@/utils/system"; import { getBavBarHeight } from "@/utils/system";
import { getPageDetail } from "@/api/system"; import { getPageDetail } from "@/api/system";
import { getWallpaperList } from "@/api/wallpaper"; import { getWallpaperRecommendList } from "@/api/wallpaper";
import { saveViewRequest } from "@/utils/common.js"; import { saveViewRequest } from "@/utils/common.js";
const navHeight = getBavBarHeight(); const navHeight = getBavBarHeight();
@@ -162,13 +160,8 @@ const fetchDetail = async () => {
const fetchRecommend = async () => { const fetchRecommend = async () => {
try { try {
// Try to get wallpapers. Assuming empty category returns a default list or we use a known category if available. const res = await getWallpaperRecommendList();
// For now, passing empty string as categoryId. recommendList.value = res;
const res = await getWallpaperList("", 1);
if (res && res.list) {
// Take first 3 items
recommendList.value = res.list.slice(0, 3);
}
} catch (e) { } catch (e) {
console.error("Failed to fetch recommendations", e); console.error("Failed to fetch recommendations", e);
} }
@@ -198,22 +191,15 @@ const goToFortune = () => {
}; };
const previewImage = () => { const previewImage = () => {
if (detailData.value.imageUrl) { // if (detailData.value.imageUrl) {
uni.previewImage({ // uni.previewImage({
urls: [detailData.value.imageUrl], // urls: [detailData.value.imageUrl],
}); // });
} // }
}; };
const onRecommendClick = (item) => { const onRecommendClick = () => {
// If clicking a recommended item, maybe we just preview it or go to wallpaper list? goToIndex();
// 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 goToGreeting = () => { const goToGreeting = () => {
@@ -232,8 +218,6 @@ const goToAvatar = () => {
min-height: 100vh; min-height: 100vh;
background: #ffffff; background: #ffffff;
box-sizing: border-box; box-sizing: border-box;
display: flex;
flex-direction: column;
} }
.nav-bar { .nav-bar {
@@ -242,7 +226,7 @@ const goToAvatar = () => {
left: 0; left: 0;
width: 100%; width: 100%;
z-index: 100; z-index: 100;
background-color: transparent; // Make it transparent as per design background-color: #ffffff;
.nav-content { .nav-content {
height: 44px; // Standard nav height 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 { .content-container {
padding: 20px; padding: 20px;
padding-bottom: 40px; padding-bottom: 40px;