fix: avatar view

This commit is contained in:
zzc
2026-01-28 16:41:05 +08:00
parent 227a5b035e
commit 3bd65b0ae1
3 changed files with 27 additions and 23 deletions

View File

@@ -65,7 +65,7 @@
<view class="section-header">
<view class="left">
<view class="bar"></view>
<text class="title">热门新春头像</text>
<text class="title">热门新春头像</text>
</view>
<text class="more" @tap="goToMake">查看全部</text>
</view>
@@ -77,9 +77,15 @@
@tap="goToMake"
>
<view class="frame-img-box">
<image :src="item.url" class="frame-img" mode="aspectFit" />
<image :src="item.imageUrl" class="frame-img" mode="aspectFit" />
</view>
<text class="frame-name">{{ item.name || "新春相框" }}</text>
<text class="frame-name">{{
item.type === "decor"
? "新春饰品"
: item.type === "avatar"
? "新春头像"
: "新春相框"
}}</text>
</view>
</view>
</view>
@@ -133,8 +139,9 @@
import { ref, onMounted } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { getBavBarHeight } from "@/utils/system";
import { getAvatarFrameList } from "@/api/avatar.js";
import { getPageDetail } from "@/api/system.js";
import { getAvatarRecommendList } from "@/api/avatar.js";
import { saveViewRequest } from "@/utils/common.js";
const defaultAvatar =
"https://file.lihailezzc.com/resource/d9b329082b32f8305101f708593a4882.png";
@@ -173,6 +180,7 @@ const fetchDetail = async () => {
try {
// uni.showLoading({ title: "加载中..." });
const res = await getPageDetail(shareToken.value);
saveViewRequest(shareToken.value, "avatar_download", res.id);
if (res) {
detailData.value = res;
}
@@ -186,11 +194,8 @@ const fetchDetail = async () => {
const fetchFrames = async () => {
try {
const res = await getAvatarFrameList(1);
if (res) {
const list = Array.isArray(res) ? res : res.list || [];
frameList.value = list.slice(0, 3); // Take first 3
}
const res = await getAvatarRecommendList();
frameList.value = res;
} catch (e) {
console.error(e);
}