fix: lock resousers

This commit is contained in:
zzc
2026-03-11 17:44:24 +08:00
parent 9c4f0c5650
commit f653e6659a
2 changed files with 59 additions and 16 deletions

View File

@@ -169,6 +169,21 @@
<view v-if="title?.id === currentTitle?.id" class="tpl-check"
></view
>
<!-- Lock Overlay -->
<view
v-if="!title.isUnlock && title.unlockType"
class="lock-overlay"
>
<!-- Badge -->
<view class="unlock-badge" :class="title.unlockType">
{{ getUnlockLabel(title.unlockType) }}
</view>
<!-- Center Lock -->
<view class="center-lock">
<uni-icons type="locked-filled" size="18" color="#fff" />
</view>
</view>
</view>
</view>
<view v-if="loadingTitles" class="loading-more">加载中...</view>
@@ -1397,15 +1412,21 @@ const handleUnlock = (tpl) => {
currentUnlockTpl.value = tpl;
rewardAdRef.value.show();
break;
case "sing1":
case "sing3":
uni.showToast({
title: "需要登录1天解锁",
title: "需要连续签到1天解锁",
icon: "none",
});
break;
case "sing3":
case "sing5":
uni.showToast({
title: "需要登录3天解锁",
title: "需要连续签到5天解锁",
icon: "none",
});
break;
case "sing7":
uni.showToast({
title: "需要连续签到7天解锁",
icon: "none",
});
break;
@@ -1433,15 +1454,27 @@ const handleAdReward = async (token) => {
// 解锁成功后,更新本地状态,允许使用
if (currentUnlockTpl.value) {
currentUnlockTpl.value.isUnlock = true;
// 同时更新列表中的状态
const index = templates.value.findIndex(
(t) => t.id === currentUnlockTpl.value.id,
);
if (index !== -1) {
templates.value[index].isUnlock = true;
if (activeTool.value === "template") {
// 同时更新列表中的状态
const index = templates.value.findIndex(
(t) => t.id === currentUnlockTpl.value.id,
);
if (index !== -1) {
templates.value[index].isUnlock = true;
}
applyTemplate(currentUnlockTpl.value);
} else if (activeTool.value === "title") {
// 同时更新列表中的状态
const index = titles.value.findIndex(
(t) => t.id === currentUnlockTpl.value.id,
);
if (index !== -1) {
titles.value[index].isUnlock = true;
}
selectTitle(currentUnlockTpl.value);
}
applyTemplate(currentUnlockTpl.value);
currentUnlockTpl.value = null;
}
}
@@ -1452,6 +1485,10 @@ const handleAdReward = async (token) => {
};
const selectTitle = (title) => {
if (title.unlockType && !title.isUnlock) {
handleUnlock(title);
return;
}
trackRecord({
eventName: "card_title_choose",
eventType: "click",
@@ -2045,7 +2082,9 @@ function drawRoundRect(ctx, x, y, w, h, r, color) {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
&.sing1,
&.sing3 {
&.sing3,
&.sing5,
&.sing7 {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
}
@@ -2296,7 +2335,9 @@ function drawRoundRect(ctx, x, y, w, h, r, color) {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
&.sing1,
&.sing3 {
&.sing3,
&.sing5,
&.sing7 {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
}

View File

@@ -78,9 +78,11 @@ export const getUnlockLabel = (unlockType) => {
if (!unlockType) return "解锁";
switch (unlockType) {
case "sing3":
return "登录3天";
case "sing1":
return "登录1天";
return "连续签到3天";
case "sing5":
return "连续签到5天";
case "sing7":
return "连续签到7天";
case "ad":
return "广告";
case "vip":