fix: lock resousers
This commit is contained in:
@@ -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%);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user