fix: point exp

This commit is contained in:
zzc
2026-02-25 00:11:25 +08:00
parent 19c18b478f
commit 818e947513

View File

@@ -308,6 +308,16 @@ const downloadAvatar = async (item) => {
});
return;
}
if (
abilityRes?.blockType === "need_ad" &&
abilityRes?.message === "观看广告可继续"
) {
uni.showToast({
title: "分享给好友即可下载",
icon: "none",
});
return;
}
uni.showToast({
title: "您今日下载次数已用完,明日再试",
icon: "none",
@@ -317,10 +327,13 @@ const downloadAvatar = async (item) => {
uni.showLoading({ title: "下载中..." });
try {
await saveRemoteImageToLocal(item.imageUrl);
// Use avatar specific download record
await avatarDownloadRecord({ id: item.id, url: item.imageUrl });
uni.showToast({ title: "保存成功", icon: "success" });
await Promise.all([
saveRemoteImageToLocal(item.imageUrl),
avatarDownloadRecord({ id: item.id, url: item.imageUrl }),
]);
await userStore.fetchUserAssets();
uni.showToast({ title: "保存成功 消耗 20 积分", icon: "success" });
} catch (e) {
console.error("Download failed", e);
// saveRemoteImageToLocal handles its own error toast usually, but let's be safe