fix: user deduct point

This commit is contained in:
zzc
2026-03-10 11:41:05 +08:00
parent d8c5c3a919
commit 2d3cefa43e
10 changed files with 140 additions and 125 deletions

View File

@@ -314,10 +314,7 @@ const downloadAvatar = async (item) => {
return;
}
const canProceed = await checkAbilityAndHandle(
"avatar_download",
rewardAdRef,
);
const canProceed = await checkAbilityAndHandle("avatar_download");
if (!canProceed) return;
uni.showLoading({ title: "下载中..." });

View File

@@ -213,13 +213,14 @@ import {
onReachBottom,
} from "@dcloudio/uni-app";
import { useUserStore } from "@/stores/user";
import { getShareReward, abilityCheck } from "@/api/system.js";
import { checkAbilityAndHandle } from "@/utils/ability.js";
import {
getAvatarSystemList,
getAvatarFrameList,
getAvatarDecorList,
avatarCreateComplete,
} from "@/api/avatar.js";
import { getShareReward } from "@/api/system.js";
import {
saveRecordRequest,
getShareToken,
@@ -685,29 +686,14 @@ const saveAndUse = async () => {
return;
}
const abilityRes = await abilityCheck("avatar_download");
if (!abilityRes.canUse) {
if (
abilityRes?.blockType === "need_share" &&
abilityRes?.message === "分享可继续"
) {
uni.showToast({
title: "分享给好友可继续使用",
icon: "none",
});
return;
}
uni.showToast({
title: "您今日头像下载次数已用完,明日再试",
icon: "none",
});
return;
}
const canProceed = await checkAbilityAndHandle("avatar_download");
if (!canProceed) return;
const tempPath = await saveByCanvas(true);
const id = createAvatarId();
saveRecordRequest(tempPath, id, "avatar_download");
await saveRecordRequest(tempPath, id, "avatar_download");
completeCardInfo(id);
userStore.fetchUserAssets();
return;
// 调用avatarDownloadRecord API记录下载次数
// await avatarDownloadRecord({