From 818e947513608d1f12183df49013abc8977e3f10 Mon Sep 17 00:00:00 2001 From: zzc <1761997216@qq.com> Date: Wed, 25 Feb 2026 00:11:25 +0800 Subject: [PATCH] fix: point exp --- pages/avatar/download.vue | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pages/avatar/download.vue b/pages/avatar/download.vue index 6d146de..a8acbb6 100644 --- a/pages/avatar/download.vue +++ b/pages/avatar/download.vue @@ -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