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",
});
};
export const getWallpaperRecommendList = async () => {
return request({
url: `/api/blessing/wallpaper/recommend/list`,
method: "get",
});
};

View File

@@ -13,7 +13,6 @@
</view>
</view>
<scroll-view scroll-y class="content-scroll">
<view class="content-container">
<!-- Sharer Info -->
<view class="sharer-info" v-if="detailData.from">
@@ -115,7 +114,6 @@
<view class="footer-sub">新春祝福 · 传递温情</view>
</view>
</view>
</scroll-view>
</view>
</template>
@@ -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;