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

@@ -246,12 +246,8 @@ import { ref, onMounted, computed } from "vue";
import { getStatusBarHeight } from "@/utils/system";
import { onShareAppMessage, onShareTimeline, onShow } from "@dcloudio/uni-app";
import { useUserStore } from "@/stores/user";
import {
getRecommendList,
getRankList,
abilityCheck,
watchAdReward,
} from "@/api/system";
import { checkAbilityAndHandle } from "@/utils/ability.js";
import { getRecommendList, getRankList, watchAdReward } from "@/api/system";
import { saveRemoteImageToLocal, saveRecordRequest } from "@/utils/common";
import { getUserSignInfo, userSignIn } from "@/api/user";
import { avatarDownloadRecord } from "@/api/avatar";
@@ -481,40 +477,8 @@ const handleDownload = async (item) => {
const type =
item.type === "wallpaper" ? "wallpaper_download" : "avatar_download";
const abilityRes = await abilityCheck(type);
if (!abilityRes.canUse) {
if (
abilityRes?.blockType === "need_share" &&
abilityRes?.message === "分享可继续"
) {
uni.showToast({
title: "分享给好友即可下载",
icon: "none",
});
return;
}
if (
abilityRes?.blockType === "need_ad" &&
abilityRes?.message === "观看广告可继续"
) {
uni.showModal({
title: "积分不足",
content: "观看广告可获得50积分继续下载",
success: (res) => {
if (res.confirm) {
rewardAdRef.value.show();
}
},
});
return;
}
uni.showToast({
title: "您今日下载次数已用完,明日再试",
icon: "none",
});
return;
}
const canProceed = await checkAbilityAndHandle(type);
if (!canProceed) return;
uni.showLoading({ title: "下载中..." });
try {