fix: recommend list
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user