fix: recommend list

This commit is contained in:
zzc
2026-01-28 15:55:26 +08:00
parent e3edccbd65
commit 227a5b035e
3 changed files with 76 additions and 9 deletions

View File

@@ -284,10 +284,36 @@ const initSystemAvatars = async () => {
}
};
onLoad(() => {
onLoad((options) => {
initSystemAvatars();
loadFrames();
loadDecors();
// 处理推荐跳转参数
if (options && options.recommendId && options.type && options.imageUrl) {
const recommendItem = {
id: options.recommendId,
imageUrl: decodeURIComponent(options.imageUrl),
};
if (options.type === "frame") {
activeTab.value = "frame";
selectedFrame.value = recommendItem;
// 如果 frames 列表中有这个 id更新引用以保持选中状态可选但推荐
const found = frames.value.find((f) => f.id === recommendItem.id);
if (found) selectedFrame.value = found;
} else if (options.type === "decor") {
activeTab.value = "decor";
selectedDecor.value = recommendItem;
const found = decors.value.find((d) => d.id === recommendItem.id);
if (found) selectedDecor.value = found;
} else if (options.type === "avatar") {
currentAvatar.value = recommendItem;
// 检查系统头像列表
const found = systemAvatars.value.find((a) => a.id === recommendItem.id);
if (found) currentAvatar.value = found;
}
}
});
onReachBottom(() => {
@@ -653,11 +679,11 @@ onShareAppMessage(async () => {
};
}
const id = createAvatarId();
const shareTokenRes = {
shareToken: "iFmK8WjRm6TK",
};
// const shareTokenRes = await getShareToken("avatar_download", id);
// completeCardInfo(id);
// const shareTokenRes = {
// shareToken: "iFmK8WjRm6TK",
// };
const shareTokenRes = await getShareToken("avatar_download", id);
completeCardInfo(id);
return {
title: "制作我的新春头像",
path: `/pages/avatar/detail?shareToken=${shareTokenRes.shareToken}`,