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