修复礼包红包弹窗领取展示残留

This commit is contained in:
pllx
2026-04-30 16:23:37 +08:00
parent f354516869
commit ee525f049e
2 changed files with 2 additions and 45 deletions
+1 -22
View File
@@ -318,8 +318,6 @@ function renderRedPacketModal(payload) {
byId("rp-countdown").textContent = payload.expireSeconds;
byId("rp-timer-bar").style.width = "100%";
byId("rp-status-msg").textContent = "";
byId("rp-claims-list").style.display = "none";
byId("rp-claims-items").textContent = "";
const emoji = modal.querySelector(".rp-emoji");
if (emoji) {
@@ -556,7 +554,7 @@ function updateClaimButtonAfterFailure(button, message) {
}
/**
* 收到领取广播后,同步弹窗内领取名单与剩余数
* 收到领取广播后,同步弹窗内剩余份数与抢完状态
*
* @param {string} username 领取者用户名
* @param {number|string} amount 领取数量
@@ -570,25 +568,6 @@ export function updateRedPacketClaimsUI(username, amount, remaining, type = redP
remainingElement.textContent = remaining;
}
const list = byId("rp-claims-list");
const items = byId("rp-claims-items");
if (!list || !items) {
return;
}
list.style.display = "block";
const item = document.createElement("div");
const name = document.createElement("span");
const value = document.createElement("span");
const typeLabel = type === "exp" ? "经验" : "金币";
item.className = "rp-claim-item";
name.textContent = username;
value.textContent = `+${amount} ${typeLabel}`;
item.append(name, value);
items.prepend(item);
if (remaining <= 0) {
const button = byId("rp-claim-btn");
if (button && !redPacketClaimed) {