fix: user deduct point
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user