fix: lock resousers
This commit is contained in:
@@ -210,17 +210,7 @@
|
||||
>
|
||||
<!-- Badge -->
|
||||
<view class="unlock-badge" :class="tpl.unlockType">
|
||||
{{
|
||||
tpl.unlockType === "sing3"
|
||||
? "登录3天"
|
||||
: tpl.unlockType === "sing1"
|
||||
? "登录1天"
|
||||
: tpl.unlockType === "ad"
|
||||
? "广告"
|
||||
: tpl.unlockType === "vip"
|
||||
? "VIP"
|
||||
: "解锁"
|
||||
}}
|
||||
{{ getUnlockLabel(tpl.unlockType) }}
|
||||
</view>
|
||||
|
||||
<!-- Center Lock -->
|
||||
@@ -564,7 +554,7 @@ import {
|
||||
getCardMusicList,
|
||||
} from "@/api/make";
|
||||
import { getShareReward, msgCheckApi, watchAdReward } from "@/api/system";
|
||||
import { checkAbilityAndHandle } from "@/utils/ability.js";
|
||||
import { checkAbilityAndHandle, getUnlockLabel } from "@/utils/ability.js";
|
||||
import {
|
||||
onShareAppMessage,
|
||||
onShareTimeline,
|
||||
@@ -1383,7 +1373,7 @@ const currentTemplate = ref(templates.value[0]);
|
||||
const currentUnlockTpl = ref(null);
|
||||
|
||||
const applyTemplate = (tpl) => {
|
||||
if (tpl.isUnlock === false) {
|
||||
if (tpl.unlockType && !tpl.isUnlock) {
|
||||
handleUnlock(tpl);
|
||||
return;
|
||||
}
|
||||
@@ -1405,17 +1395,17 @@ const handleUnlock = (tpl) => {
|
||||
break;
|
||||
case "ad":
|
||||
currentUnlockTpl.value = tpl;
|
||||
rewardAdRef.value.showAd();
|
||||
rewardAdRef.value.show();
|
||||
break;
|
||||
case "sing1":
|
||||
uni.showToast({
|
||||
title: "需要连续登录1天解锁",
|
||||
title: "需要登录1天解锁",
|
||||
icon: "none",
|
||||
});
|
||||
break;
|
||||
case "sing3":
|
||||
uni.showToast({
|
||||
title: "需要连续登录3天解锁",
|
||||
title: "需要登录3天解锁",
|
||||
icon: "none",
|
||||
});
|
||||
break;
|
||||
@@ -1429,7 +1419,12 @@ const handleUnlock = (tpl) => {
|
||||
|
||||
const handleAdReward = async (token) => {
|
||||
try {
|
||||
const res = await watchAdReward(token);
|
||||
const res = await watchAdReward(
|
||||
token,
|
||||
"unlock",
|
||||
activeTool.value === "template" ? "card_template" : "card_title_template",
|
||||
currentUnlockTpl.value.id,
|
||||
);
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: "解锁成功",
|
||||
|
||||
Reference in New Issue
Block a user